From 1b5e2b0475c4c2976fff12b1d22fd32b18623b5e Mon Sep 17 00:00:00 2001 From: Simon Krajewski Date: Fri, 30 Oct 2026 09:14:17 +0100 Subject: [PATCH 1/2] [ci] Reduce job count and skip duplicate PR runs PRs from branches of this repository are already tested by the push event, so skip the pull_request run for them, and cancel superseded runs on non-master branches. Group the per-platform tests into four jobs (runtime, tooling, cppia, haxe test suite) instead of twelve, and build the cppia host only once for both the interp and jit runs. Within a grouped job, every test still runs if an earlier one fails. Co-Authored-By: Claude Opus 5.5 --- .github/workflows/main.yml | 135 ++++--------------- .github/workflows/test.yml | 269 +++++++++++++------------------------ 2 files changed, 124 insertions(+), 280 deletions(-) diff --git a/.github/workflows/main.yml b/.github/workflows/main.yml index 09887b676..afb8e5e27 100644 --- a/.github/workflows/main.yml +++ b/.github/workflows/main.yml @@ -1,8 +1,14 @@ name: main on: [push, pull_request] +concurrency: + group: ${{ github.workflow }}-${{ github.ref }} + cancel-in-progress: ${{ github.ref != 'refs/heads/master' }} + jobs: check-headers: + # PRs from branches of this repository are already tested by the push event + if: github.event_name != 'pull_request' || github.event.pull_request.head.repo.full_name != github.repository name: Check headers runs-on: ubuntu-latest steps: @@ -19,114 +25,29 @@ jobs: include name: Check public headers - Windows32: - strategy: - fail-fast: false - matrix: - haxe: [ 4.3.7, latest ] - uses: ./.github/workflows/test.yml - name: Test Windows (32bit) - with: - haxe: ${{ matrix.haxe }} - arch: 32 - sep: \ - ext: .dll - os: windows-latest - - Windows64: - strategy: - fail-fast: false - matrix: - haxe: [ 4.3.7, latest ] - uses: ./.github/workflows/test.yml - name: Test Windows (64bit) - with: - haxe: ${{ matrix.haxe }} - arch: 64 - sep: \ - ext: .dll - os: windows-latest - - WindowsArm64: + Test: + if: github.event_name != 'pull_request' || github.event.pull_request.head.repo.full_name != github.repository strategy: fail-fast: false matrix: + platform: [ Windows32, Windows64, WindowsArm64, MacOS64, MacOSArm, Linux32, Linux64, LinuxArm64 ] haxe: [ 4.3.7, latest ] - uses: ./.github/workflows/test.yml - name: Test Windows (Arm64) - with: - haxe: ${{ matrix.haxe }} - arch: Arm64 - sep: \ - ext: .dll - os: windows-11-arm - - MacOS64: - strategy: - fail-fast: false - matrix: - haxe: [ 4.3.7, latest ] - uses: ./.github/workflows/test.yml - name: Test MacOS (x86_64) - with: - haxe: ${{ matrix.haxe }} - arch: 64 - sep: / - ext: .dylib - os: macos-15-intel - - MacOSArm: - strategy: - fail-fast: false - matrix: - haxe: [ 4.3.7, latest ] - uses: ./.github/workflows/test.yml - name: Test MacOS (Arm64) - with: - haxe: ${{ matrix.haxe }} - arch: Arm64 - sep: / - ext: .dylib - os: macos-latest - - Linux32: - strategy: - fail-fast: false - matrix: - haxe: [ 4.3.7, latest ] - uses: ./.github/workflows/test.yml - name: Test Linux (32bit) - with: - haxe: ${{ matrix.haxe }} - arch: 32 - sep: / - ext: .dso - os: ubuntu-latest - - Linux64: - strategy: - fail-fast: false - matrix: - haxe: [ 4.3.7, latest ] - uses: ./.github/workflows/test.yml - name: Test Linux (64bit) - with: - haxe: ${{ matrix.haxe }} - arch: 64 - sep: / - ext: .dso - os: ubuntu-latest - - LinuxArm64: - strategy: - fail-fast: false - matrix: - haxe: [ latest ] # 4.3.7 doesn't have a linux arm build - uses: ./.github/workflows/test.yml - name: Test Linux (Arm64) - with: - haxe: ${{ matrix.haxe }} - arch: Arm64 - sep: / - ext: .dso - os: ubuntu-24.04-arm + exclude: + - platform: LinuxArm64 # 4.3.7 doesn't have a linux arm build + haxe: 4.3.7 + include: + - { platform: Windows32, name: Windows (32bit), arch: 32, ext: .dll, os: windows-latest } + - { platform: Windows64, name: Windows (64bit), arch: 64, ext: .dll, os: windows-latest } + - { platform: WindowsArm64, name: Windows (Arm64), arch: Arm64, ext: .dll, os: windows-11-arm } + - { platform: MacOS64, name: MacOS (x86_64), arch: 64, ext: .dylib, os: macos-15-intel } + - { platform: MacOSArm, name: MacOS (Arm64), arch: Arm64, ext: .dylib, os: macos-latest } + - { platform: Linux32, name: Linux (32bit), arch: 32, ext: .dso, os: ubuntu-latest } + - { platform: Linux64, name: Linux (64bit), arch: 64, ext: .dso, os: ubuntu-latest } + - { platform: LinuxArm64, name: Linux (Arm64), arch: Arm64, ext: .dso, os: ubuntu-24.04-arm } + uses: ./.github/workflows/test.yml + name: Test ${{ matrix.name }} (${{ matrix.haxe }}) + with: + haxe: ${{ matrix.haxe }} + arch: ${{ matrix.arch }} + ext: ${{ matrix.ext }} + os: ${{ matrix.os }} diff --git a/.github/workflows/test.yml b/.github/workflows/test.yml index 00386bd9f..42197f057 100644 --- a/.github/workflows/test.yml +++ b/.github/workflows/test.yml @@ -8,9 +8,6 @@ on: arch: required: true type: string - sep: - required: true - type: string ext: required: true type: string @@ -21,161 +18,121 @@ on: env: HXCPP_ARCH_FLAG: ${{ inputs.arch == 'Arm64' && 'HXCPP_ARM64' || format('HXCPP_M{0}', inputs.arch) }} +defaults: + run: + shell: bash + +# Tests are grouped into a few jobs per platform to avoid paying the setup cost for each of them. +# Within a job, each test step runs as long as setup succeeded, so one failing test doesn't hide the others. jobs: - haxe: + runtime: runs-on: ${{ inputs.os }} - name: haxe - defaults: - run: - working-directory: test/haxe + name: runtime tests steps: - name: checkout uses: actions/checkout@v7 - name: setup + id: setup uses: ./.github/workflows/setup with: haxe: ${{ inputs.haxe }} arch: ${{ inputs.arch }} - - name: build - run: haxe compile.hxml -D ${{ env.HXCPP_ARCH_FLAG }} - - name: run - run: bin${{ inputs.sep }}TestMain + - name: setup mariadb + if: runner.os == 'Linux' + run: | + set -ex + sudo apt-get update -qqy + sudo apt-get install -qqy mariadb-server + sudo systemctl start mariadb + sudo mariadb -u root -e "create database hxcpp; grant all privileges on hxcpp.* to hxcpp@localhost identified by 'hxcpp'; flush privileges;" + + - name: haxe + if: ${{ !cancelled() && steps.setup.outcome == 'success' }} + working-directory: test/haxe + run: | + haxe compile.hxml -D $HXCPP_ARCH_FLAG + bin/TestMain - cffi: + - name: std + if: ${{ !cancelled() && steps.setup.outcome == 'success' }} + working-directory: test/std + run: | + haxe compile${{ inputs.arch }}.hxml + ${{ inputs.arch == 'Arm64' && 'arm64' || format('cpp{0}', inputs.arch) }}/Test + + - name: native + if: ${{ !cancelled() && steps.setup.outcome == 'success' }} + working-directory: test/native + run: | + haxe compile.hxml -D $HXCPP_ARCH_FLAG + bin/Native + + tools: runs-on: ${{ inputs.os }} - name: cffi - defaults: - run: - working-directory: test/cffi + name: tooling tests steps: - name: checkout uses: actions/checkout@v7 - name: setup + id: setup uses: ./.github/workflows/setup with: haxe: ${{ inputs.haxe }} arch: ${{ inputs.arch }} - - name: build project - working-directory: test/cffi/project - run: haxelib run hxcpp build.xml -Ddebug -D${{ env.HXCPP_ARCH_FLAG }} - - name: build - run: haxe compile.hxml --debug -D ${{ env.HXCPP_ARCH_FLAG }} - - name: build (utf8) - run: haxe compile-utf8.hxml --debug -D ${{ env.HXCPP_ARCH_FLAG }} - - name: build (neko) - run: haxe compile-neko.hxml --debug -D ${{ env.HXCPP_ARCH_FLAG }} - - name: copy - run: cp project/ndll/*/prime${{ inputs.ext }} bin/neko/prime.ndll - - name: run - run: bin${{ inputs.sep }}cpp${{ inputs.sep }}TestMain-debug - - name: run (utf8) - run: bin${{ inputs.sep }}cpp-utf8${{ inputs.sep }}TestMain-debug - - name: run (neko) - if: inputs.arch == '64' - working-directory: test/cffi/bin/neko - run: neko TestMain.n - telemetry: - strategy: - fail-fast: false - matrix: - mode: [ debug, release ] - include: - - suffix: -debug - mode: debug - runs-on: ${{ inputs.os }} - name: telemetry (${{ matrix.mode }}) - defaults: - run: + - name: cffi + if: ${{ !cancelled() && steps.setup.outcome == 'success' }} + working-directory: test/cffi + run: | + (cd project && haxelib run hxcpp build.xml -Ddebug -D$HXCPP_ARCH_FLAG) + haxe compile.hxml --debug -D $HXCPP_ARCH_FLAG + haxe compile-utf8.hxml --debug -D $HXCPP_ARCH_FLAG + haxe compile-neko.hxml --debug -D $HXCPP_ARCH_FLAG + cp project/ndll/*/prime${{ inputs.ext }} bin/neko/prime.ndll + bin/cpp/TestMain-debug + bin/cpp-utf8/TestMain-debug + if [ "${{ inputs.arch }}" = "64" ]; then + (cd bin/neko && neko TestMain.n) + fi + + - name: telemetry (debug) + if: ${{ !cancelled() && steps.setup.outcome == 'success' }} working-directory: test/telemetry - steps: - - name: checkout - uses: actions/checkout@v7 - - name: setup - uses: ./.github/workflows/setup - with: - haxe: ${{ inputs.haxe }} - arch: ${{ inputs.arch }} - - name: build - run: haxe compile.hxml ${{ matrix.suffix }} -D ${{ env.HXCPP_ARCH_FLAG }} - - name: run - run: bin${{ inputs.sep }}TestMain${{ matrix.suffix }} + run: | + haxe compile.hxml -debug -D $HXCPP_ARCH_FLAG + bin/TestMain-debug - debugger: - runs-on: ${{ inputs.os }} - name: debugger - defaults: - run: + - name: telemetry (release) + if: ${{ !cancelled() && steps.setup.outcome == 'success' }} + working-directory: test/telemetry + run: | + haxe compile.hxml -D $HXCPP_ARCH_FLAG + bin/TestMain + + - name: debugger + if: ${{ !cancelled() && steps.setup.outcome == 'success' }} working-directory: test/debugger - steps: - - name: checkout - uses: actions/checkout@v7 - - name: setup - uses: ./.github/workflows/setup - with: - haxe: ${{ inputs.haxe }} - arch: ${{ inputs.arch }} - - name: build - run: haxe compile.hxml -D ${{ env.HXCPP_ARCH_FLAG }} - - name: run - run: bin${{ inputs.sep }}App-debug + run: | + haxe compile.hxml -D $HXCPP_ARCH_FLAG + bin/App-debug - native: - runs-on: ${{ inputs.os }} - name: native - defaults: - run: - working-directory: test/native - steps: - - name: checkout - uses: actions/checkout@v7 - - name: setup - uses: ./.github/workflows/setup - with: - haxe: ${{ inputs.haxe }} - arch: ${{ inputs.arch }} - - name: build - run: haxe compile.hxml -D ${{ env.HXCPP_ARCH_FLAG }} - - name: run - run: bin${{ inputs.sep }}Native + - name: build tool + if: ${{ !cancelled() && steps.setup.outcome == 'success' }} + working-directory: test/cxx_standard + run: | + for xml in *.xml; do + haxelib run hxcpp $xml + haxelib run hxcpp $xml clean + done - std: - runs-on: ${{ inputs.os }} - name: std - defaults: - run: - working-directory: test/std - steps: - - name: checkout - uses: actions/checkout@v7 - - name: setup - uses: ./.github/workflows/setup - with: - haxe: ${{ inputs.haxe }} - arch: ${{ inputs.arch }} - - name: setup mariadb - if: runner.os == 'Linux' - run: | - set -ex - sudo apt-get update -qqy - sudo apt-get install -qqy mariadb-server - sudo systemctl start mariadb - sudo mariadb -u root -e "create database hxcpp; grant all privileges on hxcpp.* to hxcpp@localhost identified by 'hxcpp'; flush privileges;" - - name: build - run: haxe compile${{ inputs.arch }}.hxml - - name: run - run: ${{ inputs.arch == 'Arm64' && 'arm64' || format('cpp{0}', inputs.arch) }}${{ inputs.sep }}Test + - name: regression + if: ${{ !cancelled() && steps.setup.outcome == 'success' }} + working-directory: test/regression + run: haxe --run Run -D $HXCPP_ARCH_FLAG cppia: - strategy: - fail-fast: false - matrix: - mode: [ interp, jit ] - include: - - suffix: -jit - mode: jit runs-on: ${{ inputs.os }} - name: cppia (${{ matrix.mode }}) + name: cppia defaults: run: working-directory: test/cppia @@ -188,11 +145,15 @@ jobs: haxe: ${{ inputs.haxe }} arch: ${{ inputs.arch }} - name: build host - run: haxe compile-host.hxml -D ${{ env.HXCPP_ARCH_FLAG }} + run: haxe compile-host.hxml -D $HXCPP_ARCH_FLAG - name: build client - run: haxe compile-client.hxml -D ${{ env.HXCPP_ARCH_FLAG }} - - name: run - run: bin${{ inputs.sep }}CppiaHost bin${{ inputs.sep }}client.cppia ${{ matrix.suffix }} + run: haxe compile-client.hxml -D $HXCPP_ARCH_FLAG + - name: run (interp) + id: interp + run: bin/CppiaHost bin/client.cppia + - name: run (jit) + if: ${{ !cancelled() && steps.interp.outcome != 'skipped' }} + run: bin/CppiaHost bin/client.cppia -jit suite: runs-on: ${{ inputs.os }} @@ -211,7 +172,6 @@ jobs: - name: Get Haxe commit SHA if: inputs.haxe == 'latest' id: haxe_sha - shell: bash working-directory: ${{github.workspace}} env: @@ -242,43 +202,6 @@ jobs: # haxe 4 tests don't build with latest utest if: inputs.haxe != 'latest' - name: build - run: haxe compile-cpp.hxml -D ${{ env.HXCPP_ARCH_FLAG }} -D no_http - - name: run - run: bin${{ inputs.sep }}cpp${{ inputs.sep }}TestMain-debug - - build_tool: - runs-on: ${{ inputs.os }} - name: build tool tests - steps: - - name: checkout - uses: actions/checkout@v7 - - name: setup - uses: ./.github/workflows/setup - with: - haxe: ${{ inputs.haxe }} - arch: ${{ inputs.arch }} - - name: test c/cxx_standard attributes - working-directory: test/cxx_standard - shell: bash - run: | - for xml in *.xml; do - haxelib run hxcpp $xml - haxelib run hxcpp $xml clean - done - - regression: - runs-on: ${{ inputs.os }} - name: regression tests - defaults: - run: - working-directory: test/regression - steps: - - name: checkout - uses: actions/checkout@v7 - - name: setup - uses: ./.github/workflows/setup - with: - haxe: ${{ inputs.haxe }} - arch: ${{ inputs.arch }} + run: haxe compile-cpp.hxml -D $HXCPP_ARCH_FLAG -D no_http - name: run - run: haxe --run Run -D ${{ env.HXCPP_ARCH_FLAG }} + run: bin/cpp/TestMain-debug From d44fad5b8a868007cae24f022ec94646a1a671e8 Mon Sep 17 00:00:00 2001 From: Simon Krajewski Date: Fri, 30 Oct 2026 10:00:32 +0100 Subject: [PATCH 2/2] [ci] Fix shell for cppia and suite jobs, address review Job-level run defaults replace the workflow-level ones, so the cppia and suite jobs ran with PowerShell on Windows and $HXCPP_ARCH_FLAG expanded to nothing. Use ${{ env.HXCPP_ARCH_FLAG }} everywhere, and set bash for those jobs too. Also trace commands in multi-command steps and move the regression test to the runtime tests job. Co-Authored-By: Claude Opus 5.5 --- .github/workflows/test.yml | 44 +++++++++++++++++++++++--------------- 1 file changed, 27 insertions(+), 17 deletions(-) diff --git a/.github/workflows/test.yml b/.github/workflows/test.yml index 42197f057..25d241f7b 100644 --- a/.github/workflows/test.yml +++ b/.github/workflows/test.yml @@ -50,13 +50,15 @@ jobs: if: ${{ !cancelled() && steps.setup.outcome == 'success' }} working-directory: test/haxe run: | - haxe compile.hxml -D $HXCPP_ARCH_FLAG + set -x + haxe compile.hxml -D ${{ env.HXCPP_ARCH_FLAG }} bin/TestMain - name: std if: ${{ !cancelled() && steps.setup.outcome == 'success' }} working-directory: test/std run: | + set -x haxe compile${{ inputs.arch }}.hxml ${{ inputs.arch == 'Arm64' && 'arm64' || format('cpp{0}', inputs.arch) }}/Test @@ -64,9 +66,15 @@ jobs: if: ${{ !cancelled() && steps.setup.outcome == 'success' }} working-directory: test/native run: | - haxe compile.hxml -D $HXCPP_ARCH_FLAG + set -x + haxe compile.hxml -D ${{ env.HXCPP_ARCH_FLAG }} bin/Native + - name: regression + if: ${{ !cancelled() && steps.setup.outcome == 'success' }} + working-directory: test/regression + run: haxe --run Run -D ${{ env.HXCPP_ARCH_FLAG }} + tools: runs-on: ${{ inputs.os }} name: tooling tests @@ -84,10 +92,11 @@ jobs: if: ${{ !cancelled() && steps.setup.outcome == 'success' }} working-directory: test/cffi run: | - (cd project && haxelib run hxcpp build.xml -Ddebug -D$HXCPP_ARCH_FLAG) - haxe compile.hxml --debug -D $HXCPP_ARCH_FLAG - haxe compile-utf8.hxml --debug -D $HXCPP_ARCH_FLAG - haxe compile-neko.hxml --debug -D $HXCPP_ARCH_FLAG + set -x + (cd project && haxelib run hxcpp build.xml -Ddebug -D${{ env.HXCPP_ARCH_FLAG }}) + haxe compile.hxml --debug -D ${{ env.HXCPP_ARCH_FLAG }} + haxe compile-utf8.hxml --debug -D ${{ env.HXCPP_ARCH_FLAG }} + haxe compile-neko.hxml --debug -D ${{ env.HXCPP_ARCH_FLAG }} cp project/ndll/*/prime${{ inputs.ext }} bin/neko/prime.ndll bin/cpp/TestMain-debug bin/cpp-utf8/TestMain-debug @@ -99,42 +108,42 @@ jobs: if: ${{ !cancelled() && steps.setup.outcome == 'success' }} working-directory: test/telemetry run: | - haxe compile.hxml -debug -D $HXCPP_ARCH_FLAG + set -x + haxe compile.hxml -debug -D ${{ env.HXCPP_ARCH_FLAG }} bin/TestMain-debug - name: telemetry (release) if: ${{ !cancelled() && steps.setup.outcome == 'success' }} working-directory: test/telemetry run: | - haxe compile.hxml -D $HXCPP_ARCH_FLAG + set -x + haxe compile.hxml -D ${{ env.HXCPP_ARCH_FLAG }} bin/TestMain - name: debugger if: ${{ !cancelled() && steps.setup.outcome == 'success' }} working-directory: test/debugger run: | - haxe compile.hxml -D $HXCPP_ARCH_FLAG + set -x + haxe compile.hxml -D ${{ env.HXCPP_ARCH_FLAG }} bin/App-debug - name: build tool if: ${{ !cancelled() && steps.setup.outcome == 'success' }} working-directory: test/cxx_standard run: | + set -x for xml in *.xml; do haxelib run hxcpp $xml haxelib run hxcpp $xml clean done - - name: regression - if: ${{ !cancelled() && steps.setup.outcome == 'success' }} - working-directory: test/regression - run: haxe --run Run -D $HXCPP_ARCH_FLAG - cppia: runs-on: ${{ inputs.os }} name: cppia defaults: run: + shell: bash working-directory: test/cppia steps: - name: checkout @@ -145,9 +154,9 @@ jobs: haxe: ${{ inputs.haxe }} arch: ${{ inputs.arch }} - name: build host - run: haxe compile-host.hxml -D $HXCPP_ARCH_FLAG + run: haxe compile-host.hxml -D ${{ env.HXCPP_ARCH_FLAG }} - name: build client - run: haxe compile-client.hxml -D $HXCPP_ARCH_FLAG + run: haxe compile-client.hxml -D ${{ env.HXCPP_ARCH_FLAG }} - name: run (interp) id: interp run: bin/CppiaHost bin/client.cppia @@ -160,6 +169,7 @@ jobs: name: haxe test suite defaults: run: + shell: bash working-directory: haxe/tests/unit steps: - name: checkout @@ -202,6 +212,6 @@ jobs: # haxe 4 tests don't build with latest utest if: inputs.haxe != 'latest' - name: build - run: haxe compile-cpp.hxml -D $HXCPP_ARCH_FLAG -D no_http + run: haxe compile-cpp.hxml -D ${{ env.HXCPP_ARCH_FLAG }} -D no_http - name: run run: bin/cpp/TestMain-debug