feat(ci): implement new single-script e2e test workflow #20
Workflow file for this run
This file contains hidden or 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: 'WrongSecrets CTF Party: E2E Tests' | |
| on: | |
| pull_request: | |
| branches: [ main ] | |
| jobs: | |
| e2e-test: | |
| name: Run Cypress E2E Tests | |
| runs-on: ubuntu-latest | |
| steps: | |
| - name: Checkout Code | |
| uses: actions/checkout@v4 | |
| - name: Start Minikube | |
| uses: medyagh/setup-minikube@latest | |
| with: | |
| driver: docker | |
| cpus: '2' | |
| memory: '8000' | |
| kubernetes-version: 'v1.32.0' | |
| - name: Install Helm | |
| uses: azure/setup-helm@v4 | |
| - name: Install yq | |
| run: sudo wget https://github.com/mikefarah/yq/releases/latest/download/yq_linux_amd64 -O /usr/bin/yq && sudo chmod +x /usr/bin/yq | |
| # This new step runs the deploy script in the background and then waits | |
| - name: Run Deployment Script in Background and Wait | |
| run: | | |
| ./build-and-deploy-minikube.sh & | |
| echo "Deployment script running in background. Waiting for pods..." | |
| sleep 30 | |
| kubectl wait --for=condition=ready pod -l app=wrongsecrets-balancer --timeout=5m | |
| - name: Install Cypress and Run Tests | |
| uses: cypress-io/github-action@v6 | |
| with: | |
| working-directory: wrongsecrets-balancer | |
| # The kubectl wait command is now the primary check | |
| wait-on: 'http://localhost:3000' | |
| wait-on-timeout: 120 # 2 minutes | |
| browser: chrome | |
| headless: true |