mirror of
https://github.com/Blah-IM/blahrs.git
synced 2025-05-01 08:41:09 +00:00

`precise_capturing` has no workaround but we need it in tests. The main crate should still compile under stable rustc, which is enforced by CI.
96 lines
2.3 KiB
YAML
96 lines
2.3 KiB
YAML
name: CI
|
|
on:
|
|
pull_request:
|
|
push:
|
|
|
|
permissions:
|
|
contents: read
|
|
|
|
env:
|
|
RUST_BACKTRACE: full
|
|
RUSTDOCFLAGS: -Dwarnings
|
|
RUSTFLAGS: -Dwarnings
|
|
|
|
jobs:
|
|
style:
|
|
name: Code style
|
|
runs-on: ubuntu-latest
|
|
timeout-minutes: 15
|
|
steps:
|
|
- name: Checkout
|
|
uses: actions/checkout@v4
|
|
|
|
- name: Install Rust beta
|
|
run: |
|
|
rustup update --no-self-update beta
|
|
rustup default beta
|
|
|
|
- name: Cache dependencies
|
|
uses: Swatinem/rust-cache@v2
|
|
|
|
- name: Rustfmt
|
|
run: cargo fmt -- --check
|
|
|
|
- name: Clippy
|
|
run: cargo clippy --workspace --all-targets -- -D clippy::dbg_macro -D clippy::todo
|
|
|
|
- name: Rustdoc
|
|
run: cargo doc --workspace
|
|
|
|
test:
|
|
strategy:
|
|
matrix:
|
|
rust: [stable, beta]
|
|
name: Test ${{ matrix.rust }}
|
|
runs-on: ubuntu-latest
|
|
timeout-minutes: 15
|
|
steps:
|
|
- name: Checkout
|
|
uses: actions/checkout@v4
|
|
|
|
- name: Disable high-priority rust-toolchain.toml
|
|
run: rm rust-toolchain.toml
|
|
|
|
- name: Install Rust ${{ matrix.rust }}
|
|
run: |
|
|
rustup update --no-self-update ${{ matrix.rust }}
|
|
rustup default ${{ matrix.rust }}
|
|
|
|
- name: Disable integration tests on stable rustc
|
|
if: matrix.rust == 'stable'
|
|
run: mv ./blahd/tests{,-disabled}
|
|
|
|
- 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
|
|
|
|
nix-flake:
|
|
name: Flake package
|
|
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: Cache nix store
|
|
uses: DeterminateSystems/magic-nix-cache-action@b46e247b898aa56e6d2d2e728dc6df6c84fdb738
|
|
with:
|
|
# I do NOT consent to share build cache between FlakeHub.
|
|
# This should NOT be the default.
|
|
use-flakehub: false
|
|
|
|
- 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
|