-
Notifications
You must be signed in to change notification settings - Fork 0
65 lines (60 loc) · 1.78 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
name: Rust
on:
push:
branches: [ master ]
pull_request:
branches: [ master ]
env:
CARGO_TERM_COLOR: always
jobs:
build:
runs-on: ${{ matrix.os }}
strategy:
matrix:
build: [ linux, macos, windows ]
rust: [ stable ]
include:
- build: linux
os: ubuntu-latest
- build: macos
os: macos-latest
- build: windows
os: windows-latest
steps:
- uses: hecrj/setup-rust-action@v1
with:
rust-version: ${{ matrix.rust }}
- uses: actions/checkout@v3
- name: Rust version
run: rustup -V
- name: Build
run: cargo build
- name: Run cargo-tarpaulin
if: matrix.build == 'linux'
uses: actions-rs/tarpaulin@v0.1
with:
version: '0.15.0'
args: '-- --test-threads 1'
- name: Upload to codecov.io
if: matrix.build == 'linux' && matrix.rust != 'nightly'
uses: codecov/codecov-action@v3
- name: Run tests
if: matrix.build != 'linux'
run: cargo test --verbose -- --nocapture
- name: Setup linter
if: matrix.rust == 'nightly' || matrix.build != 'linux'
run: rustup component add clippy
- name: Run linter
if: matrix.rust == 'nightly' || matrix.build != 'linux'
run: cargo clippy -- -Dwarnings
- name: Run clippy-check
if: matrix.rust != 'nightly' && matrix.build == 'linux'
uses: actions-rs/clippy-check@v1
with:
token: ${{ secrets.GITHUB_TOKEN }}
args: --all-features --release -- -Dwarnings
- name: Run audit
if: matrix.rust != 'nightly' && matrix.build == 'linux'
uses: actions-rs/audit-check@v1
with:
token: ${{ secrets.GITHUB_TOKEN }}