From 54063e1b71ef8f85b630e4dd67f578b4eb2036b8 Mon Sep 17 00:00:00 2001 From: Tobiasz Laskowski Date: Sat, 14 Mar 2026 11:47:29 +0000 Subject: [PATCH 1/6] [ci] Add android build tests --- .github/workflows/main.yml | 32 +++++++++++++++++++++++++ .github/workflows/test.yml | 48 ++++++++++++++++++++++++++------------ 2 files changed, 65 insertions(+), 15 deletions(-) diff --git a/.github/workflows/main.yml b/.github/workflows/main.yml index 95706e2ff..eae26d3a0 100644 --- a/.github/workflows/main.yml +++ b/.github/workflows/main.yml @@ -102,3 +102,35 @@ jobs: sep: / ext: .dso os: ubuntu-latest + + AndroidX86_64: + strategy: + fail-fast: false + matrix: + haxe: [ 4.3.7, latest ] + uses: ./.github/workflows/test.yml + name: Test Android (x86_64) + with: + haxe: ${{ matrix.haxe }} + arch: 64 + sep: / + ext: .dso + os: ubuntu-latest + target_flag: android + execute: false + + AndroidArm64: + strategy: + fail-fast: false + matrix: + haxe: [ 4.3.7, latest ] + uses: ./.github/workflows/test.yml + name: Test Android (Arm64) + with: + haxe: ${{ matrix.haxe }} + arch: Arm64 + sep: / + ext: .dso + os: ubuntu-latest + target_flag: android + execute: false diff --git a/.github/workflows/test.yml b/.github/workflows/test.yml index 315c0842a..d7df222c1 100644 --- a/.github/workflows/test.yml +++ b/.github/workflows/test.yml @@ -17,9 +17,17 @@ on: os: required: true type: string + target_flag: + type: string + default: '' + execute: + type: boolean + default: true env: HXCPP_ARCH_FLAG: ${{ inputs.arch == 'Arm64' && 'HXCPP_ARM64' || format('HXCPP_M{0}', inputs.arch) }} + HAXE_TARGET_FLAG: ${{ inputs.target_flag && format('-D {0}', inputs.target_flag) || '' }} + HXCPP_TARGET_FLAG: ${{ inputs.target_flag && format('-D{0}', inputs.target_flag) || '' }} jobs: haxe: @@ -36,8 +44,9 @@ jobs: with: haxe: ${{ inputs.haxe }} - name: build - run: haxe compile.hxml -D ${{ env.HXCPP_ARCH_FLAG }} + run: haxe compile.hxml -D ${{ env.HXCPP_ARCH_FLAG }} ${{ env.HAXE_TARGET_FLAG }} - name: run + if: inputs.execute run: bin${{ inputs.sep }}TestMain cffi: @@ -55,21 +64,24 @@ jobs: haxe: ${{ inputs.haxe }} - name: build project working-directory: test/cffi/project - run: haxelib run hxcpp build.xml -Ddebug -D${{ env.HXCPP_ARCH_FLAG }} + run: haxelib run hxcpp build.xml -Ddebug -D${{ env.HXCPP_ARCH_FLAG }} ${{ env.HXCPP_TARGET_FLAG }} - name: build - run: haxe compile.hxml --debug -D ${{ env.HXCPP_ARCH_FLAG }} + run: haxe compile.hxml --debug -D ${{ env.HXCPP_ARCH_FLAG }} ${{ env.HAXE_TARGET_FLAG }} - name: build (utf8) - run: haxe compile-utf8.hxml --debug -D ${{ env.HXCPP_ARCH_FLAG }} + run: haxe compile-utf8.hxml --debug -D ${{ env.HXCPP_ARCH_FLAG }} ${{ env.HAXE_TARGET_FLAG }} - name: build (neko) - run: haxe compile-neko.hxml --debug -D ${{ env.HXCPP_ARCH_FLAG }} + run: haxe compile-neko.hxml --debug -D ${{ env.HXCPP_ARCH_FLAG }} ${{ env.HAXE_TARGET_FLAG }} - name: copy + if: inputs.execute run: cp project/ndll/*/prime${{ inputs.ext }} bin/neko/prime.ndll - name: run + if: inputs.execute run: bin${{ inputs.sep }}cpp${{ inputs.sep }}TestMain-debug - name: run (utf8) + if: inputs.execute run: bin${{ inputs.sep }}cpp-utf8${{ inputs.sep }}TestMain-debug - name: run (neko) - if: inputs.arch == '64' + if: inputs.execute && inputs.arch == '64' working-directory: test/cffi/bin/neko run: neko TestMain.n @@ -94,8 +106,9 @@ jobs: with: haxe: ${{ inputs.haxe }} - name: build - run: haxe compile.hxml ${{ matrix.suffix }} -D ${{ env.HXCPP_ARCH_FLAG }} + run: haxe compile.hxml ${{ matrix.suffix }} -D ${{ env.HXCPP_ARCH_FLAG }} ${{ env.HAXE_TARGET_FLAG }} - name: run + if: inputs.execute run: bin${{ inputs.sep }}TestMain${{ matrix.suffix }} debugger: @@ -112,8 +125,9 @@ jobs: with: haxe: ${{ inputs.haxe }} - name: build - run: haxe compile.hxml -D ${{ env.HXCPP_ARCH_FLAG }} + run: haxe compile.hxml -D ${{ env.HXCPP_ARCH_FLAG }} ${{ env.HAXE_TARGET_FLAG }} - name: run + if: inputs.execute run: bin${{ inputs.sep }}App-debug native: @@ -130,8 +144,9 @@ jobs: with: haxe: ${{ inputs.haxe }} - name: build - run: haxe compile.hxml -D ${{ env.HXCPP_ARCH_FLAG }} + run: haxe compile.hxml -D ${{ env.HXCPP_ARCH_FLAG }} ${{ env.HAXE_TARGET_FLAG }} - name: run + if: inputs.execute run: bin${{ inputs.sep }}Native std: @@ -148,7 +163,7 @@ jobs: with: haxe: ${{ inputs.haxe }} - name: setup mariadb - if: runner.os == 'Linux' + if: runner.os == 'Linux' && inputs.execute run: | set -ex sudo apt-get update -qqy @@ -156,8 +171,9 @@ jobs: 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 + run: haxe compile${{ inputs.arch }}.hxml ${{ env.HAXE_TARGET_FLAG }} - name: run + if: inputs.execute run: ${{ inputs.arch == 'Arm64' && 'arm64' || format('cpp{0}', inputs.arch) }}${{ inputs.sep }}Test cppia: @@ -181,10 +197,11 @@ jobs: with: haxe: ${{ inputs.haxe }} - name: build host - run: haxe compile-host.hxml -D ${{ env.HXCPP_ARCH_FLAG }} + run: haxe compile-host.hxml -D ${{ env.HXCPP_ARCH_FLAG }} ${{ env.HAXE_TARGET_FLAG }} - name: build client - run: haxe compile-client.hxml -D ${{ env.HXCPP_ARCH_FLAG }} + run: haxe compile-client.hxml -D ${{ env.HXCPP_ARCH_FLAG }} ${{ env.HAXE_TARGET_FLAG }} - name: run + if: inputs.execute run: bin${{ inputs.sep }}CppiaHost bin${{ inputs.sep }}client.cppia ${{ matrix.suffix }} suite: @@ -218,8 +235,9 @@ 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 + run: haxe compile-cpp.hxml -D ${{ env.HXCPP_ARCH_FLAG }} -D no_http ${{ env.HAXE_TARGET_FLAG }} - name: run + if: inputs.execute run: bin${{ inputs.sep }}cpp${{ inputs.sep }}TestMain-debug build_tool: runs-on: ${{ inputs.os }} @@ -236,6 +254,6 @@ jobs: shell: bash run: | for xml in *.xml; do - haxelib run hxcpp $xml + haxelib run hxcpp $xml ${{ env.HXCPP_TARGET_FLAG }} haxelib run hxcpp $xml clean done From 124a7724e47bfa28c672c5a3dde88186c611a81b Mon Sep 17 00:00:00 2001 From: Tobiasz Laskowski Date: Sat, 14 Mar 2026 23:25:42 +0000 Subject: [PATCH 2/6] [ci] Use HXCPP_X86_64 on android The android toolchain ignores HXCPP_M64 --- .github/workflows/test.yml | 5 ++++- 1 file changed, 4 insertions(+), 1 deletion(-) diff --git a/.github/workflows/test.yml b/.github/workflows/test.yml index d7df222c1..cdd2db923 100644 --- a/.github/workflows/test.yml +++ b/.github/workflows/test.yml @@ -25,7 +25,10 @@ on: default: true env: - HXCPP_ARCH_FLAG: ${{ inputs.arch == 'Arm64' && 'HXCPP_ARM64' || format('HXCPP_M{0}', inputs.arch) }} + HXCPP_ARCH_FLAG: ${{ inputs.arch == 'Arm64' && 'HXCPP_ARM64' || + inputs.target_flag == 'android' && inputs.arch == 64 && 'HXCPP_X86_64'|| + format('HXCPP_M{0}', inputs.arch) + }} HAXE_TARGET_FLAG: ${{ inputs.target_flag && format('-D {0}', inputs.target_flag) || '' }} HXCPP_TARGET_FLAG: ${{ inputs.target_flag && format('-D{0}', inputs.target_flag) || '' }} From 92c852030562f850c6a38b4acf14b07655e22f1c Mon Sep 17 00:00:00 2001 From: Tobiasz Laskowski Date: Sat, 14 Mar 2026 23:26:39 +0000 Subject: [PATCH 3/6] [ci] Add missing arch flag for build tool tests --- .github/workflows/test.yml | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/.github/workflows/test.yml b/.github/workflows/test.yml index cdd2db923..bd50d5aec 100644 --- a/.github/workflows/test.yml +++ b/.github/workflows/test.yml @@ -257,6 +257,6 @@ jobs: shell: bash run: | for xml in *.xml; do - haxelib run hxcpp $xml ${{ env.HXCPP_TARGET_FLAG }} + haxelib run hxcpp $xml -D${{ env.HXCPP_ARCH_FLAG }} ${{ env.HXCPP_TARGET_FLAG }} haxelib run hxcpp $xml clean done From d81b9f96d0e65d3973ca677e7802977e7bc8aa0f Mon Sep 17 00:00:00 2001 From: Tobiasz Laskowski Date: Sat, 14 Mar 2026 23:36:48 +0000 Subject: [PATCH 4/6] [ci] Fix passing arch flag to std tests --- .github/workflows/test.yml | 4 ++-- test/std/compile-generic.hxml | 4 ++++ test/std/compile32.hxml | 7 ++----- test/std/compile64.hxml | 6 ++---- test/std/compileArm64.hxml | 4 +--- 5 files changed, 11 insertions(+), 14 deletions(-) create mode 100644 test/std/compile-generic.hxml diff --git a/.github/workflows/test.yml b/.github/workflows/test.yml index bd50d5aec..a3629907d 100644 --- a/.github/workflows/test.yml +++ b/.github/workflows/test.yml @@ -174,10 +174,10 @@ jobs: 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 ${{ env.HAXE_TARGET_FLAG }} + run: haxe compile-generic.hxml --cpp bin -D ${{ env.HXCPP_ARCH_FLAG }} ${{ env.HAXE_TARGET_FLAG }} - name: run if: inputs.execute - run: ${{ inputs.arch == 'Arm64' && 'arm64' || format('cpp{0}', inputs.arch) }}${{ inputs.sep }}Test + run: bin${{ inputs.sep }}Test cppia: strategy: diff --git a/test/std/compile-generic.hxml b/test/std/compile-generic.hxml new file mode 100644 index 000000000..3f77fc482 --- /dev/null +++ b/test/std/compile-generic.hxml @@ -0,0 +1,4 @@ +-m Test +-D HXCPP_DEBUGGER +-L hx4compat +-L utest diff --git a/test/std/compile32.hxml b/test/std/compile32.hxml index 692ed7581..692e3e321 100644 --- a/test/std/compile32.hxml +++ b/test/std/compile32.hxml @@ -1,6 +1,3 @@ --m Test +compile-generic.hxml -D HXCPP_M32 --D HXCPP_DEBUGGER --L hx4compat --L utest ---cpp cpp32 \ No newline at end of file +--cpp cpp32 diff --git a/test/std/compile64.hxml b/test/std/compile64.hxml index 2793e6bd3..6c484aef2 100644 --- a/test/std/compile64.hxml +++ b/test/std/compile64.hxml @@ -1,5 +1,3 @@ --m Test +compile-generic.hxml -D HXCPP_M64 --L hx4compat --L utest ---cpp cpp64 \ No newline at end of file +--cpp cpp64 diff --git a/test/std/compileArm64.hxml b/test/std/compileArm64.hxml index 766081575..e0e3182c2 100644 --- a/test/std/compileArm64.hxml +++ b/test/std/compileArm64.hxml @@ -1,5 +1,3 @@ --m Test +compile-generic.hxml -D HXCPP_ARM64 --L hx4compat --L utest --cpp arm64 From 190af5bfd9fae75e86e3f3496425fd8b084dfd71 Mon Sep 17 00:00:00 2001 From: Tobiasz Laskowski Date: Sun, 15 Mar 2026 00:04:15 +0000 Subject: [PATCH 5/6] [tests] Use dll target for build tool tests This makes it possible to run them on android, which does not support exe targets. --- test/cxx_standard/Build.xml | 6 ++---- test/cxx_standard/Build_legacy.xml | 2 +- test/cxx_standard/Build_section.xml | 2 +- 3 files changed, 4 insertions(+), 6 deletions(-) diff --git a/test/cxx_standard/Build.xml b/test/cxx_standard/Build.xml index 0198e3145..f39ccedc3 100644 --- a/test/cxx_standard/Build.xml +++ b/test/cxx_standard/Build.xml @@ -7,9 +7,7 @@ - - - + - \ No newline at end of file + diff --git a/test/cxx_standard/Build_legacy.xml b/test/cxx_standard/Build_legacy.xml index e9c4efa99..67ea40ac3 100644 --- a/test/cxx_standard/Build_legacy.xml +++ b/test/cxx_standard/Build_legacy.xml @@ -6,7 +6,7 @@ - + diff --git a/test/cxx_standard/Build_section.xml b/test/cxx_standard/Build_section.xml index af4ab0cdb..3fa02aa74 100644 --- a/test/cxx_standard/Build_section.xml +++ b/test/cxx_standard/Build_section.xml @@ -6,7 +6,7 @@ - + From d284df5b32488f8472e03fa734b3765c047119ca Mon Sep 17 00:00:00 2001 From: Tobiasz Laskowski Date: Sun, 15 Mar 2026 00:40:00 +0000 Subject: [PATCH 6/6] [tests] Move build tool test output to bin subdir --- .gitignore | 5 ----- test/cxx_standard/Build.xml | 1 + test/cxx_standard/Build_legacy.xml | 1 + test/cxx_standard/Build_section.xml | 1 + 4 files changed, 3 insertions(+), 5 deletions(-) diff --git a/.gitignore b/.gitignore index ae80f7d57..4ff620b27 100644 --- a/.gitignore +++ b/.gitignore @@ -29,11 +29,6 @@ hxcpp.n .vscode -test/cxx_standard/main -test/cxx_standard/main.hash -test/cxx_standard/main.exe -test/cxx_standard/main.exe.hash - # Created by https://www.toptal.com/developers/gitignore/api/visualstudio # Edit at https://www.toptal.com/developers/gitignore?templates=visualstudio diff --git a/test/cxx_standard/Build.xml b/test/cxx_standard/Build.xml index f39ccedc3..8b0663323 100644 --- a/test/cxx_standard/Build.xml +++ b/test/cxx_standard/Build.xml @@ -8,6 +8,7 @@ + diff --git a/test/cxx_standard/Build_legacy.xml b/test/cxx_standard/Build_legacy.xml index 67ea40ac3..8a901be2f 100644 --- a/test/cxx_standard/Build_legacy.xml +++ b/test/cxx_standard/Build_legacy.xml @@ -7,6 +7,7 @@ + diff --git a/test/cxx_standard/Build_section.xml b/test/cxx_standard/Build_section.xml index 3fa02aa74..1afc5236e 100644 --- a/test/cxx_standard/Build_section.xml +++ b/test/cxx_standard/Build_section.xml @@ -7,6 +7,7 @@ +