diff --git a/.github/workflows/deploy-api-production.yml b/.github/workflows/deploy-api-production.yml index 91fe093a..18f433e3 100644 --- a/.github/workflows/deploy-api-production.yml +++ b/.github/workflows/deploy-api-production.yml @@ -10,7 +10,7 @@ on: jobs: test: - uses: ./.github/workflows/playwright-tests.yml + uses: ./.github/workflows/playwright-tests-production.yml build-api: needs: test diff --git a/.github/workflows/deploy-webapp-production.yml b/.github/workflows/deploy-webapp-production.yml index fcd0a89a..f58140d9 100644 --- a/.github/workflows/deploy-webapp-production.yml +++ b/.github/workflows/deploy-webapp-production.yml @@ -10,7 +10,7 @@ on: jobs: test: - uses: ./.github/workflows/playwright-tests.yml + uses: ./.github/workflows/playwright-tests-production.yml build-web: needs: test diff --git a/.github/workflows/playwright-tests-production.yml b/.github/workflows/playwright-tests-production.yml new file mode 100644 index 00000000..552d9092 --- /dev/null +++ b/.github/workflows/playwright-tests-production.yml @@ -0,0 +1,45 @@ +name: E2E - Playwright Tests (Production) + +env: + HUSKY: 0 + +on: + workflow_call: + +jobs: + playwright: + name: Playwright Tests + runs-on: ubuntu-latest + environment: + name: production + + steps: + - name: Checkout repository + uses: actions/checkout@v4 + + - name: Setup pnpm + uses: pnpm/action-setup@v4 + with: + version: 9.4.0 + + - name: Setup Node.js + uses: actions/setup-node@v4 + with: + node-version: 20.15.0 + cache: 'pnpm' + + - name: Install dependencies + run: pnpm install + + - name: Install Playwright Browsers + run: pnpm exec playwright install --with-deps chromium + working-directory: ./apps/web + env: + PLAYWRIGHT_BROWSERS_PATH: /home/runner/.cache/ms-playwright + + - name: Run Playwright tests + run: pnpm playwright test + working-directory: ./apps/web + env: + PLAYWRIGHT_BROWSERS_PATH: /home/runner/.cache/ms-playwright + TEST_KEY: ${{ secrets.TEST_KEY }} diff --git a/.github/workflows/playwright-tests.yml b/.github/workflows/playwright-tests-staging.yml similarity index 80% rename from .github/workflows/playwright-tests.yml rename to .github/workflows/playwright-tests-staging.yml index dda9fc46..f267a1d8 100644 --- a/.github/workflows/playwright-tests.yml +++ b/.github/workflows/playwright-tests-staging.yml @@ -1,4 +1,4 @@ -name: E2E - Playwright Tests +name: E2E - Playwright Tests (Staging) env: HUSKY: 0 @@ -9,17 +9,15 @@ on: - "STAGING - Deploy API" types: - completed - workflow_call: workflow_dispatch: jobs: playwright: name: Playwright Tests runs-on: ubuntu-latest - if: | - (github.event_name == 'workflow_run' && github.event.workflow_run.conclusion == 'success') || - github.event_name == 'workflow_call' || - github.event_name == 'workflow_dispatch' + if: github.event.workflow_run.conclusion == 'success' + environment: + name: staging steps: - name: Checkout repository