-
Notifications
You must be signed in to change notification settings - Fork 4
120 lines (116 loc) · 3.36 KB
/
Copy pathrust.yml
File metadata and controls
120 lines (116 loc) · 3.36 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
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
name: Rust
on:
push:
branches: [ master ]
pull_request:
branches: [ master ]
env:
RUST_LOG: info
RUST_BACKTRACE: 1
jobs:
build:
name: Test on ${{ matrix.os }} and ${{ matrix.rust }}
runs-on: ${{ matrix.os }}
strategy:
matrix:
os: [ubuntu-latest, windows-latest]
rust: [stable, beta, nightly]
steps:
- uses: hecrj/setup-rust-action@v1
with:
rust-version: ${{ matrix.rust }}
- uses: actions/checkout@v2
- run: cargo test --verbose --workspace
cargo-check:
name: Check for warnings
runs-on: ubuntu-latest
env:
RUSTFLAGS: -Dwarnings
steps:
- uses: actions/checkout@v2
- uses: hecrj/setup-rust-action@v1
- run: cargo check --workspace --all-targets --verbose
clippy:
name: Lint with Clippy
runs-on: ubuntu-latest
env:
RUSTFLAGS: -Dwarnings
steps:
- uses: actions/checkout@v4
- uses: hecrj/setup-rust-action@v2
with:
components: clippy
- run: cargo clippy --workspace --all-targets --verbose
rustfmt:
name: Verify code formatting
runs-on: ubuntu-latest
steps:
- uses: actions/checkout@v2
- uses: hecrj/setup-rust-action@v1
with:
components: rustfmt
- run: cargo fmt --all -- --check
check-rustdoc-links:
name: Check intra-doc links
runs-on: ubuntu-latest
steps:
- uses: actions/checkout@v2
- uses: hecrj/setup-rust-action@v1
with:
rust-version: nightly
- run: cargo rustdoc --lib -- -D warnings
- run: cargo rustdoc --bin pisa2ciff -- -D warnings
- run: cargo rustdoc --bin ciff2pisa -- -D warnings
code-coverage:
name: Run code coverage
runs-on: ubuntu-latest
env:
CARGO_TERM_COLOR: always
RUSTFLAGS: -Zinstrument-coverage
LLVM_PROFILE_FILE: coverage-%p-%m.profraw
steps:
- uses: actions/checkout@v4
- name: Install nightly toolchain
uses: dtolnay/rust-toolchain@nightly
with:
components: llvm-tools-preview
- name: Install grcov
uses: taiki-e/install-action@v2
with:
tool: grcov@0.8.18
- name: Build and test
run: cargo test --verbose --workspace
- name: Generate coverage report
run: |
mkdir coverage
grcov . \
--binary-path ./target/debug/ \
--source-dir . \
--output-type lcov \
--branch \
--ignore-not-existing \
--ignore "/*" \
--ignore "target/*" \
--ignore "tests/*" \
--ignore "src/bin/*" \
--output-path coverage/lcov.info
- name: Upload to Coveralls
uses: coverallsapp/github-action@v2
with:
github-token: ${{ secrets.GITHUB_TOKEN }}
file: coverage/lcov.info
miri:
name: Miri test
runs-on: ubuntu-latest
env:
RUST_LOG: quickcheck
steps:
- uses: actions/checkout@v2
- run: |
MIRI_NIGHTLY=$(curl -s https://rust-lang.github.io/rustup-components-history/x86_64-unknown-linux-gnu/miri)
echo "Installing latest nightly with Miri: $MIRI_NIGHTLY"
rustup set profile minimal
rustup toolchain install "nightly-$MIRI_NIGHTLY"
rustup default "nightly-$MIRI_NIGHTLY"
rustup component add miri
cargo miri test --lib