CI: unify arm64 && amd64 integration test #270
Workflow file for this run
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
name: 'per arm64 kernel integration test' | |
on: | |
schedule: | |
# Run job once a week on saturday at 8:15 AM. | |
- cron: '15 8 * * 6' | |
push: | |
branches: [ main ] | |
pull_request: | |
branches: [ '**' ] | |
# Set default permissions as read only. | |
permissions: read-all | |
jobs: | |
arm64_integration_test: | |
runs-on: ubuntu-latest | |
strategy: | |
matrix: | |
kernel-version: ["4.19.227", "5.4.176"] | |
steps: | |
- name: install qemu && curl | |
# Make sure required software packages are available. | |
run: | | |
sudo apt --yes update | |
sudo apt --yes install qemu-system-aarch64 curl | |
- name: checkout | |
uses: actions/checkout@v4 | |
- name: set up Go | |
uses: actions/setup-go@v5 | |
with: | |
go-version: 1.23 | |
id: go | |
- name: cross-compile tests | |
# bluebox works best with statically linked binaries. So we compile all the tests in this | |
# code base into a statically linked executable. | |
run: | | |
GOARCH=arm64 go test -ldflags='-extldflags=-static' -trimpath -tags 'osusergo netgo static_build linux integration' -c | |
- name: build initramfs | |
# Install bluebox and generate a initramfs.cpio with the previously created statically linked | |
# tests embedded. | |
run: | | |
go install github.com/florianl/bluebox@latest | |
bluebox -a="arm64" -e go-tc.test | |
- name: get kernel | |
# Fetch the public kernel image that will be used in this test run. | |
run: | | |
curl -s -L -O --fail https://github.com/florianl/arm64-ci-kernels/raw/main/linux-${{ matrix.kernel-version }}.arm64 | |
- name: run tests on kernel | |
# Run the tests. | |
run: | | |
qemu-system-aarch64 -nographic -append "console=ttyAMA0" -M virt -cpu cortex-a57 -m 4G -kernel linux-${{ matrix.kernel-version }}.arm64 -initrd initramfs.cpio | tee log.txt | |
grep PASS log.txt | |