-
Notifications
You must be signed in to change notification settings - Fork 3
106 lines (102 loc) · 3.45 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
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
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@v2
- uses: hecrj/setup-rust-action@v1
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:
RUSTFLAGS: -Zinstrument-coverage
LLVM_PROFILE_FILE: coverage-%p-%m.profraw
steps:
- uses: actions/checkout@v2
- uses: hecrj/setup-rust-action@v1
with:
rust-version: nightly
- run: rustup component add llvm-tools-preview
- run: echo "PATH=/home/runner/.cargo/bin:$PATH" >> $GITHUB_ENV
- run: echo "7817b621f62dddfadd35fb84999b441bbce72b70cd8a61a9fe8e0998ccf75898 *grcov-v0.8.6-x86_64-unknown-linux-gnu.tar.gz" > checksums
- run: curl -sOL https://github.com/mozilla/grcov/releases/download/v0.8.6/grcov-v0.8.6-x86_64-unknown-linux-gnu.tar.gz
- run: sha256sum -c checksums --ignore-missing
- run: tar xf grcov-v0.8.6-x86_64-unknown-linux-gnu.tar.gz
- run: cargo test --verbose --workspace
- run: mkdir ./coverage
- run: ./grcov . --binary-path ./target/debug/ -s . -t lcov --branch --ignore-not-existing --ignore "*cargo*" --ignore "build.rs" --ignore "*target*" --ignore "tests/*" --ignore "*ciff2pisa.rs" --ignore "*pisa2ciff.rs" -o ./coverage/lcov.info
- name: Coveralls
uses: coverallsapp/github-action@master
with:
github-token: ${{ secrets.GITHUB_TOKEN }}
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