-
Notifications
You must be signed in to change notification settings - Fork 39
75 lines (70 loc) · 2.26 KB
/
rust.yml
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
name: Continuous integration
on: [push, pull_request]
jobs:
Test:
runs-on: ubuntu-latest
strategy:
fail-fast: false
matrix:
rust:
- 1.63.0 # MSRV
- stable
- nightly
steps:
- name: "Checkout repo"
uses: actions/checkout@v4
- name: "Install ${{ matrix.rust }} toolchain"
# https://github.com/dtolnay/rust-toolchain?tab=readme-ov-file#inputs
uses: dtolnay/rust-toolchain@master
with:
toolchain: ${{ matrix.rust }}
- name: "Use cache"
uses: Swatinem/rust-cache@v2
- name: Run tests
run: RUST_LOG=debug bash contrib/test.sh
Format:
runs-on: ubuntu-latest
steps:
- name: "Checkout repo"
uses: actions/checkout@v4
- name: "Install nightly toolchain"
uses: dtolnay/rust-toolchain@nightly
- name: "Use cache"
uses: Swatinem/rust-cache@v2
- run: rustup component add rustfmt --toolchain nightly-x86_64-unknown-linux-gnu
- name: "Run formatting check"
run: cargo fmt --all -- --check
Lint:
runs-on: ubuntu-latest
steps:
- name: "Checkout repo"
uses: actions/checkout@v4
- name: "Install nightly toolchain"
uses: dtolnay/rust-toolchain@nightly
- name: "Use cache"
uses: Swatinem/rust-cache@v2
- name: "Install clippy"
run: rustup component add clippy --toolchain nightly-x86_64-unknown-linux-gnu
- name: "Run code linting"
run: bash contrib/lint.sh
- name: "Run documentation linting"
run: RUSTDOCFLAGS="-D warnings" cargo doc --no-deps --all-features --document-private-items
Coverage:
name: Code coverage
runs-on: ubuntu-latest
strategy:
fail-fast: false
steps:
- name: "Checkout repo"
uses: actions/checkout@v4
- name: "Install toolchain"
# https://github.com/dtolnay/rust-toolchain
uses: dtolnay/rust-toolchain@stable
- name: "Use cache"
uses: Swatinem/rust-cache@v2
- name: "Install cargo-llvm-cov"
uses: taiki-e/install-action@cargo-llvm-cov
- name: "Generate code coverage for tests"
run: bash contrib/coverage.sh
- name: "Upload report to coveralls"
uses: coverallsapp/github-action@v2