Skip to content

Commit

Permalink
💚: Created CI/CD for playwright
Browse files Browse the repository at this point in the history
  • Loading branch information
xannyxs committed Aug 6, 2024
1 parent 45b0b16 commit 7ff6460
Showing 1 changed file with 62 additions and 8 deletions.
70 changes: 62 additions & 8 deletions .github/workflows/playwright.yml
Original file line number Diff line number Diff line change
Expand Up @@ -4,9 +4,9 @@ on:
branches: [ main, develop ]
pull_request:
branches: [ main, develop ]

jobs:
test:
timeout-minutes: 60
build-server:
runs-on: ubuntu-latest
steps:
- uses: actions/checkout@v4
Expand All @@ -15,13 +15,67 @@ jobs:
node-version: lts/*
- name: Install dependencies
run: npm install -g yarn && yarn
- name: Install Playwright Browsers
run: yarn playwright install --with-deps
- name: Run Playwright tests
run: yarn playwright test
- name: Build server
run: yarn build
- name: Create server artifact
uses: actions/upload-artifact@v4
with:
name: server-build
path: packages/app/.next
retention-days: 1

test-firefox:
needs: build-server
runs-on: ubuntu-latest
steps:
- uses: actions/checkout@v4
- uses: actions/setup-node@v4
with:
node-version: lts/*
- name: Install dependencies
run: npm install -g yarn && yarn
- name: Install Playwright
run: yarn playwright install --with-deps firefox
- name: Download server artifact
uses: actions/download-artifact@v4
with:
name: server-build
path: packages/app/.next # Adjust this path as needed
- name: Run Playwright tests on Firefox
run: |
cd packages/app
yarn playwright test --project=firefox
- uses: actions/upload-artifact@v4
if: always()
with:
name: playwright-report
path: playwright-report/
name: playwright-report-firefox
path: packages/app/playwright-report/
retention-days: 30

test-chrome:
needs: build-server
runs-on: ubuntu-latest
steps:
- uses: actions/checkout@v4
- uses: actions/setup-node@v4
with:
node-version: lts/*
- name: Install dependencies
run: npm install -g yarn && yarn
- name: Install Playwright
run: yarn playwright install --with-deps chromium
- name: Download server artifact
uses: actions/download-artifact@v4
with:
name: server-build
path: packages/app/.next # Adjust this path as needed
- name: Run Playwright tests on Chrome
run: |
cd packages/app
yarn playwright test --project=chromium
- uses: actions/upload-artifact@v4
if: always()
with:
name: playwright-report-chrome
path: packages/app/playwright-report/
retention-days: 30

0 comments on commit 7ff6460

Please sign in to comment.