-
Notifications
You must be signed in to change notification settings - Fork 0
72 lines (63 loc) · 2.01 KB
/
Copy pathci.yml
File metadata and controls
72 lines (63 loc) · 2.01 KB
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
name: ci
on:
push:
branches: [develop, main]
pull_request:
env:
CARGO_TERM_COLOR: always
jobs:
pr-source-branch:
if: github.event_name == 'pull_request'
runs-on: ubuntu-latest
steps:
- name: enforce branch flow
run: |
BASE='${{ github.base_ref }}'
HEAD='${{ github.head_ref }}'
echo "PR: $HEAD -> $BASE"
if [ "$BASE" = "main" ] && [ "$HEAD" != "develop" ]; then
echo "::error::PRs to main are only allowed from develop. Got head=$HEAD"
exit 1
fi
fmt:
runs-on: ubuntu-latest
steps:
- uses: actions/checkout@v6
- uses: dtolnay/rust-toolchain@1.95.0
with:
components: rustfmt
- run: cargo fmt --all -- --check
clippy:
runs-on: ubuntu-latest
steps:
- uses: actions/checkout@v6
- uses: dtolnay/rust-toolchain@1.95.0
with:
components: clippy
- uses: Swatinem/rust-cache@v2
- run: cargo clippy --workspace --all-targets -- -D clippy::unwrap_used -D clippy::dbg_macro
test:
runs-on: ubuntu-latest
steps:
- uses: actions/checkout@v6
- uses: dtolnay/rust-toolchain@1.95.0
- uses: Swatinem/rust-cache@v2
- uses: taiki-e/install-action@nextest
- run: cargo nextest run --workspace --no-fail-fast
doc:
runs-on: ubuntu-latest
steps:
- uses: actions/checkout@v6
- uses: dtolnay/rust-toolchain@1.95.0
- uses: Swatinem/rust-cache@v2
- run: cargo doc --workspace --no-deps --document-private-items
loc:
runs-on: ubuntu-latest
steps:
- uses: actions/checkout@v6
- run: bash scripts/check-loc.sh $(find . -name '*.rs' -not -path './target/*' -not -path './tests/*' -not -path './examples/*' -not -path './xtask/*')
no-comments:
runs-on: ubuntu-latest
steps:
- uses: actions/checkout@v6
- run: bash scripts/check-no-comments.sh $(find . -name '*.rs' -not -path './target/*' -not -path './tests/*' -not -path './examples/*' -not -path './xtask/*')