Skip to content

Commit

Permalink
Try running E2E tests on PRs by leveraging the already built operator…
Browse files Browse the repository at this point in the history
… image
  • Loading branch information
rm3l committed Feb 17, 2024
1 parent d1b21b8 commit 68c125a
Showing 1 changed file with 26 additions and 0 deletions.
26 changes: 26 additions & 0 deletions .github/workflows/pr.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -25,6 +25,8 @@ jobs:
pr-validate:
name: PR Validate
runs-on: ubuntu-latest
env:
CONTAINER_ENGINE: podman
steps:
- name: Checkout
uses: actions/checkout@v4
Expand Down Expand Up @@ -71,3 +73,27 @@ jobs:
with:
# Path to SARIF file relative to the root of the repository
sarif_file: gosec.sarif

- name: Prepare E2E Tests for PR by waiting until operator image is built and published
# run this stage only if there are changes that match the includes and not the excludes
if: ${{ env.CHANGES != '' }}
timeout-minutes: 600
run: |
SHORT_SHA=$(git rev-parse --short HEAD)
BASE_VERSION=$(grep -E "^VERSION \?=" Makefile | sed -r -e "s/.+= //") # 0.1.0
OPERATOR_IMAGE="quay.io/janus-idp/operator:${BASE_VERSION}-pr-${{ github.event.number }}-${SHORT_SHA}"
echo "Waiting until operator image is found or timeout expires: ${OPERATOR_IMAGE}..."
until ${CONTAINER_ENGINE} image pull "${OPERATOR_IMAGE}" &> /dev/null; do
echo -n .
done
echo "... operator image found: ${OPERATOR_IMAGE}."
echo "OPERATOR_IMAGE=${OPERATOR_IMAGE}" >> $GITHUB_ENV
- name: Start Minikube
uses: medyagh/setup-minikube@606b71970c783154fe49b711486c717f5780f485 # v0.0.15
with:
addons: ingress
- name: Run E2E tests
env:
BACKSTAGE_OPERATOR_TESTS_PLATFORM: minikube
IMG: ${{ env.OPERATOR_IMAGE }}
run: make test-e2e

0 comments on commit 68c125a

Please sign in to comment.