-
Notifications
You must be signed in to change notification settings - Fork 15
84 lines (77 loc) · 2.11 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
75
76
77
78
79
80
81
82
83
84
name: Continuous Integration
on:
push:
branches:
- main
pull_request:
branches:
- main
paths:
- ".github/workflows/build-and-push.yaml"
- ".github/workflows/ci.yaml"
- "**.go"
- "go.mod"
- "go.sum"
- "Dockerfile"
permissions:
packages: write
id-token: write # Required for Codecov
env:
GO_VERSION: 1.23
jobs:
unit-tests:
name: Unit Tests
runs-on: ubuntu-latest
steps:
- name: Checkout
uses: actions/checkout@v4
- name: Cache envtest binaries
uses: actions/cache@1bd1e32a3bdc45362d1e726936510720a7c30a57 # v4
with:
path: ./bin/
key: binaries
- name: Setup Golang
uses: actions/setup-go@3041bf56c941b39c61721a86cd11f3bb1338122a # v5
with:
go-version: "${{ env.GO_VERSION }}"
- name: Install envtest
run: make envtest
- name: Setup envtest
run: ./bin/setup-envtest use
- name: Run tests
run: make test
- name: Upload coverage reports to Codecov
uses: codecov/codecov-action@1e68e06f1dbfde0e4cefc87efeba9e4643565303 # v5
with:
use_oidc: true
check-codegen:
name: Check Codegen
runs-on: ubuntu-latest
steps:
- name: Checkout
uses: actions/checkout@v4
- name: Setup Golang
uses: actions/setup-go@3041bf56c941b39c61721a86cd11f3bb1338122a # v5
with:
go-version: "${{ env.GO_VERSION }}"
- name: Generate manifests
run: make manifests
- name: Check nothing has changed
run: |
git diff --exit-code ./manifests
lint-go:
name: Lint Go
runs-on: ubuntu-latest
steps:
- uses: actions/checkout@v4
- uses: actions/setup-go@3041bf56c941b39c61721a86cd11f3bb1338122a # v5
with:
go-version: "${{ env.GO_VERSION }}"
cache: false
- name: golangci-lint
uses: golangci/golangci-lint-action@971e284b6050e8a5849b72094c50ab08da042db8 # v6
with:
version: v1.63
args: --timeout=5m
build-and-push:
uses: ./.github/workflows/build-and-push.yaml