This repository has been archived by the owner on Aug 19, 2024. It is now read-only.
Nightly checks #159
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
name: Nightly checks | |
on: | |
# workflow_dispatch so that it can be triggered manually if needed | |
workflow_dispatch: | |
schedule: | |
- cron: "34 23 * * *" | |
jobs: | |
e2e-tests: | |
runs-on: ubuntu-latest | |
strategy: | |
fail-fast: false | |
matrix: | |
branch: [ main, 1.2.x, 1.1.x ] | |
test_upgrade: [ 'true', 'false' ] | |
exclude: | |
- branch: 1.1.x # Testing upgrade from 1.1.x | |
test_upgrade: 'true' | |
name: 'E2E Tests - ${{ matrix.branch }} - upgrade=${{ matrix.test_upgrade }}' | |
concurrency: | |
group: '${{ github.workflow }}-${{ matrix.branch }}-${{ matrix.test_upgrade }}' | |
cancel-in-progress: true | |
env: | |
CONTAINER_ENGINE: podman | |
steps: | |
- uses: actions/checkout@1d96c772d19495a3b5c517cd2bc0cb401ea0529f # v4 # default branch will be checked out by default on scheduled workflows | |
with: | |
fetch-depth: 0 | |
- if: ${{ matrix.branch != 'main' }} | |
name: Checkout ${{ matrix.branch }} branch | |
run: git switch ${{ matrix.branch }} | |
- name: Setup Go | |
uses: actions/setup-go@0c52d547c9bc32b1aa3301fd7a9cb496313a4491 # v5 | |
with: | |
go-version-file: 'go.mod' | |
- name: Determine built operator image | |
run: | | |
echo "OPERATOR_IMAGE=$(make show-img)" >> $GITHUB_ENV | |
- name: Check if image exists in remote registry | |
id: operator-image-existence-checker | |
run: | | |
echo "OPERATOR_IMAGE_EXISTS=$(if skopeo inspect "docker://${{ env.OPERATOR_IMAGE }}" > /dev/null; then echo "true"; else echo "false"; fi)" >> $GITHUB_OUTPUT | |
- name: Display warning if image was not found | |
if: ${{ steps.operator-image-existence-checker.outputs.OPERATOR_IMAGE_EXISTS == 'false' }} | |
run: | | |
echo "::warning ::Image ${{ env.OPERATOR_IMAGE }} not found for testing the ${{ matrix.branch }} branch. It might have expired. E2E tests will be skipped for ${{ matrix.branch }}." | |
- name: Start Minikube | |
if: ${{ steps.operator-image-existence-checker.outputs.OPERATOR_IMAGE_EXISTS == 'true' }} | |
uses: medyagh/setup-minikube@d8c0eb871f6f455542491d86a574477bd3894533 # v0.0.18 | |
- name: Run E2E tests (Operator Upgrade path) | |
if: ${{ matrix.test_upgrade == 'true' && steps.operator-image-existence-checker.outputs.OPERATOR_IMAGE_EXISTS == 'true' }} | |
env: | |
BACKSTAGE_OPERATOR_TESTS_PLATFORM: minikube | |
IMG: ${{ env.OPERATOR_IMAGE }} | |
run: make test-e2e-upgrade | |
- name: Run E2E tests | |
if: ${{ matrix.test_upgrade == 'false' && steps.operator-image-existence-checker.outputs.OPERATOR_IMAGE_EXISTS == 'true' }} | |
env: | |
BACKSTAGE_OPERATOR_TESTS_PLATFORM: minikube | |
IMG: ${{ env.OPERATOR_IMAGE }} | |
run: make test-e2e |