Skip to content

Commit

Permalink
ci(workflows): add e2e test to ci
Browse files Browse the repository at this point in the history
  • Loading branch information
ymtech-labs committed Sep 3, 2023
1 parent 76dc4e2 commit fc68e05
Showing 1 changed file with 37 additions and 0 deletions.
37 changes: 37 additions & 0 deletions .github/workflows/ci.yml
Original file line number Diff line number Diff line change
Expand Up @@ -11,6 +11,7 @@ on:

jobs:
unit-test:
name: unit tests
runs-on: ubuntu-latest
steps:
- uses: actions/checkout@v3
Expand All @@ -30,3 +31,39 @@ jobs:

- name: Run unit tests
run: pnpm run test:unit
e2e_tests_setup:
name: setup end-to-end tests
runs-on: ubuntu-latest
outputs:
preview_url: ${{ steps.waitForVercelPreviewDeployment.outputs.url }}
steps:
- name: Wait for Vercel preview deployment to be ready
uses: patrickedqvist/wait-for-vercel-preview@v1.3.1
id: waitForVercelPreviewDeployment
with:
token: ${{ secrets.GITHUB_TOKEN }}
max_timeout: 600
e2e_tests:
needs: e2e_tests_setup
name: end-to-end tests
timeout-minutes: 60
runs-on: ubuntu-latest
steps:
- uses: actions/checkout@v3
- uses: actions/setup-node@v3
with:
node-version: 18
- name: Install dependencies
run: pnpm install
- name: Install Playwright Browsers
run: pnpm exec playwright install --with-deps
- name: Run Playwright tests
run: pnpm exec test:e2e
env:
E2E_TEST_BASE_URL: ${{ needs.e2e_tests_setup.outputs.preview_url }}
- uses: actions/upload-artifact@v3
if: always()
with:
name: playwright-report
path: playwright-report/
retention-days: 30

0 comments on commit fc68e05

Please sign in to comment.