-
Notifications
You must be signed in to change notification settings - Fork 5
57 lines (50 loc) · 1.69 KB
/
k8scompat.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
name: Kubernetes Version Compatibility Tests
on:
push:
pull_request:
branches:
- main
workflow_dispatch:
schedule:
- cron: 0 0 * * *
env:
setupEnvtestCmd: "go run sigs.k8s.io/controller-runtime/tools/setup-envtest@latest"
jobs:
buildMatrix:
name: Generate Matrix
runs-on: ubuntu-latest
outputs:
matrix: ${{ steps.build.outputs.matrix }}
steps:
- name: Set up Go
uses: actions/setup-go@v5
with:
go-version: '1.22'
- name: Generate test matrix using setup-envtest
id: build
run: |
echo "matrix=$($setupEnvtestCmd -p env list | awk '/)/ {print $2}' | awk -F'.' '{print $2}' | jq -c --slurp 'map(tostring) | unique')" >> $GITHUB_OUTPUT
test:
name: Kubernetes 1.${{ matrix.downstreamApiserverMinorVersion }}
needs: buildMatrix
runs-on: ubuntu-latest
env:
upstreamApiserverVersion: 1.28.x
strategy:
fail-fast: false
matrix:
downstreamApiserverMinorVersion: ${{ fromJson(needs.buildMatrix.outputs.matrix) }}
steps:
- uses: actions/checkout@v4
- name: Set up Go
uses: actions/setup-go@v5
with:
go-version: '1.22'
- name: Download kubebuilder assets
run: |
echo "UPSTREAM_KUBEBUILDER_ASSETS=$($setupEnvtestCmd use -p path ${{ env.upstreamApiserverVersion }})" >> $GITHUB_ENV
echo "DOWNSTREAM_KUBEBUILDER_ASSETS=$($setupEnvtestCmd use -p path 1.${{ matrix.downstreamApiserverMinorVersion }}.x)" >> $GITHUB_ENV
- name: Run tests
run: go test -v ./internal/controllers/reconciliation
env:
DOWNSTREAM_VERSION_MINOR: "${{ matrix.downstreamApiserverMinorVersion }}"