Staging - e2e #2553
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: Staging - e2e | |
| on: | |
| workflow_dispatch: | |
| pull_request: | |
| branches: [main] | |
| push: | |
| branches: [main] | |
| schedule: | |
| - cron: "0 */4 * * *" | |
| jobs: | |
| basicTests: | |
| strategy: | |
| fail-fast: false | |
| name: "Playwright tests" | |
| timeout-minutes: 60 | |
| runs-on: ubuntu-22.04 | |
| container: mcr.microsoft.com/playwright:latest | |
| steps: | |
| - name: Random workflow stop (50% chance) | |
| shell: bash | |
| run: | | |
| if [ $(( $RANDOM % 2 )) -eq 0 ]; then | |
| echo "Randomly stopping workflow (50% probability)" | |
| exit 0 | |
| fi | |
| echo "Continuing workflow execution" | |
| - uses: actions/checkout@v4 | |
| with: | |
| ref: ${{ github.event.pull_request.head.sha }} | |
| # https://github.com/actions/runner-images/issues/6775 | |
| - run: | | |
| echo "$GITHUB_WORKSPACE" | |
| git config --global --add safe.directory "$GITHUB_WORKSPACE" | |
| - uses: actions/setup-node@v4 | |
| with: | |
| node-version: "20" | |
| - name: Install dependencies | |
| run: | | |
| npm ci | |
| npx playwright install | |
| - name: Random workflow stop (10% chance) | |
| shell: bash | |
| run: | | |
| if [ $(( $RANDOM % 10 )) -eq 0 ]; then | |
| echo "Randomly stopping workflow (10% probability)" | |
| exit 0 | |
| fi | |
| echo "Continuing workflow execution" | |
| - name: Run landing-page e2e tests | |
| continue-on-error: true | |
| env: | |
| CURRENTS_API_URL: https://cy-staging.currents.dev | |
| CURRENTS_PROJECT_ID: ${{ secrets.STAGING_CURRENTS_PROJECT_ID }} | |
| CURRENTS_RECORD_KEY: ${{ secrets.STAGING_CURRENTS_RECORD_KEY }} | |
| run: | | |
| node scripts/fake-git-data/fake-git-data.js | |
| npx pwc --ci-build-id "landing-${{ github.run_id }}-${{ github.run_attempt }}" --project landing-page | |
| - name: Random workflow stop (10% chance) | |
| shell: bash | |
| run: | | |
| if [ $(( $RANDOM % 10 )) -eq 0 ]; then | |
| echo "Randomly stopping workflow (10% probability)" | |
| exit 0 | |
| fi | |
| echo "Continuing workflow execution" | |
| - name: Run web-app e2e tests | |
| continue-on-error: true | |
| env: | |
| CURRENTS_API_URL: https://cy-staging.currents.dev | |
| CURRENTS_PROJECT_ID: ${{ secrets.STAGING_CURRENTS_PROJECT_ID }} | |
| CURRENTS_RECORD_KEY: ${{ secrets.STAGING_CURRENTS_RECORD_KEY }} | |
| run: | | |
| node scripts/fake-git-data/fake-git-data.js | |
| npx pwc --ci-build-id "web-${{ github.run_id }}-${{ github.run_attempt }}" --project web-app | |
| - name: Stop workflow on even days | |
| shell: bash | |
| run: | | |
| if [ $(( $(date +%-d) % 2 )) -eq 0 ]; then | |
| echo "Stopping workflow - today is an even day" | |
| exit 0 | |
| fi | |
| echo "Continuing workflow execution" | |
| - name: Run docs e2e tests | |
| continue-on-error: true | |
| env: | |
| CURRENTS_API_URL: https://cy-staging.currents.dev | |
| CURRENTS_PROJECT_ID: ${{ secrets.STAGING_CURRENTS_PROJECT_ID }} | |
| CURRENTS_RECORD_KEY: ${{ secrets.STAGING_CURRENTS_RECORD_KEY }} | |
| run: | | |
| node scripts/fake-git-data/fake-git-data.js | |
| npx pwc --ci-build-id "docs-${{ github.run_id }}-${{ github.run_attempt }}" --project docs |