-
Notifications
You must be signed in to change notification settings - Fork 1
127 lines (118 loc) · 3.54 KB
/
dev_checks.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
name: Dev checks
run-name: "Dev checks - ${{ github.sha }}"
on:
pull_request:
types: [opened, synchronize, reopened, ready_for_review]
paths-ignore:
- "assets/**"
- "**.md"
- ".gitignore"
- "docker/**"
push:
branches:
- main
paths-ignore:
- "assets/**"
- "**.md"
- ".gitignore"
- "docker/**"
workflow_dispatch:
concurrency:
group: dev-checks-${{ github.event_name }}-${{ github.ref }}
cancel-in-progress: true
jobs:
commit-check:
runs-on: ubuntu-22.04
if: ${{ github.event_name == 'push' }}
timeout-minutes: 5
steps:
- name: Check Commit Type
uses: gsactions/commit-message-checker@v2
with:
pattern: '^(feat|fix|docs|style|refactor|chore|perf|test|build|ci|revert)(\(\S+\))?: .+'
error: "Invalid commit type"
excludeDescription: "true"
excludeTitle: "false"
checkAllCommitMessages: "true"
accessToken: ${{ secrets.GITHUB_TOKEN }}
- name: Check Commit Message
uses: gsactions/commit-message-checker@v2
with:
pattern: '^.+: [^A-Z].+[^\.](\n.*)*$'
error: 'Invalid commit message: first letter capitalized, less than 3 letter, end with "."'
excludeDescription: "true"
excludeTitle: "true"
checkAllCommitMessages: "true"
accessToken: ${{ secrets.GITHUB_TOKEN }}
format-check:
runs-on: ubuntu-22.04
timeout-minutes: 5
container:
image: ghcr.io/${{ github.repository }}/runner:latest
steps:
- run: git config --global --add safe.directory '*'
- uses: actions/checkout@v4
- name: Check Go format
working-directory: go
run: |
if [ -n "$(gofmt -d .)" ]; then
echo "Formatting issues found. Please run gofmt."
exit 1
fi
- name: Check Python format
working-directory: python
run: |
black --check .
- name: Check cargofmt
working-directory: rust
run: |
cargo fmt --help
- name: Check Rust format
working-directory: rust
run: |
# cargo fmt -check 2>/dev/null
cargo fmt -check
typo-check:
runs-on: ubuntu-22.04
container:
image: ghcr.io/${{ github.repository }}/runner:latest
timeout-minutes: 5
steps:
- run: git config --global --add safe.directory '*'
- uses: actions/checkout@v4
- uses: crate-ci/typos@master
deny-check:
runs-on: ubuntu-22.04
timeout-minutes: 5
steps:
- run: git config --global --add safe.directory '*'
- uses: actions/checkout@v4
- run: cd rust
- uses: EmbarkStudios/cargo-deny-action@v1
with:
manifest-path: rust/Cargo.toml
arguments: --all-features
command: check licenses sources bans
toml-check:
runs-on: ubuntu-22.04
timeout-minutes: 10
container:
image: ghcr.io/${{ github.repository }}/runner:latest
steps:
- run: git config --global --add safe.directory '*'
- uses: actions/checkout@v4
- run: taplo format --check --diff
clippy-check:
runs-on:
group: github-amd64-8c32g
timeout-minutes: 15
container:
image: ghcr.io/${{ github.repository }}/runner:latest
steps:
- run: git config --global --add safe.directory '*'
- uses: actions/checkout@v4
- run: ls
- run: pwd
- run: rustup toolchain list
- working-directory: rust
run: cargo clippy --workspace --all-targets --all-features -- -D warnings