-
-
Notifications
You must be signed in to change notification settings - Fork 49
101 lines (94 loc) · 2.61 KB
/
ci.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
name: Continuous Integration
on:
push:
branches:
- master
pull_request:
branches:
- master
schedule:
- cron: "0 0 * * 0"
jobs:
check:
name: Check
runs-on: ubuntu-22.04
steps:
- name: Checkout the repository
uses: actions/checkout@v4
- name: Install Rust toolchain
uses: dtolnay/rust-toolchain@stable
- name: Check the project files
run: cargo check --locked --verbose
test:
name: Test suite
runs-on: ubuntu-22.04
steps:
- name: Checkout the repository
uses: actions/checkout@v4
- name: Install Rust toolchain
uses: dtolnay/rust-toolchain@stable
- name: Setup cargo-tarpaulin
uses: taiki-e/install-action@cargo-tarpaulin
- name: Run tests
run: cargo tarpaulin --out xml --verbose -- --test-threads 1
- name: Upload reports to codecov
uses: codecov/codecov-action@v3
with:
name: code-coverage-report
file: cobertura.xml
flags: unit-tests
fail_ci_if_error: true
verbose: true
token: ${{ secrets.CODECOV_TOKEN }}
fixtures:
name: Test fixtures
runs-on: ubuntu-22.04
steps:
- name: Checkout the repository
uses: actions/checkout@v4
- name: Install Rust toolchain
uses: dtolnay/rust-toolchain@stable
- name: Build the project
run: cargo build --locked --verbose
- name: Run test fixtures
shell: bash
run: ./test-fixtures.sh
working-directory: fixtures
env:
DEBUG: true
clippy:
name: Lints
runs-on: ubuntu-22.04
steps:
- name: Checkout the repository
uses: actions/checkout@v4
- name: Install Rust toolchain
uses: dtolnay/rust-toolchain@stable
with:
components: clippy
- name: Check the lints
run: cargo clippy --tests --verbose -- -D warnings
rustfmt:
name: Formatting
runs-on: ubuntu-22.04
steps:
- name: Checkout the repository
uses: actions/checkout@v4
- name: Install Rust toolchain
uses: dtolnay/rust-toolchain@stable
with:
components: rustfmt
- name: Check the formatting
run: cargo fmt -- --check --verbose
lychee:
name: Links
runs-on: ubuntu-22.04
steps:
- name: Checkout the repository
uses: actions/checkout@v4
- name: Check the links
uses: lycheeverse/lychee-action@v1
with:
args: --exclude "example.com|site.com|localhost|awesome.txt|x.txt" -v *.md
env:
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }}