-
Notifications
You must be signed in to change notification settings - Fork 22
120 lines (100 loc) · 3.62 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
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
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
name: E2E
on:
workflow_dispatch:
schedule:
- cron: "0 9 * * *" # run every day at 9:00 UTC
push:
branches: [main]
pull_request:
env:
NEXT_PUBLIC_FEEDBACK_URL: ${{ secrets.NEXT_PUBLIC_FEEDBACK_URL }}
NEXT_PUBLIC_MACI_START_BLOCK: ${{ secrets.NEXT_PUBLIC_MACI_START_BLOCK }}
NEXT_PUBLIC_MACI_SUBGRAPH_URL: ${{ secrets.NEXT_PUBLIC_MACI_SUBGRAPH_URL }}
NEXT_PUBLIC_TOKEN_NAME: ${{ secrets.NEXT_PUBLIC_TOKEN_NAME }}
NEXT_PUBLIC_MAX_VOTES_TOTAL: ${{ secrets.NEXT_PUBLIC_MAX_VOTES_TOTAL }}
NEXT_PUBLIC_MAX_VOTES_PROJECT: ${{ secrets.NEXT_PUBLIC_MAX_VOTES_PROJECT }}
BLOB_READ_WRITE_TOKEN: ${{ secrets.BLOB_READ_WRITE_TOKEN }}
NEXT_PUBLIC_ALCHEMY_ID: ${{ secrets.NEXT_PUBLIC_ALCHEMY_ID }}
NEXT_PUBLIC_START_DATE: ${{ secrets.NEXT_PUBLIC_START_DATE }}
NEXT_PUBLIC_REGISTRATION_END_DATE: ${{ secrets.NEXT_PUBLIC_REGISTRATION_END_DATE }}
NEXT_PUBLIC_REVIEW_END_DATE: ${{ secrets.NEXT_PUBLIC_REVIEW_END_DATE }}
NEXT_PUBLIC_VOTING_END_DATE: ${{ secrets.NEXT_PUBLIC_VOTING_END_DATE }}
NEXT_PUBLIC_RESULTS_DATE: ${{ secrets.NEXT_PUBLIC_RESULTS_DATE }}
TEST_MNEMONIC: ${{ secrets.TEST_MNEMONIC }}
concurrency:
group: ${{ github.workflow }}-${{ github.ref }}
cancel-in-progress: true
jobs:
test:
strategy:
fail-fast: false
matrix:
node-version: [20]
timeout-minutes: 20
runs-on: ubuntu-latest
steps:
- uses: actions/checkout@v4
- uses: pnpm/action-setup@v4
with:
version: 9
- name: Use Node.js 20
uses: actions/setup-node@v4
with:
node-version: ${{ matrix.node-version }}
cache: "pnpm"
- name: Cache node modules
uses: actions/cache@v4
continue-on-error: true
with:
path: |
~/.pnpm-store
node_modules
key: ${{ runner.os }}-node-${{ hashFiles('**/pnpm-lock.yaml') }}
restore-keys: |
${{ runner.os }}-node-
- name: Get installed Playwright version
id: playwright-version
run: echo "PLAYWRIGHT_VERSION=$(node -e "console.log(require('./package.json').devDependencies['@playwright/test'])")" >> $GITHUB_ENV
- name: Install dependencies
run: |-
pnpm install --frozen-lockfile --prefer-offline
- name: Install Playwright Browsers
if: steps.playwright-cache.outputs.cache-hit != 'true'
run: |-
pnpm run install:deps
pnpm run install:chromium
working-directory: packages/e2e
- name: Install linux dependencies
run: |
sudo apt-get install --no-install-recommends -y \
xvfb
- name: Copy .env.example to .env (interface)
run: |
cp .env.example .env
working-directory: packages/interface
- name: Copy .env.example to .env (e2e)
run: |
cp .env.example .env
working-directory: packages/e2e
- name: Build
run: pnpm run build
- name: Run interface
run: pnpm run start &
working-directory: packages/interface
- name: Build cache
run: xvfb-run pnpm run build:cache
working-directory: packages/e2e
env:
NEXT_PUBLIC_ALCHEMY_ID: ${{ secrets.NEXT_PUBLIC_ALCHEMY_ID }}
- name: Run Playwright tests
run: xvfb-run pnpm run test:playwright:headful
working-directory: packages/e2e
env:
NEXT_PUBLIC_ALCHEMY_ID: ${{ secrets.NEXT_PUBLIC_ALCHEMY_ID }}
- uses: actions/upload-artifact@v4
if: always()
continue-on-error: true
with:
name: playwright-report
path: packages/e2e/playwright-report/
retention-days: 30