Merge pull request #14 from fpco/cargo-lock #76
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: Rust | |
on: | |
push: | |
branches: [master] | |
tags: | |
- '*' # Push events to matching v*, i.e. v1.0, v20.15.10 | |
pull_request: | |
env: | |
CARGO_TERM_COLOR: always | |
CARGO_INCREMENTAL: 0 | |
CARGO_NET_RETRY: 10 | |
RUST_BACKTRACE: short | |
RUSTUP_MAX_RETRIES: 10 | |
jobs: | |
checks: | |
runs-on: ${{ matrix.os }} | |
strategy: | |
fail-fast: false | |
matrix: | |
os: | |
- ubuntu-latest | |
- macos-latest | |
- windows-latest | |
toolchain: | |
- 1.71.0 | |
- stable | |
- nightly | |
steps: | |
- uses: actions/checkout@v2 | |
- uses: extractions/setup-just@v1 | |
with: | |
just-version: 1.10.0 | |
- uses: Swatinem/rust-cache@v2 | |
with: | |
key: ${{ runner.os }}-${{ hashFiles('Cargo.lock') }}-${{ matrix.toolchain }} | |
- uses: dtolnay/rust-toolchain@master | |
with: | |
toolchain: ${{ matrix.toolchain }} | |
components: clippy, rustfmt | |
- name: Install musl tools | |
run: | | |
sudo apt-get install -y musl-tools | |
rustup target add x86_64-unknown-linux-musl | |
if: runner.os == 'Linux' | |
- name: Build | |
run: cargo build | |
- name: Run tests | |
run: | | |
just test | |
cd pid1 && just test | |
if: runner.os == 'Linux' | |
- name: Run pid1 tests | |
run: just test-init-image | |
if: runner.os == 'Linux' | |
- name: clippy | |
run: cargo clippy -- --deny "warnings" | |
- name: fmt | |
run: cargo fmt -- --check |