Post mortem error message fix #392
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 Stag | |
| on: [pull_request] | |
| jobs: | |
| build_and_test: | |
| name: Tests | |
| runs-on: ubuntu-latest | |
| timeout-minutes: 30 | |
| steps: | |
| - uses: actions/checkout@v4 | |
| - uses: actions/setup-node@v4 | |
| with: | |
| node-version: lts/* | |
| # Sleep action to wait until deployment is ready | |
| - run: sleep 30 | |
| - name: cloudflare-preview-url | |
| # Use the latest version | |
| uses: zentered/cloudflare-preview-url@v1.4.2 | |
| id: cloudflare_preview_url | |
| env: | |
| CLOUDFLARE_API_TOKEN: ${{ secrets.CLOUDFLARE_API_TOKEN }} | |
| CLOUDFLARE_ACCOUNT_EMAIL: ${{ secrets.CLOUDFLARE_ACCOUNT_EMAIL }} | |
| CLOUDFLARE_ACCOUNT_ID: ${{ secrets.CLOUDFLARE_ACCOUNT_ID }} | |
| BRANCH_NAME: ${{ github.head_ref || github.ref_name }} | |
| with: | |
| cloudflare_project_id: 'mindic' | |
| wait_until_ready: 'false' | |
| branch: ${{ github.head_ref || github.ref_name }} | |
| - name: Get URL | |
| run: echo "${{ steps.cloudflare_preview_url.outputs.preview_url }}" | |
| - name: Install dependencies | |
| run: npm ci | |
| - name: Install Playwright Browsers | |
| run: npx playwright install --with-deps | |
| - name: Run Playwright tests | |
| run: CI=true BASE_URL="${{ steps.cloudflare_preview_url.outputs.preview_url }}" EMAIL_STUDENT="${{ secrets.STAG_EMAIL_STUDENT }}" EMAIL_TEACHER="${{ secrets.STAG_EMAIL_TEACHER }}" PASSWORD_STUDENT="${{ secrets.STAG_PASSWORD_STUDENT }}" PASSWORD_TEACHER="${{ secrets.STAG_PASSWORD_TEACHER }}" npx playwright test --config=playwright-test.config.ts | |
| - uses: actions/upload-artifact@v4 | |
| if: always() | |
| with: | |
| name: playwright-report | |
| path: playwright-report/ | |
| retention-days: 30 |