Skip to content
Draft
Show file tree
Hide file tree
Changes from 1 commit
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
15 changes: 15 additions & 0 deletions .github/workflows/ci.yml
Original file line number Diff line number Diff line change
Expand Up @@ -409,6 +409,21 @@
id-token: write # for docker/login to login to NGINX registry
secrets: inherit

openshift-certification:
name: OpenShift Certification
needs: [vars, build-oss, build-plus, build-operator]
if: ${{ inputs.is_production_release && (inputs.dry_run == false || inputs.dry_run == null) }}
uses: ./.github/workflows/openshift-certification.yml
with:
operator-version: ${{ inputs.operator_version || '' }}

Check failure on line 418 in .github/workflows/ci.yml

View workflow job for this annotation

GitHub Actions / Actionlint

[actionlint] reported by reviewdog 🐶 input "operator-version" is not defined in "./.github/workflows/openshift-certification.yml" reusable workflow. defined inputs are "build-os", "dry_run", "runner" [workflow-call] Raw Output: e:.github/workflows/ci.yml:418:7: input "operator-version" is not defined in "./.github/workflows/openshift-certification.yml" reusable workflow. defined inputs are "build-os", "dry_run", "runner" [workflow-call]
build-os: "ubi"
dry_run: ${{ inputs.dry_run || false }}
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' }}
permissions:
contents: read
packages: read
secrets: inherit

functional-tests:
name: Functional tests
needs: [vars, build-oss, build-plus]
Expand Down
61 changes: 61 additions & 0 deletions .github/workflows/openshift-certification.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,61 @@
name: OpenShift Certification

on:
workflow_call:
inputs:
build-os:
required: true
type: string
default: 'ubi'

Check failure on line 9 in .github/workflows/openshift-certification.yml

View workflow job for this annotation

GitHub Actions / Actionlint

[actionlint] reported by reviewdog 🐶 input "build-os" of workflow_call event has the default value "ubi", but it is also required. if an input is marked as required, its default value will never be used [events] Raw Output: e:.github/workflows/openshift-certification.yml:9:18: input "build-os" of workflow_call event has the default value "ubi", but it is also required. if an input is marked as required, its default value will never be used [events]
dry_run:
required: false
type: boolean
default: false
runner:
required: false
type: string
default: 'ubuntu-24.04'

jobs:
preflight:
runs-on: ${{ inputs.runner }}
steps:
- name: Checkout repository
uses: actions/checkout@v4

- name: Download preflight binary
run: |
curl -LO https://github.com/redhat-openshift-ecosystem/openshift-preflight/releases/latest/download/preflight-linux-amd64
chmod +x preflight-linux-amd64
sudo mv preflight-linux-amd64 /usr/local/bin/preflight
- name: Run preflight for NGINX Gateway Fabric
env:
PYXIS_API_TOKEN: ${{ secrets.PYXIS_API_TOKEN }}
run: preflight check container ghcr.io/nginx/nginx-gateway-fabric:edge-ubi --json > ngf-preflight-result.json

- name: Run preflight for NGINX OSS
env:
PYXIS_API_TOKEN: ${{ secrets.PYXIS_API_TOKEN }}
run: preflight check container ghcr.io/nginx/nginx-gateway-fabric/nginx:edge-ubi --json > ngf-oss-preflight-result.json

- name: Run preflight for NGINX Gateway Fabric Operator
env:
PYXIS_API_TOKEN: ${{ secrets.PYXIS_API_TOKEN }}
run: preflight check operator ghcr.io/nginx/nginx-gateway-fabric/operator:edge --json > ngf-operator-preflight-result.json

- name: Aggregate preflight results and fail if any checks failed
run: |
total_failed=0
for result in ngf-preflight-result.json ngf-oss-preflight-result.json ngf-operator-preflight-result.json; do
failed_count=$(jq '.results.failed | length' "$result")

Check failure on line 51 in .github/workflows/openshift-certification.yml

View workflow job for this annotation

GitHub Actions / YAML lint

[yamllint] reported by reviewdog 🐶 [error] wrong indentation: expected 10but found 12 (indentation) Raw Output: ./.github/workflows/openshift-certification.yml:51:13: [error] wrong indentation: expected 10but found 12 (indentation)
total_failed=$((total_failed + failed_count))

Check failure on line 52 in .github/workflows/openshift-certification.yml

View workflow job for this annotation

GitHub Actions / YAML lint

[yamllint] reported by reviewdog 🐶 [error] wrong indentation: expected 10but found 12 (indentation) Raw Output: ./.github/workflows/openshift-certification.yml:52:13: [error] wrong indentation: expected 10but found 12 (indentation)
done
if [ "$total_failed" -ne 0 ]; then
echo "Preflight checks failed: $total_failed failed checks across all images"

Check failure on line 55 in .github/workflows/openshift-certification.yml

View workflow job for this annotation

GitHub Actions / YAML lint

[yamllint] reported by reviewdog 🐶 [error] wrong indentation: expected 10but found 12 (indentation) Raw Output: ./.github/workflows/openshift-certification.yml:55:13: [error] wrong indentation: expected 10but found 12 (indentation)
for result in ngf-preflight-result.json ngf-oss-preflight-result.json ngf-operator-preflight-result.json; do

Check failure on line 56 in .github/workflows/openshift-certification.yml

View workflow job for this annotation

GitHub Actions / YAML lint

[yamllint] reported by reviewdog 🐶 [error] wrong indentation: expected 10but found 12 (indentation) Raw Output: ./.github/workflows/openshift-certification.yml:56:13: [error] wrong indentation: expected 10but found 12 (indentation)
echo "Results for $result:"

Check failure on line 57 in .github/workflows/openshift-certification.yml

View workflow job for this annotation

GitHub Actions / YAML lint

[yamllint] reported by reviewdog 🐶 [error] wrong indentation: expected 10but found 14 (indentation) Raw Output: ./.github/workflows/openshift-certification.yml:57:15: [error] wrong indentation: expected 10but found 14 (indentation)
jq '.results.failed' "$result"

Check failure on line 58 in .github/workflows/openshift-certification.yml

View workflow job for this annotation

GitHub Actions / YAML lint

[yamllint] reported by reviewdog 🐶 [error] wrong indentation: expected 10but found 14 (indentation) Raw Output: ./.github/workflows/openshift-certification.yml:58:15: [error] wrong indentation: expected 10but found 14 (indentation)
done

Check failure on line 59 in .github/workflows/openshift-certification.yml

View workflow job for this annotation

GitHub Actions / YAML lint

[yamllint] reported by reviewdog 🐶 [error] wrong indentation: expected 10but found 12 (indentation) Raw Output: ./.github/workflows/openshift-certification.yml:59:13: [error] wrong indentation: expected 10but found 12 (indentation)
exit 1

Check failure on line 60 in .github/workflows/openshift-certification.yml

View workflow job for this annotation

GitHub Actions / YAML lint

[yamllint] reported by reviewdog 🐶 [error] wrong indentation: expected 10but found 12 (indentation) Raw Output: ./.github/workflows/openshift-certification.yml:60:13: [error] wrong indentation: expected 10but found 12 (indentation)
fi

Check failure on line 61 in .github/workflows/openshift-certification.yml

View workflow job for this annotation

GitHub Actions / YAML lint

[yamllint] reported by reviewdog 🐶 [error] no new line character at the end of file (new-line-at-end-of-file) Raw Output: ./.github/workflows/openshift-certification.yml:61:13: [error] no new line character at the end of file (new-line-at-end-of-file)