Skip to content

Commit

Permalink
chore: replace Playwright tests workflow reference and add production…
Browse files Browse the repository at this point in the history
… version (#261)
  • Loading branch information
typeWolffo authored Nov 28, 2024
1 parent 2315687 commit 6851290
Show file tree
Hide file tree
Showing 4 changed files with 51 additions and 8 deletions.
2 changes: 1 addition & 1 deletion .github/workflows/deploy-api-production.yml
Original file line number Diff line number Diff line change
Expand Up @@ -10,7 +10,7 @@ on:

jobs:
test:
uses: ./.github/workflows/playwright-tests.yml
uses: ./.github/workflows/playwright-tests-production.yml

build-api:
needs: test
Expand Down
2 changes: 1 addition & 1 deletion .github/workflows/deploy-webapp-production.yml
Original file line number Diff line number Diff line change
Expand Up @@ -10,7 +10,7 @@ on:

jobs:
test:
uses: ./.github/workflows/playwright-tests.yml
uses: ./.github/workflows/playwright-tests-production.yml

build-web:
needs: test
Expand Down
45 changes: 45 additions & 0 deletions .github/workflows/playwright-tests-production.yml
Original file line number Diff line number Diff line change
@@ -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 }}
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
name: E2E - Playwright Tests
name: E2E - Playwright Tests (Staging)

env:
HUSKY: 0
Expand All @@ -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
Expand Down

0 comments on commit 6851290

Please sign in to comment.