name: check
permissions:
contents: read
checks: write
on:
push:
branches: [master]
pull_request:
concurrency:
group: ${{ github.workflow }}-${{ github.head_ref || github.run_id }}
cancel-in-progress: true
env:
CARGO_TERM_COLOR: always
ACC_RSS_LIBS: "/home/runner/work/a121-sys/a121-sys/staticlibs"
jobs:
fmt:
runs-on: ubuntu-latest
name: stable / fmt
steps:
- uses: actions/checkout@v7
with:
submodules: true
- name: Install stable
uses: dtolnay/rust-toolchain@stable
with:
components: rustfmt
- name: cargo fmt --check
run: cargo fmt --check
clippy:
runs-on: ubuntu-latest
name: ${{ matrix.toolchain }} / clippy
strategy:
fail-fast: false
matrix:
toolchain: [stable, beta]
steps:
- uses: actions/checkout@v7
with:
submodules: true
- name: Install ${{ matrix.toolchain }}
uses: dtolnay/rust-toolchain@master
with:
toolchain: ${{ matrix.toolchain }}
components: clippy
- name: Install the Arm toolchain
timeout-minutes: 10
run: |
# Skip rebuilding the man page index, which makes installs slow on the runners.
# A short timeout retries stalled mirror downloads instead of waiting on them.
sudo rm -f /var/lib/man-db/auto-update
sudo apt-get -o Acquire::Retries=5 -o Acquire::http::Timeout=20 update
sudo apt-get -o Acquire::Retries=5 -o Acquire::http::Timeout=20 install -y --no-install-recommends gcc-arm-none-eabi libnewlib-arm-none-eabi
- name: Create lib directory
run: mkdir -p "$ACC_RSS_LIBS"
- name: cargo clippy
uses: giraffate/clippy-action@v1
with:
reporter: 'github-pr-check'
github_token: ${{ secrets.GITHUB_TOKEN }}
doc:
runs-on: ubuntu-latest
name: nightly / doc
steps:
- uses: actions/checkout@v7
with:
submodules: true
- name: Install nightly
uses: dtolnay/rust-toolchain@nightly
- name: Install the Arm toolchain
timeout-minutes: 10
run: |
# Skip rebuilding the man page index, which makes installs slow on the runners.
# A short timeout retries stalled mirror downloads instead of waiting on them.
sudo rm -f /var/lib/man-db/auto-update
sudo apt-get -o Acquire::Retries=5 -o Acquire::http::Timeout=20 update
sudo apt-get -o Acquire::Retries=5 -o Acquire::http::Timeout=20 install -y --no-install-recommends gcc-arm-none-eabi libnewlib-arm-none-eabi
- name: Create lib directory
run: mkdir -p "$ACC_RSS_LIBS"
- name: Install cargo-docs-rs
uses: dtolnay/install@cargo-docs-rs
- name: cargo docs-rs
run: cargo docs-rs
env:
RUSTDOCFLAGS: "--cfg docsrs"
features:
runs-on: ubuntu-latest
name: stable / features
steps:
- uses: actions/checkout@v7
with:
submodules: true
- name: Install stable
uses: dtolnay/rust-toolchain@stable
- name: Install the Arm toolchain
timeout-minutes: 10
run: |
# Skip rebuilding the man page index, which makes installs slow on the runners.
# A short timeout retries stalled mirror downloads instead of waiting on them.
sudo rm -f /var/lib/man-db/auto-update
sudo apt-get -o Acquire::Retries=5 -o Acquire::http::Timeout=20 update
sudo apt-get -o Acquire::Retries=5 -o Acquire::http::Timeout=20 install -y --no-install-recommends gcc-arm-none-eabi libnewlib-arm-none-eabi
- name: Create lib directory
run: mkdir -p "$ACC_RSS_LIBS"
- name: cargo install cargo-hack
uses: taiki-e/install-action@cargo-hack
- name: cargo hack
run: cargo hack --feature-powerset check
macos:
runs-on: macos-latest
name: macos / stub_library
steps:
- uses: actions/checkout@v7
with:
submodules: true
- name: Install stable
uses: dtolnay/rust-toolchain@stable
- name: cargo build
run: cargo build --features stub_library,distance,presence
msrv:
runs-on: ubuntu-latest
strategy:
matrix:
msrv: ["1.82"]
name: ubuntu / ${{ matrix.msrv }}
steps:
- uses: actions/checkout@v7
with:
submodules: true
- name: Install ${{ matrix.msrv }}
uses: dtolnay/rust-toolchain@master
with:
toolchain: ${{ matrix.msrv }}
- name: Install the Arm toolchain
timeout-minutes: 10
run: |
# Skip rebuilding the man page index, which makes installs slow on the runners.
# A short timeout retries stalled mirror downloads instead of waiting on them.
sudo rm -f /var/lib/man-db/auto-update
sudo apt-get -o Acquire::Retries=5 -o Acquire::http::Timeout=20 update
sudo apt-get -o Acquire::Retries=5 -o Acquire::http::Timeout=20 install -y --no-install-recommends gcc-arm-none-eabi libnewlib-arm-none-eabi
- name: Create lib directory
run: mkdir -p "$ACC_RSS_LIBS"
- name: cargo check
run: cargo check --all-features