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