forked from shu8/cap-editor
-
Notifications
You must be signed in to change notification settings - Fork 0
53 lines (44 loc) · 1.36 KB
/
test-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
name: End-to-end tests
on:
push:
branches:
- "**"
pull_request:
jobs:
test-e2e:
runs-on: ubuntu-latest
steps:
- name: Checkout
uses: actions/checkout@v3
- uses: pnpm/action-setup@v3
with:
version: 8
run_install: |
- recursive: true
args: [--frozen-lockfile, --strict-peer-dependencies]
- name: Create test private key for signing alerts
run: ssh-keygen -m PKCS8 -t ecdsa -f $(pwd)/test-key
- name: Start Docker containers for testing
run: docker-compose -f docker-compose-test-e2e.yml up -d
- uses: actions/cache@v3
with:
path: ${{ github.workspace }}/.next/cache
key: ${{ runner.os }}-nextjs-${{ hashFiles('**/pnpm-lock.json') }}-${{ hashFiles('**.[jt]s', '**.[jt]sx') }}
restore-keys: |
${{ runner.os }}-nextjs-${{ hashFiles('**/pnpm-lock.json') }}-
- name: Build frontend
run: pnpm run build
env:
NODE_ENV: test
- name: Run end-to-end tests
run: |
# Run Next.js frontend in background
pnpm run start &
pnpm run test:e2e
env:
NODE_ENV: test
PRIVATE_KEY_FILENAME: test-key
- uses: actions/upload-artifact@v4
with:
name: 'coverage-e2e'
path: './coverage-e2e'