From 40025d601e7ce0db7b1a96b583ebf19621929cdc Mon Sep 17 00:00:00 2001 From: tobil4sk Date: Mon, 15 Jul 2024 08:24:30 +0100 Subject: [PATCH] Fix mac ci failures (#1130) * update setup haxe * [ci] Add arm64 support to test suite * [ci] Run x86_64 mac tests as well * [ci] Use arm64 output folder for arm64 tests This is already in .gitignore --------- Co-authored-by: Aidan Lee --- .github/workflows/main.yml | 20 ++++++++++++++++--- .github/workflows/package.yml | 2 +- .github/workflows/setup/action.yml | 2 +- .github/workflows/test.yml | 31 ++++++++++++++++-------------- test/std/compileArm64.hxml | 5 +++++ 5 files changed, 41 insertions(+), 19 deletions(-) create mode 100644 test/std/compileArm64.hxml diff --git a/.github/workflows/main.yml b/.github/workflows/main.yml index 594fb4c00..fdbd5ec4c 100644 --- a/.github/workflows/main.yml +++ b/.github/workflows/main.yml @@ -30,18 +30,32 @@ jobs: ext: .dll os: windows-latest - MacOS: + MacOS64: strategy: fail-fast: false matrix: haxe: [ 4.3.4, latest ] uses: ./.github/workflows/test.yml - name: Test MacOS + name: Test MacOS (x86_64) with: haxe: ${{ matrix.haxe }} arch: 64 sep: / ext: .dylib + os: macos-13 + + MacOSArm: + strategy: + fail-fast: false + matrix: + haxe: [ 4.3.4, latest ] + uses: ./.github/workflows/test.yml + name: Test MacOS (Arm64) + with: + haxe: ${{ matrix.haxe }} + arch: Arm64 + sep: / + ext: .dylib os: macos-latest Linux32: @@ -70,4 +84,4 @@ jobs: arch: 64 sep: / ext: .dso - os: ubuntu-latest \ No newline at end of file + os: ubuntu-latest diff --git a/.github/workflows/package.yml b/.github/workflows/package.yml index d2bface2f..ead482b54 100644 --- a/.github/workflows/package.yml +++ b/.github/workflows/package.yml @@ -14,7 +14,7 @@ jobs: - name: Checkout uses: actions/checkout@v3 - - uses: Aidan63/setup-haxe@e4b347bc45596200a68804b232be9d73f80868a6 + - uses: Aidan63/setup-haxe@3d3101bcd0a2001699fc8295f4d9eddd0724d3e9 with: haxe-version: 4.3.4 diff --git a/.github/workflows/setup/action.yml b/.github/workflows/setup/action.yml index 5e2978381..cb170b80b 100644 --- a/.github/workflows/setup/action.yml +++ b/.github/workflows/setup/action.yml @@ -7,7 +7,7 @@ runs: using: composite steps: - name: install haxe - uses: Aidan63/setup-haxe@e4b347bc45596200a68804b232be9d73f80868a6 + uses: Aidan63/setup-haxe@3d3101bcd0a2001699fc8295f4d9eddd0724d3e9 with: haxe-version: ${{ inputs.haxe }} diff --git a/.github/workflows/test.yml b/.github/workflows/test.yml index 786576295..b1ad6f63b 100644 --- a/.github/workflows/test.yml +++ b/.github/workflows/test.yml @@ -18,6 +18,9 @@ on: required: true type: string +env: + HXCPP_ARCH_FLAG: ${{ inputs.arch == 'Arm64' && 'HXCPP_ARM64' || format('HXCPP_M{0}', inputs.arch) }} + jobs: haxe: runs-on: ${{ inputs.os }} @@ -33,7 +36,7 @@ jobs: with: haxe: ${{ inputs.haxe }} - name: build - run: haxe compile.hxml -D HXCPP_M${{ inputs.arch }} + run: haxe compile.hxml -D ${{ env.HXCPP_ARCH_FLAG }} - name: run run: bin${{ inputs.sep }}TestMain @@ -52,13 +55,13 @@ jobs: haxe: ${{ inputs.haxe }} - name: build project working-directory: test/cffi/project - run: haxelib run hxcpp build.xml -Ddebug -DHXCPP_M${{ inputs.arch }} + run: haxelib run hxcpp build.xml -Ddebug -D${{ env.HXCPP_ARCH_FLAG }} - name: build - run: haxe compile.hxml --debug -D HXCPP_M${{ inputs.arch }} + run: haxe compile.hxml --debug -D ${{ env.HXCPP_ARCH_FLAG }} - name: build (utf8) - run: haxe compile-utf8.hxml --debug -D HXCPP_M${{ inputs.arch }} + run: haxe compile-utf8.hxml --debug -D ${{ env.HXCPP_ARCH_FLAG }} - name: build (neko) - run: haxe compile-neko.hxml --debug -D HXCPP_M${{ inputs.arch }} + 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 @@ -91,7 +94,7 @@ jobs: with: haxe: ${{ inputs.haxe }} - name: build - run: haxe compile.hxml ${{ matrix.suffix }} -D HXCPP_M${{ inputs.arch }} + run: haxe compile.hxml ${{ matrix.suffix }} -D ${{ env.HXCPP_ARCH_FLAG }} - name: run run: bin${{ inputs.sep }}TestMain${{ matrix.suffix }} @@ -109,10 +112,10 @@ jobs: with: haxe: ${{ inputs.haxe }} - name: build - run: haxe compile.hxml -D HXCPP_M${{ inputs.arch }} + run: haxe compile.hxml -D ${{ env.HXCPP_ARCH_FLAG }} - name: run run: bin${{ inputs.sep }}App-debug - + native: runs-on: ${{ inputs.os }} name: native @@ -127,7 +130,7 @@ jobs: with: haxe: ${{ inputs.haxe }} - name: build - run: haxe compile.hxml -D HXCPP_M${{ inputs.arch }} + run: haxe compile.hxml -D ${{ env.HXCPP_ARCH_FLAG }} - name: run run: bin${{ inputs.sep }}Native @@ -167,7 +170,7 @@ jobs: - name: build run: haxe compile${{ inputs.arch }}.hxml - name: run - run: cpp${{ inputs.arch }}${{ inputs.sep }}Test + run: ${{ inputs.arch == 'Arm64' && 'arm64' || format('cpp{0}', inputs.arch) }}${{ inputs.sep }}Test cppia: strategy: @@ -190,9 +193,9 @@ jobs: with: haxe: ${{ inputs.haxe }} - name: build host - run: haxe compile-host.hxml -D HXCPP_M${{ inputs.arch }} + run: haxe compile-host.hxml -D ${{ env.HXCPP_ARCH_FLAG }} - name: build client - run: haxe compile-client.hxml -D HXCPP_M${{ inputs.arch }} + run: haxe compile-client.hxml -D ${{ env.HXCPP_ARCH_FLAG }} - name: run run: bin${{ inputs.sep }}CppiaHost bin${{ inputs.sep }}client.cppia ${{ matrix.suffix }} @@ -225,6 +228,6 @@ jobs: - name: install haxe libs run: haxelib install compile-cpp.hxml --always - name: build - run: haxe compile-cpp.hxml -D HXCPP_M${{ inputs.arch }} -D no_http + run: haxe compile-cpp.hxml -D ${{ env.HXCPP_ARCH_FLAG }} -D no_http - name: run - run: bin${{ inputs.sep }}cpp${{ inputs.sep }}TestMain-debug \ No newline at end of file + run: bin${{ inputs.sep }}cpp${{ inputs.sep }}TestMain-debug diff --git a/test/std/compileArm64.hxml b/test/std/compileArm64.hxml new file mode 100644 index 000000000..766081575 --- /dev/null +++ b/test/std/compileArm64.hxml @@ -0,0 +1,5 @@ +-m Test +-D HXCPP_ARM64 +-L hx4compat +-L utest +--cpp arm64