mirror of
https://github.com/NotAShelf/microfetch.git
synced 2025-12-08 05:53:51 +00:00
ci: set up cross comp for Rust builds
Signed-off-by: NotAShelf <raf@notashelf.dev> Change-Id: I154d2afb05088e22882985bcd4536f026a6a6964
This commit is contained in:
parent
16a1d5fe3f
commit
fa8b6b9d68
1 changed files with 38 additions and 5 deletions
43
.github/workflows/rust.yml
vendored
43
.github/workflows/rust.yml
vendored
|
|
@ -10,12 +10,45 @@ env:
|
||||||
CARGO_TERM_COLOR: always
|
CARGO_TERM_COLOR: always
|
||||||
|
|
||||||
jobs:
|
jobs:
|
||||||
build:
|
test:
|
||||||
|
name: Test on ${{ matrix.target }}
|
||||||
runs-on: ubuntu-latest
|
runs-on: ${{ matrix.os }}
|
||||||
|
strategy:
|
||||||
|
fail-fast: false
|
||||||
|
matrix:
|
||||||
|
include:
|
||||||
|
- os: ubuntu-latest
|
||||||
|
target: x86_64-unknown-linux-gnu
|
||||||
|
- os: ubuntu-latest
|
||||||
|
target: aarch64-unknown-linux-gnu
|
||||||
|
|
||||||
steps:
|
steps:
|
||||||
- name: "Checkout"
|
- name: "Checkout"
|
||||||
uses: actions/checkout@v4
|
uses: actions/checkout@v4
|
||||||
- name: "Build with Cargo"
|
|
||||||
run: cargo build --verbose
|
- name: "Setup Rust toolchain"
|
||||||
|
uses: actions-rust-lang/setup-rust-toolchain@v1
|
||||||
|
with:
|
||||||
|
target: ${{ matrix.target }}
|
||||||
|
|
||||||
|
- name: "Install cross-compilation tools"
|
||||||
|
if: matrix.target == 'aarch64-unknown-linux-gnu'
|
||||||
|
run: |
|
||||||
|
sudo apt-get update
|
||||||
|
sudo apt-get install -y gcc-aarch64-linux-gnu
|
||||||
|
|
||||||
|
- name: "Configure linker for aarch64"
|
||||||
|
if: matrix.target == 'aarch64-unknown-linux-gnu'
|
||||||
|
run: |
|
||||||
|
mkdir -p .cargo
|
||||||
|
cat >> .cargo/config.toml << EOF
|
||||||
|
[target.aarch64-unknown-linux-gnu]
|
||||||
|
linker = "aarch64-linux-gnu-gcc"
|
||||||
|
EOF
|
||||||
|
|
||||||
|
- name: "Build"
|
||||||
|
run: cargo build --verbose --target ${{ matrix.target }}
|
||||||
|
|
||||||
|
- name: "Run tests"
|
||||||
|
if: matrix.target == 'x86_64-unknown-linux-gnu'
|
||||||
|
run: cargo test --verbose --target ${{ matrix.target }}
|
||||||
|
|
|
||||||
Loading…
Add table
Add a link
Reference in a new issue