-
Notifications
You must be signed in to change notification settings - Fork 0
150 lines (116 loc) · 3.61 KB
/
datta.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
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
124
125
126
127
128
129
130
131
132
133
134
135
136
137
138
139
140
141
142
143
144
145
146
147
148
149
150
name: datta
on:
push:
branches:
- master
pull_request:
branches:
- master
jobs:
clippy-rustfmt:
runs-on: ubuntu-latest
steps:
- uses: actions/checkout@v4
- name: Install stable
uses: dtolnay/rust-toolchain@stable
with:
components: clippy, rustfmt
- name: Run rustfmt
run:
cargo fmt --all -- --check --verbose
- name: Run clippy
uses: clechasseur/rs-clippy-check@v3
with:
args: -- -D warnings --verbose
build-test:
runs-on: ubuntu-latest
steps:
- uses: actions/checkout@v4
- name: Install Rust stable
uses: dtolnay/rust-toolchain@stable
- name: Build
run: cargo build --verbose --tests --benches
- name: Run tests
run: cargo test --verbose
- name: Generate docs
run: cargo doc --no-deps
code-coverage:
runs-on: ubuntu-latest
steps:
- uses: actions/checkout@v4
- name: Install Rust stable
uses: dtolnay/rust-toolchain@stable
- name: Install grcov
env:
GRCOV_LINK: https://github.com/mozilla/grcov/releases/download
GRCOV_VERSION: v0.8.7
run: |
curl -L "$GRCOV_LINK/$GRCOV_VERSION/grcov-x86_64-unknown-linux-musl.tar.bz2" |
tar xj -C $HOME/.cargo/bin
- name: Install llvm-tools-preview
run: |
rustup component add llvm-tools-preview
# Not necessary on a newly created image, but strictly advised
- name: Run cargo clean
run: |
cargo clean
- name: Run tests
env:
CARGO_INCREMENTAL: 0
LLVM_PROFILE_FILE: "datta-%p-%m.profraw"
RUSTFLAGS: >
-Cinstrument-coverage -Ccodegen-units=1 -Clink-dead-code
-Coverflow-checks=off
RUSTDOCFLAGS: >
-Cinstrument-coverage -Ccodegen-units=1 -Clink-dead-code
-Coverflow-checks=off
run: |
cargo test --verbose
- name: Get coverage data for codecov
run: |
grcov . --binary-path ./target/debug/ -s . -t lcov --branch \
--ignore-not-existing --ignore "/*" --ignore "../*" -o lcov.info
- name: Codecov upload
uses: codecov/codecov-action@v4
with:
files: lcov.info
dependency-check:
runs-on: ubuntu-latest
steps:
- uses: actions/checkout@v4
- name: Install nightly
uses: dtolnay/rust-toolchain@stable
with:
toolchain: nightly
- name: Install cargo-udeps
env:
UDEPS_LINK: https://github.com/est31/cargo-udeps/releases/download
UDEPS_VERSION: v0.1.45
run: |
curl -L "$UDEPS_LINK/$UDEPS_VERSION/cargo-udeps-$UDEPS_VERSION-x86_64-unknown-linux-gnu.tar.gz" |
tar xz -C $HOME/.cargo/bin --strip-components 2
- name: Install cargo-deny
env:
DENY_LINK: https://github.com/EmbarkStudios/cargo-deny/releases/download
DENY_VERSION: 0.14.15
run: |
curl -L "$DENY_LINK/$DENY_VERSION/cargo-deny-$DENY_VERSION-x86_64-unknown-linux-musl.tar.gz" |
tar xz -C $HOME/.cargo/bin --strip-components 1
- name: Install cargo-audit
env:
AUDIT_LINK: https://github.com/rustsec/rustsec/releases/download/cargo-audit%2F
AUDIT_VERSION: v0.20.0
run: |
curl -L "$AUDIT_LINK$AUDIT_VERSION/cargo-audit-x86_64-unknown-linux-musl-$AUDIT_VERSION.tgz" |
tar xzv -C $HOME/.cargo/bin --strip-components 1
- name: Run cargo-udeps
run: |
cargo +nightly udeps --all-targets
- name: Run cargo-deny
run: |
cargo deny init
cargo deny check bans
# cargo deny check licenses
- name: Run cargo-audit
run: |
cargo audit