-
Notifications
You must be signed in to change notification settings - Fork 54
129 lines (117 loc) · 3.83 KB
/
ci-frontend-e2e.yml
File metadata and controls
129 lines (117 loc) · 3.83 KB
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
121
122
123
124
125
126
127
128
129
name: E2E Tests (Local Github Target)
on:
push:
branches:
- "main"
paths:
- "api/**"
- "frontend/**"
- "infra/api/**"
- "infra/frontend/**"
- "infra/modules/**"
- ".github/workflows/ci-frontend-e2e.yml"
workflow_dispatch:
inputs:
api_logs:
description: "print api logs on failure?"
default: false
type: boolean
playwright_tags:
description: "pipe separated list of @tags denoting groups of tests to run"
required: false
type: string
workflow_call:
inputs:
api_logs:
description: "print api logs on failure?"
default: false
type: boolean
playwright_tags:
description: "pipe separated list of @tags denoting groups of tests to run"
required: false
type: string
pull_request:
paths:
- frontend/**
- .github/workflows/ci-frontend-e2e.yml
defaults:
run:
working-directory: ./frontend
env:
NODE_VERSION: 24
LOCKFILE_PATH: ./frontend/package-lock.json
PACKAGE_MANAGER: npm
NODE_OPTIONS: --dns-result-order=ipv4first
concurrency:
group: ${{ github.workflow }}-${{ github.ref }}
cancel-in-progress: true
jobs:
e2e-tests-local:
name: Run Local E2E Tests
runs-on: ubuntu-22.04
strategy:
fail-fast: true
matrix:
shard: [1, 2, 3, 4]
total_shards: [4]
steps:
- name: Checkout repository
uses: actions/checkout@v6
- name: Setup Node.js
uses: actions/setup-node@v6
with:
node-version: ${{ env.NODE_VERSION }}
cache: ${{ env.PACKAGE_MANAGER }}
cache-dependency-path: ${{ env.LOCKFILE_PATH }}
- name: Start API Server for e2e tests
run: |
cd ../api
# Enable core dumps for debugging segfaults
ulimit -c unlimited
mkdir -p /tmp/cores
echo "/tmp/cores/core.%e.%p.%t" | sudo tee /proc/sys/kernel/core_pattern
# Run init first to generate JWT keys in override.env
make init
# Now run the seeding and populate commands
echo "LOGIN_FINAL_DESTINATION=http://localhost:3000/api/auth/callback" >> override.env
make db-seed-local-with-agencies populate-search-opportunities populate-search-agencies start
cd ../frontend
# Ensure the API wait script is executable
chmod +x ../api/bin/wait-for-api.sh
../api/bin/wait-for-api.sh
shell: bash
- name: Install dependencies and Playwright
run: |
npm ci
npx playwright install --with-deps
- name: Build a prod version of the site
run: |
{
cat .env.development
sed -En '/API_JWT_PUBLIC_KEY/,/-----END PUBLIC KEY-----/p' ../api/override.env
cat ../api/e2e_token.tmp
} >> .env.local
# Use the 127.0.0.1 url for tests (IPv4 only)
sed -i 's|^SENDY_API_URL=.*|SENDY_API_URL=http://127.0.0.1:3000|' .env.local
npm run build
- name: Run E2E tests
uses: ./.github/actions/e2e
with:
version: ${{ github.ref }}
target: "local"
needs_node_setup: "false"
total_shards: ${{ matrix.total_shards }}
current_shard: ${{ matrix.shard }}
api_logs: ${{ inputs.api_logs && 'true' || 'false' }}
playwright_tags: ${{ inputs.playwright_tags }}
staging_test_user_email: ${{ secrets.STAGING_TEST_USER_EMAIL }}
staging_test_user_password: ${{ secrets.STAGING_TEST_USER_PASSWORD }}
staging_test_user_mfa_key: ${{ secrets.STAGING_TEST_USER_MFA_KEY }}
create-report:
name: Create Merged Test Report
if: ${{ !cancelled() }}
needs: e2e-tests-local
uses: ./.github/workflows/e2e-create-report.yml
secrets: inherit
with:
run_id: ${{ github.run_id }}