Nightly checks (Upgrade) #13
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 (Upgrade) | |
on: | |
# workflow_dispatch so that it can be triggered manually if needed | |
workflow_dispatch: | |
schedule: | |
- cron: "55 23 * * *" | |
jobs: | |
e2e-upgrade-tests: | |
runs-on: ubuntu-latest | |
strategy: | |
fail-fast: false | |
matrix: | |
from_version: | |
- 1.2 | |
- 1.3 | |
- 1.4 | |
to_branch: | |
- main | |
- release-1.4 | |
- release-1.3 | |
exclude: | |
- from_version: 1.3 | |
to_branch: release-1.3 | |
- from_version: 1.4 | |
to_branch: release-1.3 | |
- from_version: 1.4 | |
to_branch: release-1.4 | |
name: 'E2E Upgrade: ${{ matrix.from_version }} => ${{ matrix.to_branch }}' | |
concurrency: | |
group: '${{ github.workflow }}-${{ matrix.to_branch }}-${{ matrix.from_version }}' | |
cancel-in-progress: true | |
env: | |
CONTAINER_ENGINE: podman | |
steps: | |
- uses: actions/checkout@11bd71901bbe5b1630ceea73d27597364c9af683 # v4 # default branch will be checked out by default on scheduled workflows | |
with: | |
fetch-depth: 0 | |
- if: ${{ matrix.to_branch != 'main' }} | |
name: Checkout ${{ matrix.to_branch }} branch | |
run: git switch ${{ matrix.to_branch }} | |
- name: Setup Go | |
uses: actions/setup-go@41dfa10bad2bb2ae585af6ee5bb4d7d973ad74ed # 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 ::Target image ${{ env.OPERATOR_IMAGE }} not found for testing the ${{ matrix.to_branch }} branch. It might have expired. E2E tests will be skipped for ${{ matrix.to_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 (RHDH Operator Upgrade path: ${{ matrix.from_version }} => ${{ matrix.to_branch }})' | |
if: ${{ steps.operator-image-existence-checker.outputs.OPERATOR_IMAGE_EXISTS == 'true' }} | |
env: | |
BACKSTAGE_OPERATOR_TESTS_PLATFORM: minikube | |
PROFILE: 'rhdh' | |
START_VERSION_MANIFEST: '${{ github.workspace }}/tests/e2e/testdata/rhdh-operator-${{ matrix.from_version }}.yaml' | |
IMG: ${{ env.OPERATOR_IMAGE }} | |
run: make test-e2e-upgrade |