name: Playwright Tests
on:
deployment_status
# NOTE: If this is uncommented, the workflow never triggers
# types: [success]
env:
PR_DEPLOYMENT_URL: ${{ github.event.deployment_status.environment_url }}
jobs:
test:
timeout-minutes: 60
runs-on: ubuntu-latest
steps:
- name: Debugging
run: echo "Debugging - ${{ toJson(github.event) }}"
- uses: actions/checkout@v4
if: ${{ github.event.deployment.payload.serviceId == '396857de-3201-4e79-8386-ce492a329840' && github.event.deployment.production_environment == false }}
- uses: actions/setup-node@v4
if: ${{ github.event.deployment.payload.serviceId == '396857de-3201-4e79-8386-ce492a329840' && github.event.deployment.production_environment == false }}
with:
node-version: lts/*
- name: Install dependencies
if: ${{ github.event.deployment.payload.serviceId == '396857de-3201-4e79-8386-ce492a329840' && github.event.deployment.production_environment == false }}
run: npm install -g pnpm && pnpm install
- name: Install Playwright Browsers
if: ${{ github.event.deployment.payload.serviceId == '396857de-3201-4e79-8386-ce492a329840' && github.event.deployment.production_environment == false }}
run: pnpm exec playwright install --with-deps
working-directory: ./packages/website
- name: Run Playwright tests
if: ${{ github.event.deployment.payload.serviceId == '396857de-3201-4e79-8386-ce492a329840' && github.event.deployment.production_environment == false }}
run: pnpm exec playwright test
working-directory: ./packages/website
- uses: actions/upload-artifact@v4
if: ${{ always() && github.event.deployment.payload.serviceId == '396857de-3201-4e79-8386-ce492a329840' && github.event.deployment.production_environment == false }}
with:
name: playwright-report
path: playwright-report/