Skip to content

Commit 2d5a543

Browse files
fix(ci): fix behavioral regressions in workflow refactor
- Restore bundle CSV update and commit-SHA-tagged bundle image - Derive OPERATOR_IMAGE_BASE from GITHUB_REPOSITORY_OWNER - Decouple coverage from blocking image builds - Remove duplicate pull_request trigger from code-scanning Signed-off-by: Carlos Eduardo Arango Gutierrez <eduardoa@nvidia.com>
1 parent ae823e9 commit 2d5a543

6 files changed

Lines changed: 74 additions & 45 deletions

File tree

.github/workflows/ci.yaml

Lines changed: 4 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -41,6 +41,10 @@ jobs:
4141
golang-checks:
4242
uses: ./.github/workflows/golang-checks.yaml
4343

44+
coverage:
45+
needs: [golang-checks]
46+
uses: ./.github/workflows/coverage.yaml
47+
4448
image-builds:
4549
needs: [variables, config-checks, golang-checks]
4650
uses: ./.github/workflows/image-builds.yaml

.github/workflows/code-scanning.yaml

Lines changed: 0 additions & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -16,13 +16,6 @@ name: "CodeQL"
1616

1717
on:
1818
workflow_call: {}
19-
pull_request:
20-
types:
21-
- opened
22-
- synchronize
23-
branches:
24-
- main
25-
- release-*
2619

2720
jobs:
2821
analyze:

.github/workflows/coverage.yaml

Lines changed: 53 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,53 @@
1+
# Copyright NVIDIA CORPORATION
2+
#
3+
# Licensed under the Apache License, Version 2.0 (the "License");
4+
# you may not use this file except in compliance with the License.
5+
# You may obtain a copy of the License at
6+
#
7+
# http://www.apache.org/licenses/LICENSE-2.0
8+
#
9+
# Unless required by applicable law or agreed to in writing, software
10+
# distributed under the License is distributed on an "AS IS" BASIS,
11+
# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
12+
# See the License for the specific language governing permissions and
13+
# limitations under the License.
14+
15+
name: Coverage
16+
17+
on:
18+
workflow_call:
19+
20+
permissions: {}
21+
22+
jobs:
23+
coverage:
24+
runs-on: linux-amd64-cpu4
25+
timeout-minutes: 30
26+
permissions:
27+
contents: read
28+
id-token: write
29+
steps:
30+
- name: Checkout code
31+
uses: actions/checkout@v6
32+
- name: Get Golang version
33+
id: vars
34+
run: |
35+
GOLANG_VERSION=$( grep "GOLANG_VERSION ?=" versions.mk )
36+
echo "GOLANG_VERSION=${GOLANG_VERSION##GOLANG_VERSION ?= }" >> $GITHUB_ENV
37+
- name: Set up Go
38+
uses: actions/setup-go@v6
39+
with:
40+
go-version: ${{ env.GOLANG_VERSION }}
41+
- name: Setup Go Proxy
42+
id: setup-go-proxy
43+
uses: nv-gha-runners/setup-artifactory-go-proxy@main
44+
- name: Generate coverage report
45+
env:
46+
GOPROXY: ${{ steps.setup-go-proxy.outputs.goproxy-url }}
47+
run: |
48+
make cov-report
49+
- name: Upload to Coveralls
50+
uses: coverallsapp/github-action@v2
51+
with:
52+
github-token: ${{ secrets.GITHUB_TOKEN }}
53+
path-to-lcov: lcov.info

.github/workflows/golang-checks.yaml

Lines changed: 0 additions & 32 deletions
Original file line numberDiff line numberDiff line change
@@ -87,35 +87,3 @@ jobs:
8787
- uses: actions/checkout@v6
8888
name: Checkout code
8989
- run: make docker-build
90-
91-
coverage:
92-
needs: [go-test]
93-
runs-on: linux-amd64-cpu4
94-
permissions:
95-
contents: read
96-
id-token: write
97-
steps:
98-
- name: Checkout code
99-
uses: actions/checkout@v6
100-
- name: Get Golang version
101-
id: vars
102-
run: |
103-
GOLANG_VERSION=$( grep "GOLANG_VERSION ?=" versions.mk )
104-
echo "GOLANG_VERSION=${GOLANG_VERSION##GOLANG_VERSION ?= }" >> $GITHUB_ENV
105-
- name: Set up Go
106-
uses: actions/setup-go@v6
107-
with:
108-
go-version: ${{ env.GOLANG_VERSION }}
109-
- name: Setup Go Proxy
110-
id: setup-go-proxy
111-
uses: nv-gha-runners/setup-artifactory-go-proxy@main
112-
- name: Generate coverage report
113-
env:
114-
GOPROXY: ${{ steps.setup-go-proxy.outputs.goproxy-url }}
115-
run: |
116-
make cov-report
117-
- name: Upload to Coveralls
118-
uses: coverallsapp/github-action@v2
119-
with:
120-
github-token: ${{ secrets.GITHUB_TOKEN }}
121-
path-to-lcov: lcov.info

