Wizard: Review step revamp (HMS-10785) #9749
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: Hosted playwright tests | |
| on: | |
| pull_request: | |
| types: [opened, reopened, synchronize] | |
| workflow_dispatch: | |
| merge_group: | |
| # this prevents multiple jobs from the same pr | |
| # running when new changes are pushed. | |
| concurrency: | |
| group: ${{github.workflow}}-${{ github.ref }} | |
| cancel-in-progress: true | |
| jobs: | |
| playwright-tests: | |
| runs-on: | |
| - codebuild-image-builder-frontend-${{ github.run_id }}-${{ github.run_attempt }} | |
| - instance-size:large | |
| - buildspec-override:true | |
| steps: | |
| - name: Checkout code | |
| uses: actions/checkout@v4 | |
| with: | |
| ref: ${{ github.event.pull_request.head.sha }} | |
| - name: Get current PR URL | |
| id: get-pr-url | |
| run: | | |
| # Extract the pull request URL from the event payload | |
| pr_url=$(jq -r '.pull_request.html_url' < "$GITHUB_EVENT_PATH") | |
| echo "Pull Request URL: $pr_url" | |
| # Set the PR URL as an output using the environment file | |
| echo "pr_url=$pr_url" >> $GITHUB_ENV | |
| - name: Setup Node.js with cached dependencies | |
| uses: ./.github/actions/setup-node-cached | |
| - name: Install Playwright | |
| run: npx playwright install chromium --only-shell | |
| # This prevents an error related to minimum watchers when running the front-end and playwright | |
| - name: Increase file watchers limit | |
| run: echo fs.inotify.max_user_watches=524288 | sudo tee -a /etc/sysctl.conf && sudo sysctl -p | |
| - name: Update /etc/hosts | |
| run: sudo npm run patch:hosts | |
| - name: Start front-end server with coverage instrumentation | |
| run: | | |
| COVERAGE=true npm run start:federated & | |
| npx wait-on http://localhost:8003/apps/image-builder/ | |
| - name: Run testing proxy | |
| run: docker run -d --network=host -e HTTPS_PROXY=$RH_PROXY_URL -v "$(pwd)/config:/config:ro,Z" --name frontend-development-proxy quay.io/redhat-user-workloads/hcc-platex-services-tenant/frontend-development-proxy | |
| - name: Run front-end Playwright tests | |
| env: | |
| BASE_URL: https://stage.foo.redhat.com:1337 | |
| run: | | |
| CURRENTS_PROJECT_ID=hIU6nO CURRENTS_RECORD_KEY=$CURRENTS_RECORD_KEY npx playwright test playwright/Customizations playwright/Import playwright/Cockpit playwright/Basic | |
| - name: Generate Playwright coverage report | |
| if: always() | |
| run: npm run e2e:coverage | |
| - name: Upload Playwright coverage to Codecov | |
| if: always() | |
| uses: codecov/codecov-action@v4 | |
| with: | |
| token: ${{ secrets.CODECOV_TOKEN }} | |
| files: ./coverage/playwright/lcov.info | |
| flags: playwright | |
| verbose: true | |
| - name: Store front-end Test report | |
| uses: actions/upload-artifact@v4 | |
| if: always() | |
| with: | |
| name: playwright-report | |
| path: playwright-report/ | |
| retention-days: 10 |