-
-
Notifications
You must be signed in to change notification settings - Fork 913
65 lines (53 loc) · 1.73 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
name: e2e tests
on:
push:
branches:
- main
pull_request:
branches:
- main
env:
WASP_TELEMETRY_DISABLE: 1
jobs:
test:
runs-on: ubuntu-latest
steps:
- name: Checkout the repo
uses: actions/checkout@v4
- name: Setup Node.js
id: setup-node
uses: actions/setup-node@v4
with:
node-version: '20'
- name: Install Wasp
run: curl -sSL https://get.wasp-lang.dev/installer.sh | sh -s -- -v 0.13.0
- name: Docker setup
uses: docker/setup-buildx-action@v3
- name: Cache Node Modules
uses: actions/cache@v4
with:
path: ~/.npm
key: ${{ runner.os }}-node${{ steps.setup-node.outputs.node-version }}-node-modules-${{ hashFiles('app/package-lock.json') }}
# In order for the app to run we need to set env vars even if they aren't used
# this step sets mock env vars to pass the validation steps so the app can run
# in the CI environment. For vars that are actually used in tests, we set them in
# the GitHub secrets settings and access them in a step below.
- name: Setup Dummy Env Vars
run: |
cd app
cp .env.server.example .env.server
- name: Install Node.js dependencies for Playwright tests
run: |
cd e2e-tests
npm ci
- name: Set up Playwright
run: |
cd e2e-tests
npx playwright install --with-deps
- name: Run Playwright tests
env:
# The e2e tests are testing parts of the app that need OPENAI_API_KEY, so we need to set it here.
OPENAI_API_KEY: ${{ secrets.OPENAI_API_KEY }}
run: |
cd e2e-tests
npm run e2e:playwright:debug