Try latest cache fix #1682
This file contains hidden or 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
| name: CI | |
| on: [push, pull_request] | |
| concurrency: | |
| group: ${{ github.workflow }}-${{ github.ref }} | |
| cancel-in-progress: true | |
| jobs: | |
| test: | |
| strategy: | |
| fail-fast: false | |
| matrix: | |
| os: [macos-latest, ubuntu-latest, windows-latest] | |
| target: [eval, js, hl, cpp, jvm, php, python, neko, lua] | |
| exclude: | |
| # php is not available by default for macos runners, probably not worth bothering | |
| - os: macos-latest | |
| target: php | |
| # Lua is annoying to set up on Windows, so only run it on Linux and macOS | |
| - os: windows-latest | |
| target: lua | |
| runs-on: ${{ matrix.os }} | |
| steps: | |
| - uses: actions/checkout@v4 | |
| - uses: HaxeFoundation/setup-haxe@d3b0c149ec7de0697e3d321c458e6649a6ecec46 | |
| with: | |
| haxe-version: "latest" | |
| - name: Setup hashlink | |
| if: matrix.target == 'hl' | |
| uses: HaxeFoundation/setup-hashlink@v1 | |
| with: | |
| version: nightly | |
| - name: Check hashlink | |
| if: matrix.target == 'hl' | |
| run: hl --version | |
| - name: Setup Lua | |
| if: matrix.target == 'lua' | |
| # Note: -D lua-vanilla cannot be used here because hxcoro unconditionally requires luv: | |
| # 1. The generated event loop calls luv.run() at startup to drive async tasks. | |
| # 2. Sys.getenv (inside #if sys, which is true for Lua) reads HXCORO_DISPATCHER at | |
| # startup; with -D lua-vanilla, any Sys call throws NotImplementedException. | |
| # Therefore the full luarocks dependency set (luv, lrexlib-pcre2, luautf8, bit32) is needed. | |
| shell: bash | |
| run: | | |
| if [[ "$RUNNER_OS" == "Linux" ]]; then | |
| sudo apt-get install -y lua5.4 lua5.4-dev luarocks libpcre2-dev | |
| sudo update-alternatives --set lua-interpreter /usr/bin/lua5.4 | |
| sudo luarocks --lua-version 5.4 install luv | |
| sudo luarocks --lua-version 5.4 install lrexlib-pcre2 | |
| sudo luarocks --lua-version 5.4 install luautf8 | |
| sudo luarocks --lua-version 5.4 install bit32 | |
| elif [[ "$RUNNER_OS" == "macOS" ]]; then | |
| brew install lua luarocks pcre2 | |
| luarocks install luv | |
| luarocks install lrexlib-pcre2 | |
| luarocks install luautf8 | |
| luarocks install bit32 | |
| fi | |
| - name: Setup haxelib | |
| run: | | |
| haxelib newrepo | |
| ${{ matrix.target != 'jvm' }} || haxelib install hxjava | |
| ${{ matrix.target != 'cpp' }} || haxelib git hxcpp https://github.com/HaxeFoundation/hxcpp.git | |
| ${{ matrix.target != 'cpp' }} || haxe --cwd .haxelib/hxcpp/git/tools/hxcpp compile.hxml | |
| ${{ matrix.target != 'cpp' }} || haxelib git hxcpp_luv_io https://github.com/Aidan63/hxcpp_luv_io | |
| haxelib dev hxcoro . | |
| haxelib list | |
| haxe -version | |
| neko -version | |
| - name: Run tests | |
| shell: bash | |
| run: | | |
| TARGET="${{ matrix.target }}" | |
| run_release() { | |
| haxe --cwd tests build-$TARGET.hxml --hxb bin/test.hxb | |
| } | |
| # Run with the default dispatcher for this target | |
| run_default() { | |
| haxe --cwd tests -debug build-$TARGET.hxml | |
| run_release | |
| haxe --cwd tests build-$TARGET.hxml --hxb-lib bin/test.hxb | |
| } | |
| # Run again with an alternative dispatcher (env var read at runtime by Main.hx) | |
| # For cpp: hxcpp incremental compilation skips the C++ rebuild and re-runs the | |
| # existing binary with the new HXCORO_DISPATCHER value inherited from the environment. | |
| # For other targets: a quick recompile and re-run. | |
| run_extra() { | |
| HXCORO_DISPATCHER=$1 haxe --cwd tests build-$TARGET.hxml | |
| } | |
| case "$TARGET" in | |
| eval) | |
| run_default | |
| run_extra trampoline | |
| run_extra threadpool | |
| ;; | |
| cpp) | |
| run_release | |
| run_extra trampoline | |
| run_extra threadpool | |
| ;; | |
| hl|jvm) | |
| run_default | |
| run_extra trampoline | |
| ;; | |
| python) | |
| run_default | |
| run_extra threadpool | |
| ;; | |
| *) | |
| run_default | |
| ;; | |
| esac | |
| - name: Run callstack tests | |
| run: haxe --cwd callstack-tests build-${{ matrix.target }}.hxml |