Repository navigation
60 lines (49 loc) · 1.47 KB
/
Copy pathci.yml
File metadata and controls
60 lines (49 loc) · 1.47 KB
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
name: CI
on:
push:
pull_request:
workflow_dispatch:
permissions:
contents: read
concurrency:
group: ${{ github.workflow }}-${{ github.ref }}
cancel-in-progress: true
jobs:
test:
name: Rust ${{ matrix.toolchain }} (${{ matrix.configuration }})
runs-on: ubuntu-latest
strategy:
matrix:
include:
- toolchain: stable
configuration: default
features: ""
- toolchain: nightly
configuration: all-features
features: --all-features
env:
CARGO_TERM_COLOR: always
RUSTUP_TOOLCHAIN: ${{ matrix.toolchain }}
steps:
- uses: actions/checkout@v7
- name: Install Rust
run: rustup toolchain install "$RUSTUP_TOOLCHAIN" --profile minimal
- name: Cache Cargo dependencies
uses: actions/cache@v6
with:
path: |
~/.cargo/registry
~/.cargo/git
key: ${{ runner.os }}-cargo-${{ hashFiles('Cargo.lock') }}
- name: Test
run: cargo test --locked ${{ matrix.features }}
- name: Install formatting and lint tools
run: rustup component add rustfmt clippy
- name: Check formatting
run: cargo fmt --all -- --check
- name: Clippy
run: cargo clippy --locked --all-targets ${{ matrix.features }} -- -D warnings
- name: Check documentation
env:
RUSTDOCFLAGS: -D warnings
run: cargo doc --locked ${{ matrix.features }} --no-deps