-
Notifications
You must be signed in to change notification settings - Fork 0
84 lines (72 loc) · 2.61 KB
/
Copy pathtest.yaml
File metadata and controls
84 lines (72 loc) · 2.61 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
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
name: "Tests"
on:
push:
branches: ["latest"]
paths:
- src/**
- Cargo.toml
- Cargo.lock
- .github/workflows/test.yaml
pull_request:
branches: ["latest"]
workflow_dispatch:
env:
CARGO_TERM_COLOR: always
jobs:
test:
name: test (${{ matrix.rust }})
runs-on: ubuntu-latest
strategy:
matrix:
rust: [stable, "1.90.0", nightly]
steps:
- uses: actions/checkout@v5
- name: Install Rust toolchain
uses: actions-rust-lang/setup-rust-toolchain@v1
with:
toolchain: ${{ matrix.rust }}
components: clippy
cache-directories: |
~/.cargo/registry
~/.cargo/bin
target
- name: consult Clippy
run: cargo clippy --all-targets
- name: Install cargo-nextest and cargo-llvm-cov
shell: bash
run: |
if [[ -z $(which cargo-nextest) ]]; then
curl -sL https://get.nexte.st/latest/linux -o nextest.tgz
tar xfz nextest.tgz
mv cargo-nextest /home/runner/.cargo/bin
fi
if [[ -z $(which cargo-llvm-cov) ]]; then
curl -sL https://github.com/taiki-e/cargo-llvm-cov/releases/latest/download/cargo-llvm-cov-x86_64-unknown-linux-gnu.tar.gz -o cargo-llvm-cov.tgz
tar xfz cargo-llvm-cov.tgz
mv cargo-llvm-cov /home/runner/.cargo/bin
fi
- name: run the tests
run: cargo nextest run
- name: Run doctests
run: cargo test --doc
- name: Generate coverage (stable only)
if: matrix.rust == 'stable'
run: cargo llvm-cov --all-targets --workspace --lcov --output-path lcov.info
- name: Upload coverage to GitHub (stable only)
if: matrix.rust == 'stable'
uses: actions/upload-artifact@v4
with:
name: coverage-report
path: lcov.info
fmt:
name: formatting check
runs-on: ubuntu-latest
steps:
- uses: actions/checkout@v5
- name: Install nightly Rust
uses: actions-rust-lang/setup-rust-toolchain@v1
with:
toolchain: nightly
components: rustfmt
- name: check formatting
run: cargo +nightly fmt --check --all