ci: Run tests on native platform and fix artifact path

Co-authored-by: aider (gemini/gemini-2.5-pro-preview-05-06) <aider@aider.chat>
This commit is contained in:
Chaos Rogers 2025-07-10 14:13:02 +01:00
parent f6b4de3d4c
commit 8d834b22fd

View file

@ -41,7 +41,7 @@ jobs:
sudo sed -i 's/^deb /deb [arch=amd64] /' /etc/apt/sources.list sudo sed -i 's/^deb /deb [arch=amd64] /' /etc/apt/sources.list
sudo apt-get update -y sudo apt-get update -y
# Install build tools and cross-compilation libraries for Raspberry Pi 5 # Install build tools and cross-compilation libraries for Raspberry Pi 5
sudo apt-get install -y gcc-aarch64-linux-gnu libudev-dev:arm64 pkg-config cmake sudo apt-get install -y gcc-aarch64-linux-gnu libudev-dev:arm64 pkg-config cmake libudev-dev
# Ensure pkg-config can find ARM64 libraries # Ensure pkg-config can find ARM64 libraries
sudo apt-get install -y libpkgconf3:arm64 sudo apt-get install -y libpkgconf3:arm64
- name: Install Rust dependencies - name: Install Rust dependencies
@ -60,23 +60,11 @@ jobs:
PKG_CONFIG_ALLOW_SYSTEM_CFLAGS: 1 PKG_CONFIG_ALLOW_SYSTEM_CFLAGS: 1
# Add library path for the cross-compiler's linker # Add library path for the cross-compiler's linker
RUSTFLAGS: -L/usr/lib/aarch64-linux-gnu RUSTFLAGS: -L/usr/lib/aarch64-linux-gnu
- name: tests - name: Run tests on native platform
run: cargo test --release --target ${{ env.RUST_TARGET }} --bin ntp_timeturner run: cargo test --release --bin ntp_timeturner
env:
# Set linker for the target
CARGO_TARGET_AARCH64_UNKNOWN_LINUX_GNU_LINKER: aarch64-linux-gnu-gcc
# Configure pkg-config for cross-compilation
PKG_CONFIG_ALLOW_CROSS: 1
PKG_CONFIG_PATH: /usr/lib/aarch64-linux-gnu/pkgconfig
PKG_CONFIG_LIBDIR: /usr/lib/aarch64-linux-gnu/pkgconfig
PKG_CONFIG_SYSROOT_DIR: /
PKG_CONFIG_ALLOW_SYSTEM_LIBS: 1
PKG_CONFIG_ALLOW_SYSTEM_CFLAGS: 1
# Add library path for the cross-compiler's linker
RUSTFLAGS: -L/usr/lib/aarch64-linux-gnu
- name: Upload artifact - name: Upload artifact
uses: actions/upload-artifact@v4 uses: actions/upload-artifact@v4
with: with:
name: timeturner-aarch64 name: timeturner-aarch64
path: target/${{ env.RUST_TARGET }}/release/timeturner path: target/${{ env.RUST_TARGET }}/release/ntp_timeturner