begin wiring up demo to be wasm-able #1424
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
name: Test | |
on: | |
push: | |
branches: [ main ] | |
pull_request: | |
branches: [ main ] | |
workflow_dispatch: | |
workflow_call: | |
concurrency: | |
group: ${{ github.workflow }}-${{ github.ref }}-${{ github.event_name }} | |
cancel-in-progress: true | |
jobs: | |
test: | |
strategy: | |
fail-fast: false | |
matrix: | |
os: [ubuntu-latest, macos-latest, windows-latest] | |
options: ['', '-Dlog -Dchance -Dcalc', '-Dshowdown', '-Dshowdown -Dlog -Dchance -Dcalc'] | |
zig: [local, master] # local = 0.11.0 | |
exclude: | |
- os: windows-latest | |
zig: local | |
runs-on: ${{matrix.os}} | |
steps: | |
- uses: actions/checkout@v4 | |
- run: git config core.symlinks true | |
# NOTE: we rely on npm postinstall-ed zig for local zig | |
- uses: goto-bus-stop/setup-zig@default | |
if: ${{ matrix.zig != 'local' }} | |
with: | |
version: ${{matrix.zig}} | |
- run: npm install | |
- run: echo "${GITHUB_WORKSPACE}/build/bin/zig" >> $GITHUB_PATH | |
if: ${{ matrix.zig == 'local' && matrix.os != 'windows-latest' }} | |
- run: echo "${env:GITHUB_WORKSPACE}/build/bin/zig" >> $env:GITHUB_PATH | |
if: ${{ matrix.zig == 'local' && matrix.os == 'windows-latest' }} | |
- run: zig build test ${{matrix.options}} | |
- run: zig build test ${{matrix.options}} -Doptimize=ReleaseFast | |
- run: npm run compile | |
- run: npm test | |
- run: node src/bin/install-pkmn-engine --options="${{matrix.options}}" | |
- run: npm run test:integration | |
- run: zig build ${{matrix.options}} -p build | |
- run: make example options="${{matrix.options}}" | |
- uses: AnnikaCodes/install-ziglint@main | |
with: | |
token: ${{ secrets.GITHUB_TOKEN }} | |
- run: make lint | |
- run: make clean && node src/bin/install-pkmn-engine --zig | |
- run: zig build ${{matrix.options}} -p build -Ddynamic | |
- run: make c-example options="${{matrix.options}}" dynamic=true |