Test on All Platforms #1204
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: Test on All Platforms | |
| on: | |
| workflow_dispatch: | |
| schedule: | |
| - cron: '10 5 * * *' # 6:10 AM CET / 7:10 AM CEST | |
| - cron: '50 11 * * *' # 12:50 PM CET / 1:50 PM CEST | |
| - cron: '30 18 * * *' # 7:30 PM CET / 8:30 PM CEST | |
| jobs: | |
| test: | |
| timeout-minutes: 60 | |
| runs-on: ubuntu-24.04 | |
| environment: ${{ matrix.testType }} | |
| strategy: | |
| fail-fast: false | |
| matrix: | |
| include: | |
| - testType: complete | |
| platform: react | |
| configFile: playwright.config.complete.ts | |
| - testType: complete | |
| platform: web-js | |
| configFile: playwright.config.complete.ts | |
| playgroundType: web-js | |
| - testType: complete | |
| platform: web-js-script | |
| configFile: playwright.config.complete.ts | |
| playgroundType: web-js-script | |
| - testType: connect | |
| platform: react | |
| configFile: playwright.config.connect.ts | |
| env: | |
| # ── Shared (hardcoded) ── | |
| PLAYWRIGHT_NUM_CORES: 4 | |
| # ── "complete" environment secrets (empty on connect runners) ── | |
| PLAYWRIGHT_JWT_TOKEN: ${{ secrets.PLAYWRIGHT_JWT_TOKEN }} | |
| PLAYWRIGHT_GOOGLE_EMAIL: ${{ secrets.PLAYWRIGHT_GOOGLE_EMAIL }} | |
| PLAYWRIGHT_GOOGLE_PASSWORD: ${{ secrets.PLAYWRIGHT_GOOGLE_PASSWORD }} | |
| PLAYWRIGHT_GOOGLE_TOTP_SECRET: ${{ secrets.PLAYWRIGHT_GOOGLE_TOTP_SECRET }} | |
| DEFAULT_CORBADO_BACKEND_API_BASIC_AUTH: ${{ secrets.DEFAULT_CORBADO_BACKEND_API_BASIC_AUTH }} | |
| # ── "connect" environment secrets (empty on complete runners) ── | |
| NEXT_PUBLIC_CORBADO_PROJECT_ID: ${{ secrets.NEXT_PUBLIC_CORBADO_PROJECT_ID }} | |
| NEXT_PUBLIC_CORBADO_FRONTEND_API_URL_SUFFIX: ${{ secrets.NEXT_PUBLIC_CORBADO_FRONTEND_API_URL_SUFFIX }} | |
| NEXT_PUBLIC_AWS_COGNITO_USER_POOL_ID: ${{ secrets.AWS_COGNITO_USER_POOL_ID }} | |
| NEXT_PUBLIC_AWS_COGNITO_CLIENT_ID: ${{ vars.NEXT_PUBLIC_AWS_COGNITO_CLIENT_ID }} | |
| CORBADO_BACKEND_API_URL: ${{ secrets.CORBADO_BACKEND_API_URL }} | |
| CORBADO_BACKEND_API_BASIC_AUTH: ${{ secrets.CORBADO_BACKEND_API_BASIC_AUTH }} | |
| PLAYWRIGHT_CONNECT_PROJECT_ID: ${{ secrets.PLAYWRIGHT_CONNECT_PROJECT_ID }} | |
| PLAYWRIGHT_NGROK_AUTH_TOKEN: ${{ secrets.PLAYWRIGHT_NGROK_AUTH_TOKEN }} | |
| AWS_COGNITO_USER_POOL_ID: ${{ secrets.AWS_COGNITO_USER_POOL_ID }} | |
| AWS_COGNITO_CLIENT_ID: ${{ secrets.AWS_COGNITO_CLIENT_ID }} | |
| AWS_COGNITO_CLIENT_SECRET: ${{ secrets.AWS_COGNITO_CLIENT_SECRET }} | |
| AWS_REGION: ${{ secrets.AWS_REGION }} | |
| AWS_ACCESS_KEY_ID: ${{ secrets.COGNITO_AWS_ACCESS_KEY_ID }} | |
| AWS_SECRET_ACCESS_KEY: ${{ secrets.COGNITO_AWS_SECRET_ACCESS_KEY }} | |
| steps: | |
| - name: Debug secret availability | |
| run: | | |
| check() { if [ -n "$2" ]; then echo "$1: SET (${#2} chars)"; else echo "$1: EMPTY"; fi; } | |
| echo "=== Environment: ${{ matrix.testType }} / ${{ matrix.platform }} ===" | |
| echo "--- Complete secrets ---" | |
| check "PLAYWRIGHT_JWT_TOKEN" "$PLAYWRIGHT_JWT_TOKEN" | |
| check "PLAYWRIGHT_GOOGLE_EMAIL" "$PLAYWRIGHT_GOOGLE_EMAIL" | |
| check "PLAYWRIGHT_GOOGLE_PASSWORD" "$PLAYWRIGHT_GOOGLE_PASSWORD" | |
| check "PLAYWRIGHT_GOOGLE_TOTP_SECRET" "$PLAYWRIGHT_GOOGLE_TOTP_SECRET" | |
| check "DEFAULT_CORBADO_BACKEND_API_BASIC_AUTH" "$DEFAULT_CORBADO_BACKEND_API_BASIC_AUTH" | |
| echo "--- Connect secrets ---" | |
| check "NEXT_PUBLIC_CORBADO_PROJECT_ID" "$NEXT_PUBLIC_CORBADO_PROJECT_ID" | |
| check "NEXT_PUBLIC_CORBADO_FRONTEND_API_URL_SUFFIX" "$NEXT_PUBLIC_CORBADO_FRONTEND_API_URL_SUFFIX" | |
| check "NEXT_PUBLIC_AWS_COGNITO_USER_POOL_ID" "$NEXT_PUBLIC_AWS_COGNITO_USER_POOL_ID" | |
| check "NEXT_PUBLIC_AWS_COGNITO_CLIENT_ID" "$NEXT_PUBLIC_AWS_COGNITO_CLIENT_ID" | |
| check "CORBADO_BACKEND_API_URL" "$CORBADO_BACKEND_API_URL" | |
| check "CORBADO_BACKEND_API_BASIC_AUTH" "$CORBADO_BACKEND_API_BASIC_AUTH" | |
| check "PLAYWRIGHT_CONNECT_PROJECT_ID" "$PLAYWRIGHT_CONNECT_PROJECT_ID" | |
| check "PLAYWRIGHT_NGROK_AUTH_TOKEN" "$PLAYWRIGHT_NGROK_AUTH_TOKEN" | |
| check "AWS_COGNITO_USER_POOL_ID" "$AWS_COGNITO_USER_POOL_ID" | |
| check "AWS_COGNITO_CLIENT_ID" "$AWS_COGNITO_CLIENT_ID" | |
| check "AWS_COGNITO_CLIENT_SECRET" "$AWS_COGNITO_CLIENT_SECRET" | |
| check "AWS_REGION" "$AWS_REGION" | |
| check "AWS_ACCESS_KEY_ID" "$AWS_ACCESS_KEY_ID" | |
| check "AWS_SECRET_ACCESS_KEY" "$AWS_SECRET_ACCESS_KEY" | |
| - name: Checkout code | |
| uses: actions/checkout@v4 | |
| - name: Set up Node.js | |
| uses: actions/setup-node@v4 | |
| with: | |
| node-version: 24 | |
| - name: Cache node modules | |
| id: cache-npm | |
| uses: actions/cache@v4 | |
| env: | |
| cache-name: cache-node-modules | |
| with: | |
| path: | | |
| ~/.npm | |
| ./node_modules | |
| key: ${{ runner.os }}-build-${{ env.cache-name }}-${{ hashFiles('**/package-lock.json') }}-force-1 | |
| restore-keys: | | |
| ${{ runner.os }}-build-${{ env.cache-name }}- | |
| ${{ runner.os }}-build- | |
| ${{ runner.os }}- | |
| - if: ${{ steps.cache-npm.outputs.cache-hit != 'true' }} | |
| name: Install root dependencies | |
| run: | | |
| npm i | |
| npm install lerna | |
| npm list | |
| - name: Build SDKs | |
| run: | | |
| npm run build | |
| npm run build:bundler:local | |
| - name: Get installed Playwright version | |
| id: playwright-version | |
| run: echo "version=$(yarn why --json @playwright/test | grep -h 'workspace:.' | jq --raw-output '.children[].locator' | sed -e 's/@playwright\/test@.*://')" >> "$GITHUB_OUTPUT" | |
| - if: ${{ steps.cache-npm.outputs.cache-hit != 'true' }} | |
| name: List the state of node modules | |
| continue-on-error: true | |
| working-directory: packages/tests-e2e | |
| run: npm list | |
| - name: Install dependencies | |
| working-directory: packages/tests-e2e | |
| run: | | |
| npm install | |
| sudo apt-get update | |
| sudo apt-get install -y libxml2-utils | |
| - uses: actions/cache@v4 | |
| id: playwright-cache | |
| with: | |
| path: '~/.cache/ms-playwright' | |
| key: '${{ runner.os }}-playwright-${{ steps.playwright-version.outputs.version }}' | |
| restore-keys: | | |
| ${{ runner.os }}-playwright- | |
| - name: Install Playwright's dependencies | |
| if: steps.playwright-cache.outputs.cache-hit != 'true' | |
| working-directory: packages/tests-e2e | |
| run: npx playwright install --with-deps | |
| - name: Create CloudWatch log stream | |
| env: | |
| AWS_ACCESS_KEY_ID: ${{ secrets.CLOUDWATCH_AWS_ACCESS_KEY_ID }} | |
| AWS_SECRET_ACCESS_KEY: ${{ secrets.CLOUDWATCH_AWS_SECRET_ACCESS_KEY }} | |
| AWS_REGION: ${{ secrets.AWS_REGION }} | |
| run: | | |
| check() { if [ -n "$2" ]; then echo "$1: SET (${#2} chars)"; else echo "$1: EMPTY"; fi; } | |
| echo "=== CloudWatch step env (step-level overrides) ===" | |
| check "AWS_ACCESS_KEY_ID" "$AWS_ACCESS_KEY_ID" | |
| check "AWS_SECRET_ACCESS_KEY" "$AWS_SECRET_ACCESS_KEY" | |
| check "AWS_REGION" "$AWS_REGION" | |
| TIMESTAMP=$(date +%s000) | |
| RANDOM_SUFFIX=$(head /dev/urandom | tr -dc 'a-z0-9' | head -c 6) | |
| LOG_STREAM_NAME="javascript-${TIMESTAMP}-${RANDOM_SUFFIX}" | |
| echo "LOG_STREAM_NAME=$LOG_STREAM_NAME" >> "$GITHUB_ENV" | |
| aws logs create-log-stream --log-group-name "test-results-board" --log-stream-name "$LOG_STREAM_NAME" | |
| - name: Run ${{ matrix.testType }} tests for ${{ matrix.platform }} | |
| working-directory: packages/tests-e2e | |
| env: | |
| PLAYGROUND_TYPE: ${{ matrix.playgroundType || '' }} | |
| run: npx playwright test --config=${{ matrix.configFile }} | |
| continue-on-error: true | |
| - uses: actions/upload-artifact@v4 | |
| if: always() | |
| with: | |
| name: playwright-report-${{ matrix.testType }}-${{ matrix.platform }} | |
| path: packages/tests-e2e/playwright-report/ | |
| retention-days: 30 | |
| - name: Send results to CloudWatch | |
| if: always() | |
| env: | |
| AWS_ACCESS_KEY_ID: ${{ secrets.CLOUDWATCH_AWS_ACCESS_KEY_ID }} | |
| AWS_SECRET_ACCESS_KEY: ${{ secrets.CLOUDWATCH_AWS_SECRET_ACCESS_KEY }} | |
| AWS_REGION: ${{ secrets.AWS_REGION }} | |
| run: | | |
| bash scripts/cloudwatch-log.sh \ | |
| "${{ matrix.testType }}" \ | |
| "${{ matrix.platform }}" \ | |
| "nightly" |