-
Notifications
You must be signed in to change notification settings - Fork 0
76 lines (63 loc) · 2.3 KB
/
e2e-tests.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
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
name: Tests E2E
on: deployment_status
jobs:
tests:
name: Tests E2E
timeout-minutes: 60
runs-on: ubuntu-latest
if: github.event_name == 'deployment_status' && github.event.deployment_status.state == 'success'
steps:
- name: 🚀 Checkout
uses: actions/checkout@v3
with:
persist-credentials: false
fetch-depth: 0
- name: 🎯 Read .nvmrc
run: echo "##[set-output name=NVMRC;]$(cat .nvmrc)"
id: nvm
- name: 🏗️ Setup Node.js
uses: actions/setup-node@v3
with:
node-version: '${{ steps.nvm.outputs.NVMRC }}'
- name: 📦 Setup pnpm - Install pnpm
uses: pnpm/action-setup@v2
with:
run_install: false
- name: 📦 Setup pnpm - Get pnpm store directory
shell: bash
run: |
echo "STORE_PATH=$(pnpm store path --silent)" >> $GITHUB_ENV
- name: 📦 Setup pnpm - Setup pnpm cache
uses: actions/cache@v3
with:
path: ${{ env.STORE_PATH }}
key: ${{ runner.os }}-pnpm-store-${{ hashFiles('**/pnpm-lock.yaml') }}
restore-keys: |
${{ runner.os }}-pnpm-store-
- name: 📦 Install dependencies
run: pnpm install
- name: 📦 Store Playwright's Version
run: |
PLAYWRIGHT_VERSION=$(pnpm ls @playwright/test | grep @playwright | sed 's/.*@//')
echo "Playwright's Version: $PLAYWRIGHT_VERSION"
echo "PLAYWRIGHT_VERSION=$PLAYWRIGHT_VERSION" >> $GITHUB_ENV
- name: 📦 Cache Playwright Browsers for Playwright's Version
id: cache-playwright-browsers
uses: actions/cache@v3
with:
path: ~/.cache/ms-playwright
key: playwright-browsers-${{ env.PLAYWRIGHT_VERSION }}
- name: 🌐 Install Playwright Browsers
if: steps.cache-playwright-browsers.outputs.cache-hit != 'true'
run: pnpm exec playwright install --with-deps
- name: 🎭 Run Playwright tests
run: pnpm test:e2e
env:
BASE_URL: ${{ github.event.deployment_status.target_url }}
- name: 📊 Upload Playwright Report
uses: actions/upload-artifact@v3
if: always()
with:
name: playwright-report
path: playwright-report/
retention-days: 30