Skip to content

Commit

Permalink
Add aarch64 and riscv64 cross compilation targets
Browse files Browse the repository at this point in the history
Signed-off-by: yubiuser <[email protected]>
  • Loading branch information
yubiuser committed Sep 10, 2024
1 parent b3af5b4 commit bc8d574
Showing 1 changed file with 18 additions and 3 deletions.
21 changes: 18 additions & 3 deletions .github/workflows/test.yml
Original file line number Diff line number Diff line change
Expand Up @@ -199,7 +199,7 @@ jobs:
- run: cargo check --no-default-features
- run: cargo check

test-cross-arm:
test-cross-linux:
name: cross +${{ matrix.toolchain }} build ${{ matrix.target }}
needs: clippy
runs-on: ${{ matrix.os }}
Expand All @@ -208,7 +208,10 @@ jobs:
fail-fast: false
matrix:
os: [ubuntu-latest]
target: [armv7-unknown-linux-gnueabihf]
target:
- armv7-unknown-linux-gnueabihf
- aarch64-unknown-linux-gnu
- riscv64gc-unknown-linux-gnu
toolchain:
- "1.74" # MSRV (Minimum supported rust version)
- stable
Expand Down Expand Up @@ -242,6 +245,12 @@ jobs:
if [ ${{ matrix.target }} = "armv7-unknown-linux-gnueabihf" ]; then
sudo apt-get install -y gcc-arm-linux-gnueabihf
fi
if [ ${{ matrix.target }} = "aarch64-unknown-linux-gnu" ]; then
sudo apt-get install -y gcc-aarch64-linux-gnu
fi
if [ ${{ matrix.target }} = "riscv64gc-unknown-linux-gnu" ]; then
sudo apt-get install -y gcc-riscv64-linux-gnu
fi
- name: Set target link compiler
run: |
Expand All @@ -252,7 +261,13 @@ jobs:
if [ ${{ matrix.target }} = "armv7-unknown-linux-gnueabihf" ]; then
echo "CARGO_TARGET_${target}_LINKER=arm-linux-gnueabihf-gcc" >> $GITHUB_ENV
fi
if [ ${{ matrix.target }} = "aarch64-unknown-linux-gnu" ]; then
echo "CARGO_TARGET_${target}_LINKER=aarch64-linux-gnu-gcc" >> $GITHUB_ENV
fi
if [ ${{ matrix.target }} = "riscv64gc-unknown-linux-gnu" ]; then
echo "CARGO_TARGET_${target}_LINKER=riscv64-linux-gnu-gcc" >> $GITHUB_ENV
fi
- name: Build
run: cargo build --verbose --target ${{ matrix.target }} --no-default-features

Expand Down

0 comments on commit bc8d574

Please sign in to comment.