Future proof tests #34
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: Future proof tests | |
on: | |
schedule: | |
- cron: '6 1 * * 0' # Sun *-*-* 01:06:00 UTC | |
workflow_dispatch: | |
permissions: | |
contents: read | |
env: | |
RUST_BACKTRACE: full | |
RUSTFLAGS: -Dwarnings | |
jobs: | |
outdated: | |
name: Outdated | |
runs-on: ubuntu-latest | |
timeout-minutes: 15 | |
steps: | |
- name: Checkout | |
uses: actions/checkout@v4 | |
- name: Install cargo-outdated | |
uses: dtolnay/install@cargo-outdated | |
- name: cargo-outdated | |
run: | | |
rm Cargo.lock # Ignore trivially updatable compatible versions. | |
cargo outdated --workspace --exit-code 1 | |
test: | |
strategy: | |
matrix: | |
rust: [beta, nightly] | |
name: Test ${{ matrix.rust }} | |
runs-on: ubuntu-latest | |
timeout-minutes: 15 | |
steps: | |
- name: Load kernel module ublk_drv | |
run: | | |
sudo apt-get update | |
sudo apt-get install --no-install-recommends --yes "linux-modules-extra-$(uname -r)" | |
sudo modprobe ublk_drv | |
- name: Checkout | |
uses: actions/checkout@v4 | |
- name: Install Rust ${{ matrix.rust }} | |
run: | | |
rustup update --no-self-update ${{ matrix.rust }} | |
rustup default ${{ matrix.rust }} | |
- name: Cache Dependencies | |
uses: Swatinem/rust-cache@v2 | |
- name: Build | |
run: cargo build --workspace --all-targets | |
- name: Test | |
run: cargo test --workspace --all-targets -- --include-ignored | |
env: | |
CARGO_TARGET_X86_64_UNKNOWN_LINUX_GNU_RUNNER: sudo | |
nix-flake-latest: | |
name: Flake package following latest | |
runs-on: ubuntu-latest | |
timeout-minutes: 15 | |
steps: | |
- name: Checkout | |
uses: actions/checkout@v4 | |
- name: Install Nix | |
uses: cachix/install-nix-action@v26 | |
with: | |
github_access_token: ${{ secrets.GITHUB_TOKEN }} | |
- name: Flake update | |
# https://github.com/actions/checkout/tree/v3.3.0#push-a-commit-using-the-built-in-token | |
run: | | |
git config user.name github-actions | |
git config user.email [email protected] | |
nix flake update --commit-lock-file | |
- name: Flake check | |
run: nix flake check --no-update-lock-file --show-trace | |
- name: Flake build | |
run: nix build --no-update-lock-file --show-trace --print-build-logs | |