Skip to content

Nightly E2E Workflow #845

Nightly E2E Workflow

Nightly E2E Workflow #845

name: Nightly E2E Workflow
on:
workflow_dispatch:
schedule:
- cron: "0 1-6 * * *" # run hourly from 1am to 6am
jobs:
init:
outputs:
tests: ${{ steps.e2es.outputs.result }}
runs-on: [ ubuntu-latest ]
name: "Prepare E2E Scenarios"
steps:
- name: "Checkout"
uses: actions/checkout@de0fac2e4500dabe0009e67214ff5f5447ce83dd # v6.0.2
# find all e2e scenarios in the e2e directory and generate an array of scenario names
- name: "E2E Detection"
id: e2es
run: |
scenarios=$(find ${GITHUB_WORKSPACE}/e2e -type f -name 'e2e_test.go' -not -path "*/authz/*" -exec dirname {} \; | xargs -n 1 basename | jq -R -s -c 'split("\n")[:-1]')
echo $scenarios
echo "result=$scenarios" >> $GITHUB_OUTPUT
e2e:
name: "Run ${{ matrix.e2es }}(${{ matrix.k8s-version}}) E2E"
if: needs.init.outputs.tests != '[]'
needs: [ init ]
runs-on: [ ubuntu-latest ]
env:
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }}
strategy:
fail-fast: false
matrix:
k8s-version: [ "v1.32.11", "v1.33.7", "v1.34.3" ]
e2es: ${{fromJson(needs.init.outputs.tests)}}
steps:
# run the e2e tests using composite common/workflows/e2e action
- name: "E2E"
id: e2e
continue-on-error: true
uses: cloudoperators/common/workflows/e2e@main
env:
RUNTIME_ENV: "CI"
GH_APP_ID: ${{ secrets.CLOUDOPERATOR_APP_ID }}
GH_APP_PRIVATE_KEY: ${{ secrets.CLOUDOPERATOR_APP_PRIVATE_KEY }}
GH_APP_INSTALLATION_ID: ${{ secrets.CLOUDOPERATOR_APP_INSTALLATION_ID }}
with:
admin-k8s-version: "v1.33.7"
remote-k8s-version: ${{ matrix.k8s-version }}
scenario: ${{ matrix.e2es }}
admin-config: ${{ github.workspace }}/e2e/greenhouse-admin-cluster.yaml
remote-config: ${{ github.workspace }}/dev-env/greenhouse-remote-cluster.yaml
- name: "Display Logs"
if: ${{ steps.e2e.outcome == 'failure' }}
env:
SCENARIO: ${{ matrix.e2es }}
run: |
make show-e2e-logs
- name: "E2E Failure?"
if: ${{ steps.e2e.outcome == 'failure' }}
run: |
exit 1
# check if the e2e tests passed for all scenarios
checksOK:
name: "E2E Check"
needs: [ e2e ]
runs-on: [ ubuntu-latest ]
if: always()
steps:
- name: "Check if e2e passed"
run: |
if [ "${{ needs.e2e.result }}" == "success" ]; then
echo "✅ E2E passed 🎉"
else
echo "❌ E2E failed 😭"
exit 1
fi