From 12d8e2e83cf2df8a137597e92acaa6e1e6aaf022 Mon Sep 17 00:00:00 2001 From: Florian Guggi Date: Sun, 31 Dec 2023 14:03:29 +0100 Subject: [PATCH] Add cross config file and build artifacts in CI --- .github/workflows/rust.yml | 20 ++++++++++++++++---- Cross.toml | 2 ++ 2 files changed, 18 insertions(+), 4 deletions(-) create mode 100644 Cross.toml diff --git a/.github/workflows/rust.yml b/.github/workflows/rust.yml index 1fa55ae..488c328 100644 --- a/.github/workflows/rust.yml +++ b/.github/workflows/rust.yml @@ -1,4 +1,4 @@ -name: Software Tests +name: Build & Test on: push: @@ -10,10 +10,8 @@ env: CARGO_TERM_COLOR: always jobs: - build: - + test: runs-on: ubuntu-latest - steps: - uses: actions/checkout@v3 - name: Install @@ -22,3 +20,17 @@ jobs: run: cargo build --release - name: Run tests run: cargo test --release --features mock + + cross-compile: + runs-on: ubuntu-latest + steps: + - uses: actions/checkout@v3 + - name: Prepare + run: cargo install cross --git https://github.com/cross-rs/cross + - name: Build + run: cross build --release --target aarch64-unknown-linux-gnu + - name: Upload artifact + uses: actions/upload-artifact@v3 + with: + name: aarch64 binary + path: target/aarch64-unknown-linux-gnu/release/STS1_EDU_Scheduler diff --git a/Cross.toml b/Cross.toml new file mode 100644 index 0000000..b9d26a9 --- /dev/null +++ b/Cross.toml @@ -0,0 +1,2 @@ +[target.aarch64-unknown-linux-gnu] +pre-build = ["dpkg --add-architecture arm64 && apt-get update && apt-get install --assume-yes libudev-dev:arm64"]