Skip to content

Commit 20baf1c

Browse files
tomassrnkaclaude
andcommitted
ci: add ARM64 cross-compilation and unit tests
Add a new PR workflow that: - Cross-compiles all packages for arm64 on x86_64 runners (catches build issues without needing ARM64 hardware) - Runs unit tests on ubuntu-24.04-arm runners for packages that don't require KVM (api, client-proxy, db, docker-reverse-proxy, shared) Orchestrator and envd are excluded from ARM64 unit tests since they require KVM, hugepages, NBD, and other kernel features only available on self-hosted runners. Co-Authored-By: Claude Opus 4.6 <noreply@anthropic.com>
1 parent b0de99c commit 20baf1c

2 files changed

Lines changed: 72 additions & 0 deletions

File tree

Lines changed: 70 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,70 @@
1+
name: ARM64 tests on PRs
2+
3+
on: [workflow_call]
4+
5+
permissions:
6+
contents: read
7+
8+
jobs:
9+
cross-compile:
10+
name: Cross-compile all packages for ARM64
11+
runs-on: ubuntu-24.04
12+
steps:
13+
- name: Checkout repository
14+
uses: actions/checkout@v4
15+
16+
- name: Setup Go
17+
uses: ./.github/actions/go-setup-cache
18+
19+
- name: Install ARM64 cross-compiler
20+
run: sudo apt-get update && sudo apt-get install -y gcc-aarch64-linux-gnu
21+
22+
- name: Build and vet packages (pure Go)
23+
run: |
24+
for pkg in api client-proxy envd shared db docker-reverse-proxy; do
25+
echo "::group::packages/$pkg"
26+
pushd "packages/$pkg" > /dev/null
27+
GOARCH=arm64 go build ./...
28+
GOARCH=arm64 go vet ./...
29+
popd > /dev/null
30+
echo "::endgroup::"
31+
done
32+
33+
- name: Build and vet orchestrator (CGO)
34+
run: |
35+
CGO_ENABLED=1 CC=aarch64-linux-gnu-gcc GOARCH=arm64 go build ./...
36+
CGO_ENABLED=1 CC=aarch64-linux-gnu-gcc GOARCH=arm64 go vet ./...
37+
working-directory: packages/orchestrator
38+
39+
arm64-unit-tests:
40+
name: ARM64 tests for ${{ matrix.package }}
41+
runs-on: ubuntu-24.04-arm
42+
strategy:
43+
matrix:
44+
include:
45+
- package: packages/api
46+
test_path: ./...
47+
- package: packages/client-proxy
48+
test_path: ./...
49+
- package: packages/db
50+
test_path: ./...
51+
- package: packages/docker-reverse-proxy
52+
test_path: ./...
53+
- package: packages/shared
54+
test_path: ./pkg/...
55+
fail-fast: false
56+
steps:
57+
- name: Checkout repository
58+
uses: actions/checkout@v4
59+
60+
- name: Setup Go
61+
uses: ./.github/actions/go-setup-cache
62+
with:
63+
cache-dependency-paths: |
64+
go.work
65+
${{ matrix.package }}/go.mod
66+
${{ matrix.package }}/go.sum
67+
68+
- name: Run tests
69+
working-directory: ${{ matrix.package }}
70+
run: go test -v ${{ matrix.test_path }}

.github/workflows/pull-request.yml

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -25,6 +25,8 @@ jobs:
2525
uses: ./.github/workflows/out-of-order-migrations.yml
2626
unit-tests:
2727
uses: ./.github/workflows/pr-tests.yml
28+
arm64-tests:
29+
uses: ./.github/workflows/pr-tests-arm64.yml
2830
integration-tests:
2931
needs: [out-of-order-migrations]
3032
uses: ./.github/workflows/integration_tests.yml

0 commit comments

Comments
 (0)