From 682a89d6b8836ba97553f40cce285582bd87bb37 Mon Sep 17 00:00:00 2001 From: Stefan Bossbaly Date: Tue, 14 Nov 2023 19:23:53 +0000 Subject: [PATCH] Added aarch64 workflow Given that the vast majority of our target devices use the aarch64 ISA, it would be beneficial to run a build and test using that architecture. Since Github runners use x64, we have to use qemu to emulate both the build and test environment. There is a signifact performance penalty when using qemu. It might be possible to do the build using the aarch64-unknown-linux-gnu toolchain on x64 and just run the unit tests in the qemu environment, but it would require the sysroot and rootfs to be binary compatible. --- .github/workflows/Build.yml | 34 +++++++++++++++++++++++++++++++++- 1 file changed, 33 insertions(+), 1 deletion(-) diff --git a/.github/workflows/Build.yml b/.github/workflows/Build.yml index 89e09b51c..018e13443 100644 --- a/.github/workflows/Build.yml +++ b/.github/workflows/Build.yml @@ -84,4 +84,36 @@ jobs: with: append: true path: current_coverage.md - continue-on-error: true \ No newline at end of file + continue-on-error: true + + build_and_test_aarch64: + name: Build and Test on aarch64 + runs-on: ubuntu-22.04 + steps: + - name: Checkout code + uses: actions/checkout@v4 + - name: Build and Test + uses: uraimo/run-on-arch-action@v2.5.1 + id: build_and_test + with: + arch: aarch64 + distro: ubuntu22.04 + githubToken: ${{ github.token }} + install: | + apt-get update -q -y + apt-get install -q -y --no-install-recommends \ + ca-certificates \ + curl \ + pkg-config \ + build-essential \ + libssl-dev + curl --proto '=https' -sSf https://sh.rustup.rs | sh -s -- -y --default-toolchain 1.69.0 --component "rustfmt, clippy" + run: | + source "$HOME/.cargo/env" + export CARGO_REGISTRIES_CRATES_IO_PROTOCOL=sparse + cargo --version --verbose + rustc --version + cargo clippy --version + cargo fmt -- --check + cargo clippy --tests --examples --all-targets --all-features -- -D warnings -A clippy::large_enum_variant + cargo test