6565 echo "::error::CodeQL produced ${count} alerts (warning/error)."
6666 exit 1
6767 fi
68+
6869 scan-intermediate-image :
6970 runs-on : ubuntu-latest
7071 steps :
7475 continue-on-error : true
7576 with :
7677 cache-db : true
77- image : " alpine:3 .22.2 " # sync this with Containerfile
78+ image : " golang:1.25.3-alpine3 .22" # sync this with Containerfile
7879 output-file : grype.sarif
7980 severity-cutoff : high
8081 - name : Upload SARIF file
8788 jq '.runs[0].results | map(select(.level == "error"))' grype.sarif
8889 exit 1
8990
90- build -go :
91- needs : [ scan-dependencies, scan-codeql, scan-intermediate-image ]
91+ test -go :
92+ needs : [ scan-dependencies ]
9293 runs-on : ubuntu-latest
93- strategy :
94- matrix :
95- arch : ${{ fromJson(inputs.architectures) }}
9694 steps :
9795 - name : Check out code
9896 uses : actions/checkout@08c6903cd8c0fde910a37f88322edcfb5dd907a8 # v5.0.0
@@ -114,34 +112,8 @@ jobs:
114112 with :
115113 config : ./.testcoverage.yml
116114
117- - name : Build
118- run : |-
119- mkdir -p $GITHUB_WORKSPACE/dist
120-
121- CGO_ENABLED=0 \
122- GOARCH=${{ matrix.arch }} \
123- GOOS=linux \
124- go build \
125- -ldflags '\
126- -s -w \
127- -buildid=${{ github.sha }} \
128- -X main.version=${{ github.ref_name }} \
129- -X main.commit=${{ github.sha }} \
130- ' \
131- -trimpath -mod=readonly \
132- -o $GITHUB_WORKSPACE/dist/multigres-operator-${{ matrix.arch }} \
133- ./cmd/multigres-operator
134-
135- - name : Upload artifacts
136- uses : actions/upload-artifact@ea165f8d65b6e75b540449e92b4886f43607fa02 # v4.6.2
137- with :
138- name : multigres-operator-${{matrix.arch}}
139- path : dist/*
140- if-no-files-found : error
141- retention-days : 7
142-
143115 build-scan-push-container :
144- needs : [ build -go ]
116+ needs : [ test -go ]
145117 runs-on : ubuntu-latest
146118 steps :
147119 - name : Check out code
@@ -163,11 +135,6 @@ jobs:
163135 - name : Setup Docker buildx
164136 uses : docker/setup-buildx-action@e468171a9de216ec08956ac3ada2f0791b6bd435 # v3.11.1
165137
166- - uses : actions/download-artifact@634f93cb2916e3fdff6788551b99b062d0335ce0 # v5.0.0
167- with :
168- pattern : multigres-operator-*
169- path : dist/
170-
171138 - name : Log into registry
172139 uses : docker/login-action@5e57cd118135c172c3672efd75eb46360885c0ef # v3.6.0
173140 with :
@@ -179,7 +146,7 @@ jobs:
179146 uses : docker/build-push-action@263435318d21b8e681c14492fe198d362a7d2c83 # v6.18.0
180147 with :
181148 context : .
182- file : Containerfile
149+ file : Dockerfile
183150 platforms : linux/${{ join(fromJson(inputs.architectures), ',linux/') }}
184151 load : true
185152 push : false
@@ -227,18 +194,3 @@ jobs:
227194 docker tag "$IMAGE:${{ github.sha }}" "$IMAGE:${{ github.ref_name }}"
228195 docker push "$IMAGE:${{ github.ref_name }}"
229196 fi
230-
231- create-release :
232- needs : [ build-scan-push-container ]
233- runs-on : ubuntu-latest
234- if : ${{ inputs.create-release }}
235- steps :
236- - uses : actions/download-artifact@634f93cb2916e3fdff6788551b99b062d0335ce0 # v5.0.0
237- with :
238- pattern : " *"
239- path : dist/
240-
241- - name : Release
242- uses : softprops/action-gh-release@aec2ec56f94eb8180ceec724245f64ef008b89f5 # v2.4.0
243- with :
244- files : dist/**
0 commit comments