Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

adding linux aarch64 target #52

Merged
merged 1 commit into from
Jul 24, 2024
Merged
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
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