-
Notifications
You must be signed in to change notification settings - Fork 0
128 lines (111 loc) · 3.44 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
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
124
125
126
127
128
name: CI
on: [push]
jobs:
audit:
runs-on: ubuntu-latest
steps:
- name: Checkout
uses: actions/checkout@v2
- name: Update Rust
run: |
rustup update stable
- name: Audit
run: |
cargo audit -D warnings
test:
runs-on: ubuntu-latest
steps:
- name: Checkout
uses: actions/checkout@v2
- name: Update Rust
run: |
rustup update stable
- name: Run unit tests
run: |
cargo test --workspace --all-targets --all-features
- name: Run unit tests (no default features)
run: |
cargo test --workspace --all-targets --no-default-features
- name: Run unit tests (default features)
run: |
cargo test --workspace --all-targets
- name: Run doc tests
run: |
rustup toolchain install nightly --profile minimal --allow-downgrade
cargo +nightly test --workspace --doc --all-features
lint:
runs-on: ubuntu-latest
steps:
- name: Checkout
uses: actions/checkout@v2
- name: Install nightly Rust
run: |
rustup toolchain install nightly --profile minimal --component clippy --allow-downgrade
rustup default nightly
- name: Run Clippy
continue-on-error: true
run: |
cargo clippy --workspace --all-targets --all-features -- -D warnings
- name: Run rustdoc
env:
RUSTDOCFLAGS: -D warnings
run: |
cargo doc --no-deps --document-private-items --workspace --all-features
docs:
runs-on: ubuntu-latest
if: github.ref == 'refs/heads/main'
steps:
- name: Checkout
uses: actions/checkout@v2
- name: Generate Docs
run: |
rustup install nightly --profile minimal
cargo +nightly doc --no-deps --workspace --all-features
- name: Deploy Docs
uses: JamesIves/github-pages-deploy-action@releases/v4
with:
branch: gh-pages
folder: target/doc/
git-config-name: kl-botsu
git-config-email: [email protected]
target-folder: /main/
clean: true
coverage:
runs-on: ubuntu-latest
steps:
- uses: actions/checkout@v2
- name: Update Rust
run: |
rustup update stable
- name: Install code coverage requirements
run: |
rustup component add llvm-tools-preview
rustup install nightly
curl -L https://github.com/mozilla/grcov/releases/latest/download/grcov-linux-x86_64.tar.bz2 | tar jxf -
- name: Run code coverage
run: |
cargo xtask generate-code-coverage-report
- name: Deploy Coverage
if: github.ref == 'refs/heads/main'
uses: JamesIves/github-pages-deploy-action@releases/v4
with:
branch: gh-pages
folder: coverage/
git-config-name: kl-botsu
git-config-email: [email protected]
target-folder: /coverage/
clean: true
format:
runs-on: ubuntu-latest
steps:
- name: Checkout
uses: actions/checkout@v2
- name: Rust Formatting
continue-on-error: true
run: |
rustup toolchain install nightly --profile minimal --component rustfmt --allow-downgrade
cargo +nightly fmt -- --check
- name: Prettier
run: |
sudo npm install -g prettier prettier-plugin-toml
npx prettier -l .