-
Notifications
You must be signed in to change notification settings - Fork 1.2k
84 lines (77 loc) · 1.96 KB
/
main.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
---
name: CI
on:
push:
branches:
- main
- release-4.*
pull_request:
branches:
- main
- release-4.*
jobs:
config:
runs-on: ubuntu-latest
outputs:
go_versions: ${{ steps.config.outputs.go_versions }}
steps:
- id: config
run: |
echo 'go_versions=["1.20"]' >> "$GITHUB_OUTPUT"
commit-check:
name: Commit Check
runs-on: ubuntu-latest
steps:
- name: commit check
uses: gsactions/commit-message-checker@v2
with:
pattern: |
^(.*):\s*(.*)\n.*$
error: 'Commit must begin with <scope>: <subject>'
flags: 'gm'
excludeTitle: true
excludeDescription: true
checkAllCommitMessages: true
accessToken: ${{ secrets.GITHUB_TOKEN }}
api-reference-check:
name: API Reference Check
runs-on: ubuntu-latest
steps:
- name: Checkout
uses: actions/checkout@v3
- name: gen api reference
run: |
npx widdershins --search false --language_tabs 'python:Python' 'go:Golang' 'javascript:Javascript' --summary ./openapi.yaml -o ./Documentation/reference/api.md
- name: diff
run: |
git diff --exit-code
tidy:
name: Tidy
needs: ['config']
runs-on: ubuntu-latest
strategy:
matrix:
go:
- ${{ fromJSON(needs.config.outputs.go_versions)[0] }}
steps:
- uses: actions/setup-go@v4
with:
go-version: ${{ matrix.go }}
- uses: actions/checkout@v3
- uses: ./.github/actions/go-tidy
with:
go: ${{ matrix.go }}
documentation:
name: Documentation
runs-on: ubuntu-latest
steps:
- uses: actions/checkout@v3
- uses: ./.github/actions/documentation
with:
publish: false
tests:
needs: ['config']
uses: ./.github/workflows/tests.yml
with:
package_expr: ./...
go_versions: ${{ needs.config.outputs.go_versions }}