-
Notifications
You must be signed in to change notification settings - Fork 1.2k
65 lines (61 loc) · 1.54 KB
/
config-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
---
name: Config module CI
on:
push:
paths:
- config/**
branches:
- main
- release-4.*
pull_request:
paths:
- config/**
branches:
- main
- release-4.*
jobs:
commit-check:
name: Commit Check
runs-on: ubuntu-latest
steps:
- name: Commit Check
uses: gsactions/commit-message-checker@v2
with:
pattern: |
^[^:!]+: .+\n\n.*$
error: 'Commit must begin with <scope>: <subject>'
flags: 'gm'
excludeTitle: true
excludeDescription: true
checkAllCommitMessages: true
accessToken: ${{ secrets.GITHUB_TOKEN }}
tidy:
name: Tidy
runs-on: ubuntu-latest
steps:
- name: Checkout
id: checkout
if: ${{ !cancelled() }}
uses: actions/checkout@v4
- name: Setup Go
id: setupgo
if: ${{ !cancelled() && steps.checkout.conclusion == 'success' }}
uses: actions/setup-go@v5
with:
cache: false
go-version-file: ./config/go.mod
- name: Go Tidy
if: ${{ !cancelled() && steps.checkout.conclusion == 'success' && steps.setupgo.conclusion == 'success' }}
working-directory: ./config
run: |
trap 'echo "::error file=go.mod,title=Tidy Check::Commit would leave go.mod untidy"' ERR
go mod tidy
git diff --exit-code
tests:
name: Tests
if: ${{ !cancelled() }}
uses: ./.github/workflows/tests.yml
with:
cd: config
package_expr: ./...
qemu: false