Skip to content

Commit

Permalink
Merge pull request #52 from adafruit/add-linux-aarch64
Browse files Browse the repository at this point in the history
adding linux aarch64 target
  • Loading branch information
andelf authored Jul 24, 2024
2 parents 266538a + 68a782a commit 2efb224
Showing 1 changed file with 27 additions and 7 deletions.
34 changes: 27 additions & 7 deletions .github/workflows/rust.yml
Original file line number Diff line number Diff line change
Expand Up @@ -40,6 +40,8 @@ jobs:
arch: win-x64
- os: ubuntu-latest
arch: linux-x64
- os: ubuntu-latest
arch: linux-aarch64
- os: macos-latest
arch: macos-arm64
- os: macos-12
Expand All @@ -48,23 +50,41 @@ jobs:

steps:
- uses: actions/checkout@v4
- name: Configure target
run: |
if [[ "${{ matrix.config.arch }}" == "linux-aarch64" ]]; then
rustup target add aarch64-unknown-linux-gnu
sudo apt-get install gcc-aarch64-linux-gnu
echo TARGET="--target aarch64-unknown-linux-gnu" >> $GITHUB_ENV
echo RUSTFLAGS="-C linker=aarch64-linux-gnu-gcc" >> $GITHUB_ENV
else
echo TARGET="" >> $GITHUB_ENV
fi
shell: bash

- name: Build
run: cargo build --release
run: cargo build --release ${{ env.TARGET }}

- name: Run tests
run: cargo test
if: matrix.config.arch != 'linux-aarch64'
run: cargo test --release ${{ env.TARGET }}

- name: Run help
run: cargo run -- --help
if: matrix.config.arch != 'linux-aarch64'
run: cargo run --release ${{ env.TARGET }} -- --help

- name: Prepare artifacts
run: |
if [[ "${{ runner.os }}" == "Windows" ]]; then
WCHISP_EXE="wchisp.exe"
if [[ "${{ matrix.config.arch }}" == "win-x64" ]]; then
WCHISP_EXE="target/release/wchisp.exe"
elif [[ "${{ matrix.config.arch }}" == "linux-aarch64" ]]; then
WCHISP_EXE="target/aarch64-unknown-linux-gnu/release/wchisp"
else
WCHISP_EXE="wchisp"
WCHISP_EXE="target/release/wchisp"
fi
mkdir wchisp-${{ matrix.config.arch }}
cp target/release/$WCHISP_EXE wchisp-${{ matrix.config.arch }}
cp $WCHISP_EXE wchisp-${{ matrix.config.arch }}
cp README.md wchisp-${{ matrix.config.arch }}
shell: bash
- uses: actions/upload-artifact@v4
Expand Down

0 comments on commit 2efb224

Please sign in to comment.