-
Notifications
You must be signed in to change notification settings - Fork 0
136 lines (114 loc) · 3.37 KB
/
Copy pathci.yaml
File metadata and controls
136 lines (114 loc) · 3.37 KB
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
name: CI
on:
push:
branches:
- main
pull_request:
jobs:
build:
name: Build
runs-on: ubuntu-latest
steps:
- name: Checkout
uses: actions/checkout@v6
- name: Setup Go
uses: actions/setup-go@v6
with:
go-version-file: go.mod
- name: Build
run: go build ./...
- name: Vet
run: go vet ./...
verify-manifests:
name: Verify Generated Manifests
runs-on: ubuntu-latest
steps:
- name: Checkout
uses: actions/checkout@v6
- name: Setup Go
uses: actions/setup-go@v6
with:
go-version-file: go.mod
- name: Generate manifests
run: make manifests generate
- name: Check for uncommitted changes
run: |
if ! git diff --exit-code; then
echo "::error::Generated files are out of date. Run 'make manifests generate' and commit the result."
exit 1
fi
lint:
name: Lint
runs-on: ubuntu-latest
steps:
- name: Checkout
uses: actions/checkout@v6
- name: Setup Go
uses: actions/setup-go@v6
with:
go-version-file: go.mod
- name: Run linter
uses: golangci/golangci-lint-action@v9
with:
version: v2.10.1
test:
name: Unit Tests
runs-on: ubuntu-latest
steps:
- name: Checkout
uses: actions/checkout@v6
- name: Setup Go
uses: actions/setup-go@v6
with:
go-version-file: go.mod
- name: Run tests
run: make test
e2e:
name: E2E (K8s ${{ matrix.kube-version.tag }})
runs-on: ubuntu-latest
strategy:
fail-fast: false
matrix:
kube-version:
- tag: v1.31.14
kind-image: kindest/node:v1.31.14@sha256:6f86cf509dbb42767b6e79debc3f2c32e4ee01386f0489b3b2be24b0a55aac2b
- tag: v1.32.11
kind-image: kindest/node:v1.32.11@sha256:5fc52d52a7b9574015299724bd68f183702956aa4a2116ae75a63cb574b35af8
- tag: v1.33.7
kind-image: kindest/node:v1.33.7@sha256:d26ef333bdb2cbe9862a0f7c3803ecc7b4303d8cea8e814b481b09949d353040
- tag: v1.34.3
kind-image: kindest/node:v1.34.3@sha256:08497ee19eace7b4b5348db5c6a1591d7752b164530a36f855cb0f2bdcbadd48
- tag: v1.35.0
kind-image: kindest/node:v1.35.0@sha256:452d707d4862f52530247495d180205e029056831160e22870e37e3f6c1ac31f
steps:
- name: Checkout
uses: actions/checkout@v6
- name: Setup Go
uses: actions/setup-go@v6
with:
go-version-file: go.mod
- name: Create Kind cluster
uses: helm/kind-action@v1
with:
node_image: ${{ matrix.kube-version.kind-image }}
cluster_name: peerdb-operator-e2e
- name: Verify cluster
run: |
kubectl cluster-info
kubectl version
- name: Run e2e tests
run: make test-e2e KIND_CLUSTER=peerdb-operator-e2e
env:
KIND: kind
- name: Export cluster logs
if: failure()
run: |
mkdir -p /tmp/e2e-logs
kind export logs /tmp/e2e-logs --name peerdb-operator-e2e
- name: Upload cluster logs
if: failure()
uses: actions/upload-artifact@v7
with:
name: e2e-logs-${{ matrix.kube-version.tag }}
path: /tmp/e2e-logs
retention-days: 7