Initial API structure #6
Workflow file for this run
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| name: Rust CI with QEMU Emulation | ||
| on: | ||
| push: | ||
| branches: ["main"] | ||
| pull_request: | ||
| branches: ["main"] | ||
| env: | ||
| CARGO_TERM_COLOR: always | ||
| RUST_BACKTRACE: 1 | ||
| jobs: | ||
| test: | ||
| name: Test on ${{ matrix.os }} / ${{ matrix.rust }} | ||
| runs-on: ${{ matrix.os }} | ||
| strategy: | ||
| fail-fast: false | ||
| matrix: | ||
| os: [ubuntu-latest] | ||
| rust: [stable] | ||
| target: [aarch64-unknown-linux-gnu] | ||
| include: | ||
| - os: ubuntu-latest | ||
| rust: stable | ||
| target: aarch64-unknown-linux-gnu | ||
| steps: | ||
| - uses: actions/checkout@v3 | ||
| - name: Install Rust toolchain | ||
| uses: dtolnay/rust-toolchain@stable | ||
| with: | ||
| toolchain: ${{ matrix.rust }} | ||
| target: ${{ matrix.target }} | ||
| components: rustfmt, clippy | ||
| - name: Install cross-compilation tools (Linux ARM64) | ||
| if: matrix.target == 'aarch64-unknown-linux-gnu' | ||
| run: | | ||
| sudo apt-get update | ||
| sudo apt-get install -y gcc-aarch64-linux-gnu g++-aarch64-linux-gnu libc6-dev-arm64-cross | ||
| echo "CARGO_TARGET_AARCH64_UNKNOWN_LINUX_GNU_LINKER=aarch64-linux-gnu-gcc" >> $GITHUB_ENV | ||
| echo "CC_aarch64_unknown_linux_gnu=aarch64-linux-gnu-gcc" >> $GITHUB_ENV | ||
| echo "CXX_aarch64_unknown_linux_gnu=aarch64-linux-gnu-g++" >> $GITHUB_ENV | ||
| - name: Set up cargo cache | ||
| uses: actions/cache@v3 | ||
| with: | ||
| path: | | ||
| ~/.cargo/bin/ | ||
| ~/.cargo/registry/index/ | ||
| ~/.cargo/registry/cache/ | ||
| ~/.cargo/git/db/ | ||
| target/ | ||
| key: ${{ runner.os }}-${{ matrix.target }}-cargo-${{ hashFiles('**/Cargo.lock') }} | ||
| restore-keys: ${{ runner.os }}-${{ matrix.target }}-cargo- | ||
| - name: Set up QEMU | ||
| uses: docker/setup-qemu-action@v2 | ||
| with: | ||
| platforms: aarch64 | ||
| - name: Check formatting | ||
| run: cargo fmt --all -- --check | ||
| - name: Run clippy | ||
| run: cargo clippy --target ${{ matrix.target }} -- -D warnings | ||
| - name: Run tests under QEMU emulation | ||
| run: cargo test --target ${{ matrix.target }} --verbose | ||
| - name: Build | ||
| run: cargo build --target ${{ matrix.target }} --verbose | ||
| - name: Check documentation | ||
| run: cargo doc --no-deps --document-private-items | ||