-
Notifications
You must be signed in to change notification settings - Fork 0
74 lines (59 loc) · 1.63 KB
/
ci.yaml
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
name: CI
on:
pull_request:
types: [opened, edited, synchronize, reopened]
# Allows you to run this workflow manually from the Actions tab
workflow_dispatch:
permissions: {}
jobs:
golangci:
name: Lint
runs-on: ubuntu-latest
steps:
- name: Checkout
uses: actions/checkout@v4
with:
fetch-depth: 0
- name: Setup Go
uses: actions/setup-go@v5
with:
go-version: 1.22
cache: true
cache-dependency-path: go.sum
- name: golangci-lint
uses: golangci/[email protected]
with:
version: v1.60.2
test:
name: Run tests and collect coverage
runs-on: ubuntu-latest
steps:
- name: Checkout
uses: actions/checkout@v4
- name: Setup Go
uses: actions/setup-go@v5
with:
go-version: 1.22
- name: Run Tests
run: make test
- name: Upload results to Codecov
uses: codecov/codecov-action@v4
with:
files: ./cover.out
token: ${{ secrets.CODECOV_TOKEN }}
validate-generated:
name: Validate generated files
runs-on: ubuntu-latest
steps:
- name: Checkout
uses: actions/checkout@v4
- name: Setup Go
uses: actions/setup-go@v5
with:
go-version: 1.22
- name: run code generators
run: make generate
- name: run manifest generators
run: make manifests
- name: ensure no files changed
run: git diff --exit-code || (echo "Generated files are out of sync. Please run 'make generate manifests' and commit the updated files."; exit 1)