2222 - LICENSE
2323 - NOTICE
2424env :
25- KIND_VERSION : v0.17.0
26- KIND_IMAGE : kindest/node:v1.21.1@sha256:69860bda5563ac81e3c0057d654b5253219618a22ec3a346306239bba8cfa1a6
27- GO_VERSION : ' 1.22'
25+ KIND_VERSION : v0.24.0
26+ KIND_IMAGE : kindest/node:v1.31.2
2827permissions : {}
2928concurrency :
3029 group : ${{ github.workflow }}-${{ github.ref }}
@@ -39,18 +38,16 @@ jobs:
3938 - name : Setup Go
4039 uses : actions/setup-go@v5
4140 with :
42- go-version : ${{ env.GO_VERSION }}
41+ go-version-file : go.mod
4342 - name : Install tools
44- uses : aquaproj/aqua-installer@v3 .0.1
43+ uses : aquaproj/aqua-installer@v4 .0.0
4544 with :
4645 aqua_version : v1.25.0
4746 - name : Verify Go code
48- uses : golangci/golangci-lint-action@v6 .0.1
47+ uses : golangci/golangci-lint-action@v8 .0.0
4948 with :
5049 args : --verbose
51- version : v1.57.2
52- skip-pkg-cache : true
53- skip-build-cache : true
50+ version : v2.1
5451 - name : Verify YAML code
5552 uses : ibiqlik/action-yamllint@v3
5653 - name : Vendor Go modules
@@ -63,20 +60,31 @@ jobs:
6360 name : Run tests
6461 runs-on : ubuntu-latest
6562 steps :
63+ - name : Maximize build space
64+ uses : AdityaGarg8/remove-unwanted-software@v5
65+ with :
66+ remove-android : ' true'
67+ remove-dotnet : ' true'
68+ remove-haskell : ' true'
69+ remove-codeql : ' true'
70+ remove-docker-images : ' true'
71+ remove-large-packages : ' true'
72+ remove-cached-tools : ' true'
73+ remove-swapfile : ' true'
6674 - name : Checkout code
6775 uses : actions/checkout@v4
6876 - name : Setup Go
6977 uses : actions/setup-go@v5
7078 with :
71- go-version : ${{ env.GO_VERSION }}
79+ go-version-file : go.mod
7280 - name : Install tools
73- uses : aquaproj/aqua-installer@v3 .0.1
81+ uses : aquaproj/aqua-installer@v4 .0.0
7482 with :
7583 aqua_version : v1.25.0
7684 - name : Run unit tests
7785 run : mage test:unit
7886 - name : Upload code coverage
79- uses : codecov/codecov-action@v4
87+ uses : codecov/codecov-action@v5
8088 with :
8189 files : ./coverage.txt
8290 operator-envtest :
@@ -91,44 +99,49 @@ jobs:
9199 - name : Setup Go
92100 uses : actions/setup-go@v5
93101 with :
94- go-version : ${{ env.GO_VERSION }}
102+ go-version-file : go.mod
95103 - name : Install tools
96- uses : aquaproj/aqua-installer@v3 .0.1
104+ uses : aquaproj/aqua-installer@v4 .0.0
97105 with :
98106 aqua_version : v1.25.0
99107 - name : Run envtest
100108 run : mage test:envtest
101109 - name : Upload code coverage
102- uses : codecov/codecov-action@v4
110+ uses : codecov/codecov-action@v5
103111 with :
104112 files : ./coverage.txt
105113 itest-trivy-operator :
106114 name : Run integration tests
107115 needs :
108116 - operator-envtest
109117 runs-on : ubuntu-latest
110- timeout-minutes : 15
118+ timeout-minutes : 30
111119 steps :
112120 - name : Checkout code
113121 uses : actions/checkout@v4
122+
114123 - name : Setup Go
115124 uses : actions/setup-go@v5
116125 with :
117- go-version : ${{ env.GO_VERSION }}
126+ go-version-file : go.mod
127+
118128 - name : Install tools
119- uses : aquaproj/aqua-installer@v3 .0.1
129+ uses : aquaproj/aqua-installer@v4 .0.0
120130 with :
121131 aqua_version : v1.25.0
132+
122133 - name : Setup Kubernetes cluster (KIND)
123- uses : engineerd/setup-kind@v0.5.0
134+ uses : engineerd/setup-kind@v0.6.2
124135 with :
125136 version : ${{ env.KIND_VERSION }}
126137 image : ${{ env.KIND_IMAGE }}
138+
127139 - name : Test connection to Kubernetes cluster
128140 run : |
129141 kubectl cluster-info
130142 kubectl wait --for=condition=Ready nodes --all --timeout=300s
131143 kubectl describe node
144+
132145 - name : Run integration tests
133146 run : |
134147 kubectl create -k deploy/static
@@ -137,10 +150,12 @@ jobs:
137150 KUBECONFIG : /home/runner/.kube/config
138151 OPERATOR_NAMESPACE : trivy-system
139152 OPERATOR_TARGET_NAMESPACES : default
153+
140154 - name : Upload code coverage
141- uses : codecov/codecov-action@v4
155+ uses : codecov/codecov-action@v5
142156 with :
143157 files : ./itest/trivy-operator/coverage.txt
158+
144159 e2e-testing :
145160 name : Run end to end testing
146161 needs :
@@ -161,12 +176,12 @@ jobs:
161176 - name : Setup Go
162177 uses : actions/setup-go@v5
163178 with :
164- go-version : ${{ env.GO_VERSION }}
179+ go-version-file : go.mod
165180 - name : Release snapshot
166181 uses : goreleaser/goreleaser-action@v6
167182 with :
168- version : v1.7.0
169- args : release -f=goreleaser-e2e.yaml --snapshot --skip- publish --rm-dist
183+ version : v2.4.8
184+ args : release -f=goreleaser-e2e.yaml --snapshot --skip= publish --clean
170185 - name : Install kind and create cluster
171186 run : >
172187 curl -Lo ./kind https://kind.sigs.k8s.io/dl/${{ env.KIND_VERSION
@@ -188,10 +203,10 @@ jobs:
188203 kubectl describe node
189204 - name : Load operator image to cluster
190205 run : >
191- docker tag ghcr. io/aquasecurity /trivy-operator:${{ github.sha }}-amd64
192- ghcr. io/aquasecurity /trivy-operator:e2e
206+ docker tag mirror.gcr. io/aquasec /trivy-operator:${{ github.sha }}-amd64
207+ mirror.gcr. io/aquasec /trivy-operator:e2e
193208
194- docker save -o trivy-operator.tar ghcr. io/aquasecurity /trivy-operator:e2e
209+ docker save -o trivy-operator.tar mirror.gcr. io/aquasec /trivy-operator:e2e
195210
196211 kind load image-archive trivy-operator.tar
197212 - name : Init E2E tests (Install kuttl & helm)
@@ -265,6 +280,11 @@ jobs:
265280 run : >
266281 ./bin/kuttl test --start-kind=false --config tests/e2e/config/cluster-scan.yaml
267282
283+ - name : The job has failed - print the logs
284+ if : ${{ failure() }}
285+ run : >
286+ kubectl logs -n trivy-system deployment/trivy-operator
287+
268288 - name : Delete kind cluster
269289 run : |
270290 kind delete cluster
0 commit comments