Version 0.2.1 #427
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
on: [push, pull_request] | |
name: Build / Test / Release | |
jobs: | |
prepare-release: | |
name: Prepare a release | |
runs-on: ubuntu-latest | |
steps: | |
- uses: actions/checkout@v4 | |
- name: Make a release | |
run: | | |
gh release create "${{ github.ref_name }}" --draft | |
env: | |
GH_TOKEN: ${{ secrets.GITHUB_TOKEN }} | |
if: ${{ github.event_name == 'push' && github.ref_type == 'tag' }} | |
build-and-test: | |
name: Build and test | |
needs: [prepare-release] | |
runs-on: ubuntu-24.04 | |
steps: | |
- uses: actions/checkout@v4 | |
- name: Install dependencies | |
run: | | |
sudo apt-get update | |
sudo apt-get install mlton lua5.3 luajit | |
- name: Build | |
run: make | |
- name: Test (Lua) | |
run: make test-lua | |
- name: Test (LuaJIT) | |
run: make test-luajit | |
env: | |
LUA_INIT_5_3: "" | |
# LuaJIT: Workaround https://github.com/LuaJIT/LuaJIT/issues/859 | |
LUA_INIT: "local c=math.ceil;math.ceil=function(x)if-1<x and x<0 then return 0/(-1)else return c(x)end end" | |
- name: Test (JS) | |
run: make test-nodejs | |
- name: Test (JS-CPS) | |
run: make test-nodejs-cps | |
- name: Test (Lua-continuations) | |
run: make test-lua-continuations | |
- name: Prepare third-party libraries | |
run: make -C thirdparty install | |
- name: Compile myself (Lua) | |
run: | | |
bin/lunarml compile -o lunarml.lua --default-ann "valDescInComments error" src/lunarml-main.mlb | |
luac -p lunarml.lua | |
- name: Compile myself (LuaJIT) | |
run: | | |
bin/lunarml compile --luajit -o lunarml-luajit.lua --default-ann "valDescInComments error" src/lunarml-main.mlb | |
luajit -bl lunarml-luajit.lua > /dev/null | |
- name: Compile myself and validate (JavaScript) | |
run: make validate-js | |
env: | |
NODE_OPTIONS: "--max-old-space-size=4096" | |
- name: Archive | |
run: make archive | |
- name: Upload | |
uses: actions/upload-artifact@v4 | |
with: | |
name: archive | |
path: | | |
lunarml-*.tar.gz | |
lunarml-*.zip | |
- name: Attach tarballs to the release | |
run: | | |
gh release upload "${{ github.ref_name }}" lunarml-*.tar.gz lunarml-*.zip | |
env: | |
GH_TOKEN: ${{ secrets.GITHUB_TOKEN }} | |
if: ${{ github.event_name == 'push' && github.ref_type == 'tag' }} | |
build-docs: | |
name: Build docs | |
needs: [prepare-release] | |
runs-on: ubuntu-24.04 | |
steps: | |
- uses: actions/checkout@v4 | |
- name: Setup Rye | |
uses: eifinger/setup-rye@v4 | |
with: | |
enable-cache: true | |
working-directory: 'docs/' | |
- name: Sync dependencies | |
run: rye sync | |
working-directory: ./docs | |
- name: Build HTML | |
run: make -C docs SPHINXBUILD="rye run sphinx-build" html | |
- name: Upload artifacts | |
uses: actions/upload-artifact@v4 | |
with: | |
name: html-docs | |
path: docs/_build/html/ | |
- name: Attach docs to the release | |
run: | | |
mv docs/_build/html "lunarml-docs-${{ github.ref_name }}" | |
zip -r "lunarml-docs-${{ github.ref_name }}.zip" "lunarml-docs-${{ github.ref_name }}" | |
gh release upload "${{ github.ref_name }}" "lunarml-docs-${{ github.ref_name }}.zip" | |
env: | |
GH_TOKEN: ${{ secrets.GITHUB_TOKEN }} | |
if: ${{ github.event_name == 'push' && github.ref_type == 'tag' }} |