-
Notifications
You must be signed in to change notification settings - Fork 102
131 lines (101 loc) · 3.38 KB
/
test.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
name: Test
on:
push:
branches: [main]
pull_request:
jobs:
test:
runs-on: ubuntu-latest
steps:
- uses: actions/checkout@v4
- uses: actions/setup-go@v5
with:
go-version-file: go.mod
- name: Run tests
run: go test -v -race -coverprofile=coverage.txt ./...
- name: Upload coverage reports to Codecov
uses: codecov/codecov-action@v3
test-kubernetes:
name: e2e k3s ${{ matrix.k3s }}
runs-on: ubuntu-latest
permissions:
id-token: write
concurrency: ${{ github.workflow }}-${{ github.ref }}-${{ matrix.k3s }}
strategy:
# The e2e tests are flaky and often one of the jobs fails. The default setting
# causes all other currently running jobs to abort and all need to be restarted.
fail-fast: false
matrix:
include:
- k3s: v1.26
k8s-test: v1.26.12
- k3s: v1.27
k8s-test: v1.27.9
- k3s: v1.28
k8s-test: v1.28.5
- k3s: v1.29
k8s-test: v1.29.0
steps:
- uses: actions/checkout@v4
- uses: actions/setup-go@v5
with:
go-version-file: go.mod
- uses: hetznercloud/tps-action@main
- uses: hetznercloud/setup-hcloud@v1
- uses: yokawasa/[email protected]
with:
setup-tools: |
helm
kubectl
skaffold
helm: v3.11.2
kubectl: v1.29.0
skaffold: v2.3.0
- name: Run tests
env:
K3S_CHANNEL: ${{ matrix.k3s }}
K8S_TEST_VERSION: ${{ matrix.k8s-test }}
SCOPE: gha-${{ github.run_id }}-${{ github.run_attempt }}-${{ matrix.k3s }}
run: |
curl -sLS https://get.k3sup.dev | sh
trap "hack/dev-down.sh" EXIT
source <(hack/dev-up.sh)
skaffold build --tag="e2e-${GITHUB_RUN_ID}-${GITHUB_RUN_NUMBER}"
tag=$(skaffold build --tag="e2e-${GITHUB_RUN_ID}-${GITHUB_RUN_NUMBER}" --quiet --output="{{ (index .Builds 0).Tag }}")
skaffold deploy --images=docker.io/hetznercloud/hcloud-csi-driver=$tag
test/e2e/kubernetes/run-e2e-tests.sh
deploy-manifests:
runs-on: ubuntu-latest
steps:
- uses: yokawasa/[email protected]
with:
setup-tools: |
helm
helm: v3.11.2
- uses: actions/checkout@v4
- name: Generate manifests from helm chart
run: hack/update-deployment-yamls.sh
- name: Check for diff
run: git diff --exit-code -- deploy/
- name: Show warning
if: ${{ failure() }}
run: echo "::error title=Deployment Manifests outdated::Please run hack/update-deployment-yamls.sh and commit the changes to deploy/"
helm-chart:
runs-on: ubuntu-latest
steps:
- uses: yokawasa/[email protected]
with:
setup-tools: |
helm
helm: v3.11.2
- uses: actions/checkout@v4
# This step also verifies that the chart builds
- name: Verify Snapshots
run: |
hack/update-helm-snapshots.sh
git diff --exit-code -- deploy/
- name: Show warning
if: ${{ failure() }}
run: echo "::error title=Helm Snapshots outdated::Please run hack/update-helm-snapshots.sh and commit the changes to chart/.snapshots/"
- name: Helm Lint
run: helm lint chart/