Skip to content
Merged
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
75 changes: 53 additions & 22 deletions .github/workflows/rust.yml
Original file line number Diff line number Diff line change
Expand Up @@ -2,35 +2,66 @@ name: Rust

on:
push:
branches: [ "main" ]
branches: ["main"]
pull_request:
branches: [ "main" ]
branches: ["main"]

env:
CARGO_TERM_COLOR: always

jobs:
build:
quality:
name: Code quality
runs-on: ubuntu-latest

steps:
- uses: actions/checkout@v7
- name: Cache Cargo build artifacts
uses: actions/cache@v6
with:
path: |
~/.cargo/registry/index/
~/.cargo/registry/cache/
~/.cargo/git/db/
target/
key: ${{ runner.os }}-cargo-${{ hashFiles('**/Cargo.lock') }}-${{ github.sha }}
restore-keys: |
${{ runner.os }}-cargo-${{ hashFiles('**/Cargo.lock') }}-
${{ runner.os }}-cargo-

- name: Formatting check
run: cargo fmt --check

- name: Clippy
run: cargo clippy --no-deps --all-targets --all-features

- name: Documentation
run: cargo doc --no-deps --all-features

test:
name: Tests
runs-on: ubuntu-latest

steps:
- uses: actions/checkout@v4
- name: Cache Cargo build artifacts
uses: actions/cache@v4
with:
path: |
~/.cargo/registry/index/
~/.cargo/registry/cache/
~/.cargo/git/db/
target/
key: ${{ runner.os }}-cargo-${{ hashFiles('**/Cargo.lock') }}-${{ github.sha }}
restore-keys: |
${{ runner.os }}-cargo-${{ hashFiles('**/Cargo.lock') }}-
${{ runner.os }}-cargo-
- name: Check
run: cargo check
- name: Clippy
run: cargo clippy
- name: Test
run: cargo test
- uses: actions/checkout@v7
- name: Cache Cargo build artifacts
uses: actions/cache@v6
with:
path: |
~/.cargo/registry/index/
~/.cargo/registry/cache/
~/.cargo/git/db/
target/
key: ${{ runner.os }}-cargo-${{ hashFiles('**/Cargo.lock') }}-${{ github.sha }}
restore-keys: |
${{ runner.os }}-cargo-${{ hashFiles('**/Cargo.lock') }}-
${{ runner.os }}-cargo-

- name: Install cargo-nextest
uses: taiki-e/install-action@nextest

- name: Test
run: cargo nextest run --all-features

- name: Documentation tests
run: cargo test --doc --all-features