ci: Do a check build on our MSRV #1186
Workflow file for this run
This file contains 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: CI | |
on: | |
push: | |
branches: [ 'main' ] | |
pull_request: | |
branches: [ '**' ] | |
workflow_dispatch: | |
permissions: {} | |
env: | |
CARGO_TERM_COLOR: always | |
RUSTFLAGS: '-D warnings' | |
jobs: | |
test-nightly: | |
name: Test (${{ contains(matrix.runs-on, 'arm') && 'AArch64' || 'x86_64'}}, ${{ matrix.container }}${{ matrix.test-qemu && ', QEMU' || ''}}) | |
strategy: | |
matrix: | |
runs-on: | |
- ubuntu-latest | |
- ubuntu-24.04-arm | |
container: | |
- 'ubuntu:22.04' | |
- 'ubuntu:latest' | |
- 'ubuntu:rolling' | |
- 'opensuse/tumbleweed:latest' | |
test-qemu: | |
- false | |
include: | |
- runs-on: ubuntu-latest | |
container: 'ubuntu:rolling' | |
test-qemu: true | |
fail-fast: false | |
runs-on: ${{ matrix.runs-on }} | |
container: | |
image: ${{ matrix.container }} | |
steps: | |
- run: echo "WILD_TEST_CROSS=aarch64" >> $GITHUB_ENV | |
if: ${{ matrix.test-qemu }} | |
- run: apt-get update && apt-get -y install gcc g++ clang lld curl bubblewrap binutils-aarch64-linux-gnu | |
if: ${{ contains(matrix.container, 'ubuntu') }} | |
- run: apt-get update && apt-get -y install qemu-user gcc-aarch64-linux-gnu g++-aarch64-linux-gnu | |
if: ${{ matrix.test-qemu }} | |
- run: zypper in -y gcc gcc-c++ glibc-devel-static clang lld curl rustup bubblewrap | |
if: ${{ contains(matrix.container, 'opensuse') }} | |
- run: useradd -m -g users user && su user && cd ~ | |
- uses: actions/checkout@v4 | |
with: | |
persist-credentials: false | |
- uses: dtolnay/rust-toolchain@nightly | |
id: rust-toolchain | |
with: | |
targets: x86_64-unknown-linux-gnu,x86_64-unknown-linux-musl,aarch64-unknown-linux-gnu,aarch64-unknown-linux-musl | |
components: rustc-codegen-cranelift-preview | |
- uses: actions/cache@v4 | |
with: | |
path: | | |
~/.cargo/bin/ | |
~/.cargo/registry/index/ | |
~/.cargo/registry/cache/ | |
~/.cargo/git/db/ | |
target/ | |
key: ${{ runner.os }}-${{ matrix.container }}-${{ matrix.runs-on }}-cargo-${{ steps.rust-toolchain.outputs.cachekey }}-${{ hashFiles('**/Cargo.lock') }} | |
- run: cargo build --profile ci --workspace --no-default-features | |
- run: WILD_TEST_CROSS=$WILD_TEST_CROSS cargo test --profile ci --workspace | |
clippy: | |
name: Clippy | |
runs-on: ubuntu-24.04 | |
steps: | |
- uses: actions/checkout@v4 | |
with: | |
persist-credentials: false | |
# This is where we check that we're not using features from a more recent rust version. When | |
# updating this, please also update workspace.package.rust-version in `Cargo.toml`. | |
- uses: dtolnay/[email protected] | |
id: rust-toolchain | |
with: | |
components: clippy | |
- uses: actions/cache@v4 | |
with: | |
path: | | |
~/.cargo/bin/ | |
~/.cargo/registry/index/ | |
~/.cargo/registry/cache/ | |
~/.cargo/git/db/ | |
target/ | |
key: ${{ runner.os }}-clippy-${{ steps.rust-toolchain.outputs.cachekey }}-${{ hashFiles('**/Cargo.lock') }} | |
- run: cargo clippy --workspace --target x86_64-unknown-linux-gnu | |
rustfmt: | |
name: Check formatting | |
runs-on: ubuntu-24.04 | |
steps: | |
- uses: actions/checkout@v4 | |
with: | |
persist-credentials: false | |
- uses: dtolnay/rust-toolchain@nightly | |
with: | |
components: rustfmt | |
- run: cargo fmt --all -- --check | |
spelling: | |
name: Spell Check with Typos | |
runs-on: ubuntu-24.04 | |
steps: | |
- uses: actions/checkout@v4 | |
with: | |
persist-credentials: false | |
- name: Spell Check Repo | |
uses: crate-ci/[email protected] |