-
Notifications
You must be signed in to change notification settings - Fork 10
94 lines (88 loc) · 3.18 KB
/
test_frontend_e2e_live_prod.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
# Test Frontend deployment using Playwright End-to-End tests.
# todo: 1. run local: (i) start backend (a) local backend in GH action, or (b) use dev's backend URL (won't always work), (ii) set to on:pr&push
# todo: 2. after '1': expose params to workflow_dispatch: so can choose which env we want to test, in case we don't want to run all 3 at once
name: Test, Frontend Prod, Playwright E2E
on:
workflow_dispatch:
schedule:
- cron: '30 5 * * *' # every day 5:30am GMT (12:30/1:30am EST/EDT)
# push:
# branches: [ main, develop ]
# pull_request:
# branches: [ main, develop ]
jobs:
test:
timeout-minutes: 60
runs-on: ubuntu-latest
steps:
- uses: actions/checkout@v4
# 2024/12: Due to maintenance mode, we now only have 1 server. And the branch for deployment is basically = to both main and develop now. So we can just let this run on the default branch.
# with:
# ref: prod
- name: Setup Node.js
uses: actions/setup-node@v4
with:
node-version: '22.x'
cache: 'yarn'
cache-dependency-path: 'frontend/yarn.lock'
# Yarn Setup
# cache: 'yarn' # Enable yarn cache
# manual caching steps
- name: get yarn cache directory path
id: yarn-cache-dir-path
run: echo "::set-output name=dir::$(yarn cache dir)"
- uses: actions/cache@v3
with:
path: ${{ steps.yarn-cache-dir-path.outputs.dir }}
key: ${{ runner.os }}-yarn-${{ hashFiles('frontend/yarn.lock') }}
restore-keys: |
${{ runner.os }}-yarn-
- name: Install dependencies
# run: cd frontend && npm ci # only playwright is necessary to install
run: yarn install --frozen-lockfile # Equivalent to npm ci
working-directory: frontend
# Playwright setup
- name: Install Playwright browsers
run: yarn playwright install --with-deps # Use yarn to run playwright install
working-directory: frontend
- name: Re-configure for non-local web server
run: |
sed -n '/webServer: \[/,/\]/!p' playwright.config.js > tmp && mv tmp playwright.config.js
working-directory: frontend
# Run tests
- name: Run Playwright tests
run: make test-frontend-e2e-prod
- uses: actions/upload-artifact@v4
if: always()
with:
name: playwright-report
path: frontend/tests/playwright/playwright-report/
retention-days: 30
#name: Playwright Tests
#on:
# push:
# branches: [ main, master ]
# pull_request:
# branches: [ main, master ]
#jobs:
# test:
# timeout-minutes: 60
# runs-on: ubuntu-latest
# steps:
# - uses: actions/checkout@v3
# - uses: actions/setup-node@v3
# with:
# node-version: 18
# cache: 'yarn' # Enable yarn cache
# - name: Install dependencies
# run: yarn install --frozen-lockfile # Equivalent to npm ci
# - name: Install Playwright Browsers
# run: yarn playwright install --with-deps # Use yarn to run playwright install
# - name: Run Playwright tests
# run: yarn playwright test # Use yarn to run playwright test
# - uses: actions/upload-artifact@v4
# if: always()
# with:
# name: playwright-report
# path: playwright-report/
# retention-days: 30