-
Notifications
You must be signed in to change notification settings - Fork 0
132 lines (110 loc) · 3.65 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
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
name: Continuous integration
on:
pull_request:
branches:
- main
jobs:
changes:
name: Check changes
runs-on: ubuntu-latest
outputs:
go: ${{ steps.changes.outputs.go }}
manifests: ${{ steps.changes.outputs.manifests }}
renovate: ${{ steps.changes.outputs.renovate }}
steps:
- name: Checkout
uses: actions/checkout@11bd71901bbe5b1630ceea73d27597364c9af683 # v4.2.2
- name: Check changes
id: changes
uses: dorny/paths-filter@de90cc6fb38fc0963ad72b210f1f284cd68cea36 # v3.0.2
with:
filters: |
go:
- go.mod
- go.sum
- '**/*.go'
manifests:
- 'install/base/**/*.yaml'
renovate:
- .github/renovate.json
golangci-lint:
name: golangci-lint
runs-on: ubuntu-latest
needs: changes
if: needs.changes.outputs.go == 'true'
steps:
- name: Checkout
uses: actions/checkout@11bd71901bbe5b1630ceea73d27597364c9af683 # v4.2.2
- name: Setup go
uses: actions/setup-go@41dfa10bad2bb2ae585af6ee5bb4d7d973ad74ed # v5.1.0
with:
go-version: '1.23.2'
- name: Run golangci-lint
uses: golangci/golangci-lint-action@971e284b6050e8a5849b72094c50ab08da042db8 # v6.1.1
go-test:
name: Go test
runs-on: ubuntu-latest
needs: changes
if: needs.changes.outputs.go == 'true'
steps:
- name: Checkout
uses: actions/checkout@11bd71901bbe5b1630ceea73d27597364c9af683 # v4.2.2
- name: Setup go
uses: actions/setup-go@41dfa10bad2bb2ae585af6ee5bb4d7d973ad74ed # v5.1.0
with:
go-version: '1.23.2'
- name: Run tests
run: make test
go-build:
name: Go build
runs-on: ubuntu-latest
needs: changes
if: needs.changes.outputs.go == 'true'
steps:
- name: Checkout
uses: actions/checkout@11bd71901bbe5b1630ceea73d27597364c9af683 # v4.2.2
- name: Setup go
uses: actions/setup-go@41dfa10bad2bb2ae585af6ee5bb4d7d973ad74ed # v5.1.0
with:
go-version: '1.23.2'
- name: Build
run: make build
deploy-to-kind:
name: Deploy to kind cluster
runs-on: ubuntu-latest
needs: changes
if: ${{ needs.changes.outputs.go == 'true' || needs.changes.outputs.manifests == 'true' }}
steps:
- name: Checkout
uses: actions/checkout@11bd71901bbe5b1630ceea73d27597364c9af683 # v4.2.2
- name: Setup go
uses: actions/setup-go@41dfa10bad2bb2ae585af6ee5bb4d7d973ad74ed # v5.1.0
with:
go-version: '1.23.2'
- name: Setup buildx
uses: docker/setup-buildx-action@c47758b77c9736f4b2ef4073d4d51994fabfe349 # v3.7.1
- name: Install kind
run: make install-kind
- name: Install kubectl
run: make install-kubectl
- name: Create kind cluster
run: make create-kind-cluster
- name: Build container
run: make build-container
- name: Deploy to kind cluster
run: make deploy-to-kind-cluster
renovate-validate:
name: Validate Renovate config
runs-on: ubuntu-latest
needs: changes
if: needs.changes.outputs.renovate == 'true'
steps:
- name: Checkout
uses: actions/checkout@11bd71901bbe5b1630ceea73d27597364c9af683 # v4.2.2
- name: Validate config
env:
RENOVATE_VERSION: 39.7.4@sha256:39812afb2d242da1aec2cc130b7a86a717dabeca40d5e74e57e632b3f429e4fa
run: >
docker run --rm -v ./.github/renovate.json:/renovate.json
--entrypoint renovate-config-validator
ghcr.io/renovatebot/renovate:${RENOVATE_VERSION} /renovate.json