Skip to content

Commit 1517508

Browse files
16bit-ykikoclaude
andcommitted
feat(ci): use native runners for cross-platform testing via artifact transfer
Cross-compile on pixi-supported platforms, upload binaries, then run tests on native runners (macos-15-intel, ubuntu-24.04-arm) instead of QEMU/Rosetta. Add test-run pixi environment for lightweight test-only platform support. Co-Authored-By: Claude Opus 4.6 <noreply@anthropic.com>
1 parent c8b0ec5 commit 1517508

File tree

3 files changed

+1150
-14
lines changed

3 files changed

+1150
-14
lines changed

.github/workflows/test-cmake.yml

Lines changed: 57 additions & 10 deletions
Original file line numberDiff line numberDiff line change
@@ -29,13 +29,16 @@ jobs:
2929
build_type: Debug
3030
- os: macos-15
3131
build_type: RelWithDebInfo
32-
# ── Additional platform builds ─────────────────────────────────
32+
# ── Cross-compile (build only, tests run on native runners) ────
3333
- os: macos-15
3434
build_type: RelWithDebInfo
3535
target_triple: x86_64-apple-darwin
36+
build_only: true
3637
- os: ubuntu-24.04
3738
build_type: RelWithDebInfo
3839
target_triple: aarch64-linux-gnu
40+
build_only: true
41+
# ── Native ARM64 build + test ─────────────────────────────────
3942
- os: windows-11-arm
4043
build_type: RelWithDebInfo
4144
target_triple: aarch64-pc-windows-msvc
@@ -64,13 +67,6 @@ jobs:
6467
fi
6568
shell: bash
6669

67-
- name: Setup QEMU for aarch64 tests
68-
if: matrix.target_triple == 'aarch64-linux-gnu'
69-
run: |
70-
sudo apt-get update
71-
sudo apt-get install -y qemu-user-static libc6-arm64-cross libstdc++6-arm64-cross
72-
echo "QEMU_LD_PREFIX=/usr/aarch64-linux-gnu" >> "$GITHUB_ENV"
73-
7470
- name: Build (native)
7571
if: ${{ !matrix.target_triple }}
7672
run: pixi run build ${{ matrix.build_type }} ON
@@ -79,17 +75,28 @@ jobs:
7975
if: ${{ matrix.target_triple }}
8076
shell: bash
8177
run: |
82-
pixi run cmake-config ${{ matrix.build_type }} OFF "-DCLICE_ENABLE_TEST=ON -DCLICE_TARGET_TRIPLE=${{ matrix.target_triple }}"
78+
pixi run cmake-config ${{ matrix.build_type }} OFF "-DCLICE_TARGET_TRIPLE=${{ matrix.target_triple }}"
8379
pixi run cmake-build ${{ matrix.build_type }}
8480
81+
- name: Upload cross-compiled binaries
82+
if: ${{ matrix.build_only }}
83+
uses: actions/upload-artifact@v4
84+
with:
85+
name: cross-build-${{ matrix.target_triple }}
86+
path: build/${{ matrix.build_type }}/bin/
87+
if-no-files-found: error
88+
retention-days: 1
89+
8590
- name: Unit Test
91+
if: ${{ !matrix.build_only }}
8692
run: pixi run unit-test ${{ matrix.build_type }}
8793

8894
- name: Integration Test
95+
if: ${{ !matrix.build_only }}
8996
run: pixi run integration-test ${{ matrix.build_type }}
9097

9198
- name: Smoke Test
92-
if: success() || failure()
99+
if: ${{ !matrix.build_only && (success() || failure()) }}
93100
run: pixi run smoke-test ${{ matrix.build_type }}
94101

95102
- name: Print cache stats and stop server
@@ -102,3 +109,43 @@ jobs:
102109
pixi run -- ccache --show-stats
103110
fi
104111
shell: bash
112+
113+
test-cross:
114+
needs: build
115+
strategy:
116+
fail-fast: false
117+
matrix:
118+
include:
119+
- os: macos-15-intel
120+
build_type: RelWithDebInfo
121+
target_triple: x86_64-apple-darwin
122+
- os: ubuntu-24.04-arm
123+
build_type: RelWithDebInfo
124+
target_triple: aarch64-linux-gnu
125+
runs-on: ${{ matrix.os }}
126+
steps:
127+
- name: Checkout repository
128+
uses: actions/checkout@v4
129+
130+
- uses: ./.github/actions/setup-pixi
131+
with:
132+
environments: test-run
133+
134+
- name: Download cross-compiled binaries
135+
uses: actions/download-artifact@v4
136+
with:
137+
name: cross-build-${{ matrix.target_triple }}
138+
path: build/${{ matrix.build_type }}/bin/
139+
140+
- name: Make binaries executable
141+
run: chmod +x build/${{ matrix.build_type }}/bin/*
142+
143+
- name: Unit Test
144+
run: pixi run -e test-run unit-test ${{ matrix.build_type }}
145+
146+
- name: Integration Test
147+
run: pixi run -e test-run integration-test ${{ matrix.build_type }}
148+
149+
- name: Smoke Test
150+
if: success() || failure()
151+
run: pixi run -e test-run smoke-test ${{ matrix.build_type }}

0 commit comments

Comments
 (0)