Skip to content

Commit 8d05101

Browse files
committed
chore: add policy CI job back
Signed-off-by: Matt Kornfield <mkornfield@nvidia.com>
1 parent 58f7480 commit 8d05101

1 file changed

Lines changed: 73 additions & 0 deletions

File tree

.github/workflows/ci.yaml

Lines changed: 73 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -648,6 +648,78 @@ jobs:
648648
artifact-name: kind-gym-e2e-kubernetes-artifacts
649649
junit-report: report-kubernetes-gym-e2e.xml
650650
services-log-dir: ${{ runner.temp }}/e2e-services-logs
651+
652+
kind-network-policy-smoke:
653+
name: Kind NetworkPolicy smoke
654+
needs: [changes, build-cpu-smoke-images]
655+
if: >
656+
!cancelled() &&
657+
needs.build-cpu-smoke-images.result == 'success' &&
658+
needs.build-cpu-smoke-images.outputs.publish_images == 'true' && (
659+
github.event_name == 'workflow_dispatch' ||
660+
needs.changes.outputs.helm == 'true' ||
661+
needs.changes.outputs.e2e == 'true'
662+
)
663+
runs-on: ubuntu-latest
664+
timeout-minutes: 45
665+
permissions:
666+
contents: read
667+
packages: read
668+
env:
669+
KIND_CLUSTER_NAME: gha-${{ github.run_id }}-${{ github.run_attempt }}-network-policy
670+
steps:
671+
- name: Checkout code
672+
uses: actions/checkout@df4cb1c069e1874edd31b4311f1884172cec0e10 # v6.0.3
673+
with:
674+
persist-credentials: false
675+
676+
- name: Setup Kind cluster with NetworkPolicy enforcement
677+
uses: ./.github/actions/setup-kind-cluster
678+
with:
679+
kind-cluster-name: ${{ env.KIND_CLUSTER_NAME }}
680+
image-registry: ${{ needs.build-cpu-smoke-images.outputs.image_registry }}
681+
image-tag: ${{ needs.build-cpu-smoke-images.outputs.image_tag }}
682+
kind-image-pull-token: ${{ github.token }}
683+
kind-image-pull-user: ${{ github.actor }}
684+
kind-enable-gateway: "false"
685+
kind-enable-network-policies: "true"
686+
helm-extra-args: -f e2e/k8s/values/network-policies.yaml
687+
wait-for-api: "false"
688+
689+
- name: Run NetworkPolicy smoke test
690+
shell: bash
691+
env:
692+
NAMESPACE: nemo-platform
693+
CHAINSAW_REPORT_FORMAT: XML
694+
CHAINSAW_REPORT_NAME: report-network-policy-smoke
695+
CHAINSAW_REPORT_PATH: .
696+
run: |
697+
if e2e/k8s/scripts/test_network_policies.sh; then
698+
if [ ! -f report-network-policy-smoke.xml ]; then
699+
printf '<testsuite name="network-policy-smoke" tests="1" failures="0"/>%s' $'\n' > report-network-policy-smoke.xml
700+
fi
701+
exit 0
702+
fi
703+
status="$?"
704+
if [ ! -f report-network-policy-smoke.xml ]; then
705+
cat > report-network-policy-smoke.xml <<'EOF'
706+
<testsuite name="network-policy-smoke" tests="1" failures="1">
707+
<testcase name="network-policy-smoke">
708+
<failure message="network policy smoke test failed">See the workflow log and Kubernetes artifact bundle.</failure>
709+
</testcase>
710+
</testsuite>
711+
EOF
712+
fi
713+
exit "${status}"
714+
715+
- name: Finalize Kind e2e
716+
if: always()
717+
uses: ./.github/actions/finalize-kind-e2e
718+
with:
719+
kind-cluster-name: ${{ env.KIND_CLUSTER_NAME }}
720+
artifact-name: kind-network-policy-smoke-artifacts
721+
junit-report: report-network-policy-smoke.xml
722+
services-log-dir: ${{ runner.temp }}/e2e-services-logs
651723

652724
helm-lint:
653725
name: Helm lint
@@ -2110,6 +2182,7 @@ jobs:
21102182
- build-cpu-smoke-images
21112183
- kind-cpu-smoke
21122184
- kind-gym-e2e
2185+
- kind-network-policy-smoke
21132186
- helm-lint
21142187
- helm-chart-verifier
21152188
- lint

0 commit comments

Comments
 (0)