-
-
Notifications
You must be signed in to change notification settings - Fork 0
46 lines (46 loc) · 1.84 KB
/
e2e.yml
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
name: E2E Tests
on:
workflow_dispatch:
pull_request:
branches: [main]
env:
CI: true
E2E_URL: ${{ github.event_name == 'workflow_dispatch' && vars.E2E_PRODUCTION_URL || vars.E2E_SELF_HOSTED_URL }}
E2E_COMMAND: ${{ github.event_name == 'workflow_dispatch' && 'yarn test:e2e' || 'yarn test:e2e:changed' }}
jobs:
e2e-tests:
name: Run E2E tests
timeout-minutes: 60
runs-on: ubuntu-latest
steps:
- uses: actions/checkout@v4
- name: Use Node.js version from .nvmrc
id: nvmrc
run: echo "NODE_VERSION=$(cat .nvmrc)" >> $GITHUB_ENV
- uses: actions/setup-node@v4
with:
node-version: ${{ env.NODE_VERSION }}
- name: Enable Corepack
run: corepack enable
- name: Get Yarn version from package.json
id: yarn_version
run: |
YARN_VERSION=$(jq -r '.packageManager' package.json | grep -o 'yarn@[0-9]*\.[0-9]*\.[0-9]*')
echo "YARN_VERSION=${YARN_VERSION}" >> $GITHUB_ENV
- name: Install correct Yarn version
run: corepack prepare ${{ env.YARN_VERSION }} --activate
- name: Install dependencies
run: yarn install --frozen-lockfile
- name: Install Playwright Browsers
run: yarn playwright install --with-deps
- name: Run E2E Tests
run: ${{ env.E2E_COMMAND }}
env:
CI: ${{ env.CI }}
E2E_URL: ${{ env.E2E_URL }}
- uses: actions/upload-artifact@v4
if: always()
with:
name: playwright-report
path: playwright-report/
retention-days: 30