Skip to content

Commit 2121f3b

Browse files
committed
Add workflow to validate UBI images pass RedHat Certification
1 parent cb31ea4 commit 2121f3b

File tree

2 files changed

+76
-0
lines changed

2 files changed

+76
-0
lines changed

.github/workflows/ci.yml

Lines changed: 15 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -409,6 +409,21 @@ jobs:
409409
id-token: write # for docker/login to login to NGINX registry
410410
secrets: inherit
411411

412+
openshift-certification:
413+
name: OpenShift Certification
414+
needs: [vars, build-oss, build-plus, build-operator]
415+
if: ${{ inputs.is_production_release && (inputs.dry_run == false || inputs.dry_run == null) }}
416+
uses: ./.github/workflows/openshift-certification.yml
417+
with:
418+
operator-version: ${{ inputs.operator_version || '' }}
419+
build-os: "ubi"
420+
dry_run: ${{ inputs.dry_run || false }}
421+
runner: ${{ github.repository_owner == 'nginx' && (inputs.is_production_release || (github.event_name == 'push' && github.ref == 'refs/heads/main')) && 'ubuntu-24.04-amd64' || 'ubuntu-24.04' }}
422+
permissions:
423+
contents: read
424+
packages: read
425+
secrets: inherit
426+
412427
functional-tests:
413428
name: Functional tests
414429
needs: [vars, build-oss, build-plus]
Lines changed: 61 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,61 @@
1+
name: OpenShift Certification
2+
3+
on:
4+
workflow_call:
5+
inputs:
6+
build-os:
7+
required: true
8+
type: string
9+
default: 'ubi'
10+
dry_run:
11+
required: false
12+
type: boolean
13+
default: false
14+
runner:
15+
required: false
16+
type: string
17+
default: 'ubuntu-24.04'
18+
19+
jobs:
20+
preflight:
21+
runs-on: ${{ inputs.runner }}
22+
steps:
23+
- name: Checkout repository
24+
uses: actions/checkout@v4
25+
26+
- name: Download preflight binary
27+
run: |
28+
curl -LO https://github.com/redhat-openshift-ecosystem/openshift-preflight/releases/latest/download/preflight-linux-amd64
29+
chmod +x preflight-linux-amd64
30+
sudo mv preflight-linux-amd64 /usr/local/bin/preflight
31+
32+
- name: Run preflight for NGINX Gateway Fabric
33+
env:
34+
PYXIS_API_TOKEN: ${{ secrets.PYXIS_API_TOKEN }}
35+
run: preflight check container ghcr.io/nginx/nginx-gateway-fabric:edge-ubi --json > ngf-preflight-result.json
36+
37+
- name: Run preflight for NGINX OSS
38+
env:
39+
PYXIS_API_TOKEN: ${{ secrets.PYXIS_API_TOKEN }}
40+
run: preflight check container ghcr.io/nginx/nginx-gateway-fabric/nginx:edge-ubi --json > ngf-oss-preflight-result.json
41+
42+
- name: Run preflight for NGINX Gateway Fabric Operator
43+
env:
44+
PYXIS_API_TOKEN: ${{ secrets.PYXIS_API_TOKEN }}
45+
run: preflight check operator ghcr.io/nginx/nginx-gateway-fabric/operator:edge --json > ngf-operator-preflight-result.json
46+
47+
- name: Aggregate preflight results and fail if any checks failed
48+
run: |
49+
total_failed=0
50+
for result in ngf-preflight-result.json ngf-oss-preflight-result.json ngf-operator-preflight-result.json; do
51+
failed_count=$(jq '.results.failed | length' "$result")
52+
total_failed=$((total_failed + failed_count))
53+
done
54+
if [ "$total_failed" -ne 0 ]; then
55+
echo "Preflight checks failed: $total_failed failed checks across all images"
56+
for result in ngf-preflight-result.json ngf-oss-preflight-result.json ngf-operator-preflight-result.json; do
57+
echo "Results for $result:"
58+
jq '.results.failed' "$result"
59+
done
60+
exit 1
61+
fi

0 commit comments

Comments
 (0)