|
| 1 | +# Installs the eUPF chart with its defaults on a kind cluster every night, |
| 2 | +# runs the CNTi Test Suite's essential tests against it and publishes the |
| 3 | +# result as the badge in the README. https://github.com/lfn-cnti/testsuite-action |
| 4 | +# |
| 5 | +# For problems with the action or the test suite, open an issue at |
| 6 | +# https://github.com/lfn-cnti/testsuite-action/issues |
| 7 | +name: CNTi essential |
| 8 | + |
| 9 | +on: |
| 10 | + schedule: |
| 11 | + # Off the full hour: GitHub delays or drops scheduled runs under load, |
| 12 | + # which peaks at the start of each hour. |
| 13 | + - cron: "37 3 * * *" |
| 14 | + # By hand, and on pull requests that change the job, its configuration or |
| 15 | + # the chart. |
| 16 | + workflow_dispatch: |
| 17 | + pull_request: |
| 18 | + paths: |
| 19 | + - .github/workflows/cnti.yml |
| 20 | + - .github/cnti/** |
| 21 | + - .deploy/helm/eupf/** |
| 22 | + |
| 23 | +permissions: |
| 24 | + contents: read |
| 25 | + |
| 26 | +jobs: |
| 27 | + # The nightly run and manual runs on main: the only runs that publish the |
| 28 | + # badge, and the only ones with a write token. Forks that enable scheduled |
| 29 | + # workflows do not run either job. |
| 30 | + essential: |
| 31 | + if: github.repository == 'edgecomllc/eupf' && github.event_name != 'pull_request' && github.ref == 'refs/heads/main' |
| 32 | + runs-on: ubuntu-latest |
| 33 | + timeout-minutes: 60 |
| 34 | + permissions: |
| 35 | + # Publishes the badge to the orphan branch `badges`. |
| 36 | + contents: write |
| 37 | + steps: &essential-steps |
| 38 | + - uses: actions/checkout@3d3c42e5aac5ba805825da76410c181273ba90b1 # v7.0.1 |
| 39 | + with: |
| 40 | + # The suite doesn't need the job's write token; the action passes it |
| 41 | + # to the badge publisher on its own. |
| 42 | + persist-credentials: false |
| 43 | + |
| 44 | + - uses: lfn-cnti/testsuite-action@70536fda55fcb11f4f7463175fe9d57c86b85574 # v1.2.0 |
| 45 | + with: |
| 46 | + # A released suite version, bumped on purpose after reading the |
| 47 | + # release notes. |
| 48 | + version: v2.3.0 |
| 49 | + cnf_config: .github/cnti/cnti-testsuite.yaml |
| 50 | + kind_config: .github/cnti/kind.yaml |
| 51 | + tests: cert |
| 52 | + badge_branch: badges |
| 53 | + |
| 54 | + # Why did eUPF not come up? Pod state, events and logs from the kind |
| 55 | + # cluster the action created; it lives until the job ends. |
| 56 | + - name: Diagnostics |
| 57 | + if: failure() |
| 58 | + run: | |
| 59 | + set +e |
| 60 | + kubectl get pods -A -o wide |
| 61 | + kubectl describe pods -n eupf | tail -80 |
| 62 | + kubectl logs -n eupf --all-containers --tail=60 -l app.kubernetes.io/name=eupf |
| 63 | + kubectl get events -n eupf --sort-by=.lastTimestamp | tail -40 |
| 64 | +
|
| 65 | + # Pull requests that change the job or its configuration, and manual runs on |
| 66 | + # other branches: the same steps with a read-only token. The action publishes |
| 67 | + # the badge only from the default branch, so nothing is published here. |
| 68 | + essential-pr: |
| 69 | + if: github.repository == 'edgecomllc/eupf' && (github.event_name == 'pull_request' || github.ref != 'refs/heads/main') |
| 70 | + runs-on: ubuntu-latest |
| 71 | + timeout-minutes: 60 |
| 72 | + permissions: |
| 73 | + contents: read |
| 74 | + steps: *essential-steps |
0 commit comments