-
Notifications
You must be signed in to change notification settings - Fork 1
87 lines (76 loc) · 2 KB
/
pipeline.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
name: CI
on:
push:
branches:
- main
pull_request:
branches:
- main
concurrency:
group: ${{ github.workflow }}-${{ github.event.pull_request.number || github.sha }}
cancel-in-progress: ${{ github.ref_name != 'main' }}
env:
NODE_VERSION: 20
jobs:
format:
name: Format
runs-on: ubuntu-latest
steps:
- uses: actions/checkout@v4
- uses: Boshen/setup-rust@main
with:
components: rustfmt
tools: taplo-cli
restore-cache: false
- run: taplo lint
- run: cargo fmt -- --check
lint:
name: Lint
runs-on: ubuntu-latest
steps:
- uses: actions/checkout@v4
- uses: Boshen/setup-rust@main
with:
components: clippy
cache-key: warm
- run: cargo clippy --all-targets --all-features --no-deps -- -D warnings
check:
name: Check
runs-on: ubuntu-latest
steps:
- uses: actions/checkout@v4
- uses: Boshen/setup-rust@main
with:
cache-key: warm
tools: cargo-nextest
- run: cargo check --all-features --all-targets
doc:
name: Doc
runs-on: ubuntu-latest
steps:
- uses: actions/checkout@v4
- uses: Boshen/setup-rust@main
with:
cache-key: warm
components: rust-docs
- run: make doc
test:
name: Test
runs-on: ubuntu-latest
steps:
- uses: actions/checkout@v4
- uses: actions/setup-node@v4
with:
node-version: ${{ env.NODE_VERSION }}
- uses: Boshen/setup-rust@main
with:
# warm cache factory for all other CI jobs
# cache `target` directory to avoid download crates
save-cache: ${{ github.ref_name == 'main' }}
cache-key: warm
tools: cargo-nextest
- run: npm install -g http-server
- run: cargo check --all-features --all-targets
- run: cargo test --all-features --no-run
- run: cargo nextest run --all-features
- run: cargo test --doc --all-features