-
Notifications
You must be signed in to change notification settings - Fork 0
132 lines (118 loc) · 3.87 KB
/
3-artifacts.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
on: [push]
name: Docs & Coverage
jobs:
rustdoc:
name: Documentation
runs-on: ubuntu-latest
steps:
- name: Checkout sources
uses: actions/checkout@v2
- name: Cache stable toolchain
uses: actions/cache@v1
with:
path: ~/.rustup
key: ${{ runner.os }}-toolchain-stable-${{ hashFiles('**/Cargo.lock') }}
restore-keys: ${{ runner.os }}-toolchain-stable-
- name: Cache cargo
uses: actions/cache@v1
with:
path: ~/.cargo
key: ${{ runner.os }}-cargo-stable-${{ hashFiles('**/Cargo.lock') }}
restore-keys: ${{ runner.os }}-cargo-stable-
- name: Cache cargo build
uses: actions/cache@v1
with:
path: target
key: ${{ runner.os }}-target-stable-${{ hashFiles('**/Cargo.lock') }}-quiet
restore-keys: |
${{ runner.os }}-target-stable-${{ hashFiles('**/Cargo.lock') }}-
${{ runner.os }}-target-stable-
- name: Install stable toolchain
uses: actions-rs/toolchain@v1
with:
profile: minimal
toolchain: stable
override: true
components: clippy, rustfmt
- name: Run cargo doc
uses: actions-rs/cargo@v1
with:
command: doc
args: --no-deps --all --all-features
- name: Generate artifact slug
id: split-path
uses: action-util/split-path@v1
with:
path: ${{ github.repository }}
- name: Save documentation artifact
uses: actions/upload-artifact@v1
with:
name: doc-${{ steps.split-path.outputs.basename }}
path: target/doc
- name: Clean Cargo cache
run: |
cargo install --force --no-default-features --features ci-autoclean cargo-cache
cargo-cache
tarpaulin:
name: Coverage
runs-on: ubuntu-latest
steps:
- name: Checkout sources
uses: actions/checkout@v2
- name: Cache nightly toolchain
uses: actions/cache@v1
with:
path: ~/.rustup
key: ${{ runner.os }}-toolchain-nightly-${{ hashFiles('**/Cargo.lock') }}
restore-keys: ${{ runner.os }}-toolchain-nightly-
- name: Cache cargo
uses: actions/cache@v1
with:
path: ~/.cargo
key: ${{ runner.os }}-cargo-nightly-${{ hashFiles('**/Cargo.lock') }}
restore-keys: ${{ runner.os }}-cargo-nightly-
- name: Cache cargo build
uses: actions/cache@v1
with:
path: target
key: ${{ runner.os }}-target-nightly-${{ hashFiles('**/Cargo.lock') }}
restore-keys: ${{ runner.os }}-target-nightly-
- name: Install nightly toolchain
uses: actions-rs/toolchain@v1
with:
profile: minimal
toolchain: nightly
override: true
- name: Install cargo-tarpaulin
uses: actions-rs/cargo@v1
with:
command: install
args: cargo-tarpaulin -f
- name: Run tarpaulin
uses: actions-rs/cargo@v1
with:
command: tarpaulin
args: |
--verbose
--run-types Tests Doctests Examples
--ignore-panics
--out Html Lcov
--output-dir coverage/
- name: Prepare coverage report
run: |
sudo apt-get install lcov
genhtml -o coverage coverage/lcov.info
- name: Generate artifact slug
id: split-path
uses: action-util/split-path@v1
with:
path: ${{ github.repository }}
- name: Save coverage report artifact
uses: actions/upload-artifact@v1
with:
name: coverage-${{ steps.split-path.outputs.basename }}
path: coverage/
- name: Clean Cargo cache
run: |
cargo install --force --no-default-features --features ci-autoclean cargo-cache
cargo-cache