Skip to content

Refactor, lint, optimize #7

Refactor, lint, optimize

Refactor, lint, optimize #7

Workflow file for this run

name: Build - Pull Request
on: [pull_request]
jobs:
build:
timeout-minutes: 20
permissions:
contents: read
strategy:
fail-fast: true
matrix:
include:
- os: ubuntu-20.04
targets: ["x86_64-unknown-linux-gnu", "aarch64-unknown-linux-gnu"]
dependencies: |
sudo apt-get update && sudo apt-get install -y gcc-aarch64-linux-gnu
- os: macos-latest
targets: ["x86_64-apple-darwin", "aarch64-apple-darwin"]
runs-on: ${{ matrix.os }}
steps:
- name: Check out code
uses: actions/[email protected]
- name: Rust setup
uses: dtolnay/rust-toolchain@1ff72ee08e3cb84d84adba594e0a297990fc1ed3
- name: Rust cache
uses: swatinem/rust-cache@f0deed1e0edfc6a9be95417288c0e1099b1eeec3
with:
shared-key: "build-${{ matrix.os }}"
- name: Install dependencies
if: matrix.dependencies != ''
run: ${{ matrix.dependencies }}
- name: Add targets
run: |
for target in ${{ join(matrix.targets, ' ') }}; do
rustup target add $target
done
- name: Build targets
run: |
for target in ${{ join(matrix.targets, ' ') }}; do
cargo build --release --target $target
done
- name: Clean up
run: rm -rf target