-
Notifications
You must be signed in to change notification settings - Fork 420
141 lines (113 loc) · 3.31 KB
/
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
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
128
129
130
131
132
133
134
135
136
137
138
139
140
141
name: ci
on:
pull_request:
types:
- opened
- edited
- synchronize
jobs:
build:
runs-on: ubuntu-latest
strategy:
matrix:
command: [compile-linux, compile-windows, compile-darwin]
steps:
- name: Set up Go
uses: actions/setup-go@v3
with:
go-version: '1.21'
- name: Set up Node
uses: actions/setup-node@v1
with:
node-version: 16.x
- name: Check out code
uses: actions/checkout@v2
- name: Package custom resources
run: make package-custom-resources
- name: Build binaries
run: make ${{matrix.command}}
- name: Cleanup
run: make package-custom-resources-clean
mocks:
runs-on: ubuntu-latest
steps:
- name: Set up Go
uses: actions/setup-go@v3
with:
go-version: '1.21'
- name: Set up Node
uses: actions/setup-node@v1
with:
node-version: 16.x
- name: Check out code
uses: actions/checkout@v2
- name: Generate mocks
run: make gen-mocks
- name: Print out local diff after mockgen
run: |
git status --porcelain=v1 1>gitstatus.txt
cat gitstatus.txt
- name: Check for nonzero diff
run: '[ -z "$(cat gitstatus.txt)" ] && echo "Generated mocks all match"'
test:
runs-on: ubuntu-latest
steps:
- name: Set up Go
uses: actions/setup-go@v3
with:
go-version: '1.21'
- name: Set up Node
uses: actions/setup-node@v1
with:
node-version: 16.x
- name: Check out code
uses: actions/checkout@v2
- name: Run tests
run: make local-test
- name: Upload golang coverage report to CodeCov
uses: codecov/codecov-action@v3
with:
files: ./coverage.out
- name: Upload node coverage report to CodeCov
uses: codecov/codecov-action@v3
with:
directory: cf-custom-resources/
staticcheck:
runs-on: ubuntu-latest
steps:
- name: Set up Go
uses: actions/setup-go@v3
with:
go-version: '1.21'
- name: Check out code
uses: actions/checkout@v2
- name: Run golangci-lint
uses: golangci/golangci-lint-action@v3
with:
version: v1.54
args: --timeout 5m0s
license:
runs-on: ubuntu-latest
steps:
- name: Set up Go
uses: actions/setup-go@v3
with:
go-version: '1.21'
- name: Check out code
uses: actions/checkout@v2
- name: Run license check
run: ./scripts/license.sh .
conventional-commits:
runs-on: ubuntu-latest
steps:
- name: validate
uses: actions/github-script@v6
with:
script: |
// See https://gist.github.com/marcojahn/482410b728c31b221b70ea6d2c433f0c#file-conventional-commit-regex-md
const regex = /^(build|chore|ci|docs|feat|fix|perf|refactor|revert|style|test){1}(\([\w\-\.]+\))?(!)?: ([\w ])+([\s\S]*)/g;
const pr = context.payload.pull_request;
const title = pr.title;
if (title.match(regex) == null) {
throw `PR title "${title}"" does not match conventional commits from https://www.conventionalcommits.org/en/v1.0.0/`
}