.github/workflows/release.yaml

Lines changed: 15 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -34,7 +34,6 @@ jobs:
3434
operator_image_base: ${{ steps.vars.outputs.operator_image_base }}
3535
operator_image_source: ${{ steps.vars.outputs.operator_image_source }}
3636
operator_image_latest: ${{ steps.vars.outputs.operator_image_latest }}
37-
bundle_image: ${{ steps.vars.outputs.bundle_image }}
3837
steps:
3938
- name: Calculate release variables
4039
id: vars
@@ -48,14 +47,12 @@ jobs:
4847
# Calculate derived values
4948
OPERATOR_IMAGE_SOURCE="${OPERATOR_IMAGE_BASE}:${COMMIT_SHORT_SHA}"
5049
OPERATOR_IMAGE_LATEST="${OPERATOR_IMAGE_BASE}:main-latest"
51-
BUNDLE_IMAGE="ghcr.io/nvidia/gpu-operator/gpu-operator-bundle:main-latest"
5250
5351
# Output all variables
5452
echo "commit_short_sha=${COMMIT_SHORT_SHA}" >> $GITHUB_OUTPUT
5553
echo "operator_image_base=${OPERATOR_IMAGE_BASE}" >> $GITHUB_OUTPUT
5654
echo "operator_image_source=${OPERATOR_IMAGE_SOURCE}" >> $GITHUB_OUTPUT
5755
echo "operator_image_latest=${OPERATOR_IMAGE_LATEST}" >> $GITHUB_OUTPUT
58-
echo "bundle_image=${BUNDLE_IMAGE}" >> $GITHUB_OUTPUT
5956
6057
# Display for debugging
6158
echo "::notice::Releasing: ${OPERATOR_IMAGE_SOURCE} → ${OPERATOR_IMAGE_LATEST}"
@@ -85,6 +82,10 @@ jobs:
8582
push-gpu-operator-bundle-image:
8683
needs: [variables, release-latest-gpu-operator-image]
8784
runs-on: linux-amd64-cpu4
85+
timeout-minutes: 30
86+
permissions:
87+
contents: read
88+
packages: write
8889
steps:
8990
- uses: actions/checkout@v6
9091
name: Check out code
@@ -94,12 +95,21 @@ jobs:
9495
registry: ghcr.io
9596
username: ${{ github.actor }}
9697
password: ${{ secrets.GITHUB_TOKEN }}
98+
- name: Update bundle CSV
99+
env:
100+
COMMIT_SHORT_SHA: ${{ needs.variables.outputs.commit_short_sha }}
101+
OPERATOR_IMAGE_BASE: ${{ needs.variables.outputs.operator_image_base }}
102+
run: |
103+
sed -i -e "s|${OPERATOR_IMAGE_BASE}:[^ \"]*|${OPERATOR_IMAGE_BASE}:${COMMIT_SHORT_SHA}|g" bundle/manifests/gpu-operator-certified.clusterserviceversion.yaml
104+
echo "Bundle CSV updated successfully"
97105
- name: Build bundle-image
98106
env:
99-
BUNDLE_IMAGE: ${{ needs.variables.outputs.bundle_image }}
107+
COMMIT_SHORT_SHA: ${{ needs.variables.outputs.commit_short_sha }}
100108
VERSION: ""
101109
DEFAULT_CHANNEL: "stable"
102110
CHANNELS: "stable"
103111
run: |
104-
make push-bundle-image
112+
BUNDLE_IMAGE_BASE="ghcr.io/nvidia/gpu-operator/gpu-operator-bundle"
113+
make push-bundle-image BUNDLE_IMAGE=${BUNDLE_IMAGE_BASE}:${{ github.ref_name }}-latest
114+
make push-bundle-image BUNDLE_IMAGE=${BUNDLE_IMAGE_BASE}:${COMMIT_SHORT_SHA}
105115

.github/workflows/variables.yaml

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -96,7 +96,8 @@ jobs:
9696
fi
9797
9898
# Image and version information (with override support)
99-
OPERATOR_IMAGE_BASE="ghcr.io/nvidia/gpu-operator"
99+
LOWERCASE_REPO_OWNER=$(echo "${GITHUB_REPOSITORY_OWNER}" | awk '{print tolower($0)}')
100+
OPERATOR_IMAGE_BASE="ghcr.io/${LOWERCASE_REPO_OWNER}/gpu-operator"
100101
if [[ -n "${INPUT_OPERATOR_VERSION}" ]]; then
101102
OPERATOR_VERSION="${INPUT_OPERATOR_VERSION}"
102103
else

0 commit comments

Comments
 (0)