Skip to content

Commit 426fba4

Browse files
WIP github action for running services.
1 parent 52011fe commit 426fba4

File tree

21 files changed

+275
-76
lines changed

21 files changed

+275
-76
lines changed

.github/workflows/deploy-builder-api.yml

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -50,7 +50,7 @@ jobs:
5050
path: ~/.m2/repository
5151
key: ${{ runner.os }}-maven-${{ hashFiles('builder-api/pom.xml') }}
5252
restore-keys: |
53-
${{ runner.os }}-maven-
53+
${{ runner.os }}-maven-${{ hashFiles('builder-api/pom.xml') }}
5454
5555
# Configure Workload Identity Federation and generate an access token
5656
- id: 'auth'
Lines changed: 123 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,123 @@
1+
name: Run E2e Tests
2+
on:
3+
push:
4+
branches: [ main, master ]
5+
pull_request:
6+
branches: [ main, master ]
7+
8+
env:
9+
PROJECT_ID: 'benefit-decision-toolkit-play'
10+
WORKLOAD_IDENTITY_PROVIDER: 'projects/1034049717668/locations/global/workloadIdentityPools/github-actions-google-cloud/providers/github'
11+
12+
jobs:
13+
run-e2e-tests:
14+
runs-on: 'ubuntu-latest'
15+
16+
# Add these permissions for Workload Identity Federation
17+
permissions:
18+
contents: read
19+
id-token: write
20+
21+
steps:
22+
- name: Checkout repository
23+
uses: actions/checkout@v4
24+
25+
- uses: actions/setup-node@v4
26+
with:
27+
node-version: lts/*
28+
29+
# Devbox Setup #
30+
- name: 'Create .env file' # Devbox needs a .env file to exist, even if it's empty
31+
run: touch .env
32+
33+
- name: Rename env files
34+
run: |
35+
mv builder-frontend/.env.example builder-frontend/.env
36+
mv builder-api/.env.example builder-api/.env
37+
38+
- name: 'Install devbox' # Setup devbox which includes Node.js, Firebase CLI, and Google Cloud SDK
39+
uses: 'jetify-com/[email protected]'
40+
with:
41+
enable-cache: true
42+
43+
# Cache Maven dependencies to speed up builds
44+
- name: 'Cache Maven dependencies'
45+
uses: 'actions/cache@v4'
46+
with:
47+
path: ~/.m2/repository
48+
key: ${{ runner.os }}-maven-${{ hashFiles('builder-api/pom.xml') }}
49+
restore-keys: |
50+
${{ runner.os }}-maven-
51+
52+
- id: 'auth' # Configure Workload Identity Federation and generate an access token
53+
name: 'Authenticate to Google Cloud'
54+
uses: 'google-github-actions/auth@v2'
55+
with:
56+
workload_identity_provider: '${{ env.WORKLOAD_IDENTITY_PROVIDER }}'
57+
service_account: cicd-build-deploy-api@benefit-decision-toolkit-play.iam.gserviceaccount.com
58+
project_id: ${{ env.PROJECT_ID }}
59+
60+
- name: Cache node modules
61+
uses: actions/cache@v4
62+
with:
63+
path: builder-frontend/node_modules
64+
key: ${{ runner.os }}-node-${{ hashFiles('builder-frontend/package-lock.json') }}
65+
restore-keys: |
66+
${{ runner.os }}-node-
67+
68+
- name: Install frontend dependencies
69+
working-directory: builder-frontend
70+
run: devbox run install-builder-frontend-ci
71+
72+
- name: Load E2E emulator data
73+
run: |
74+
rm -rf emulator-data
75+
cp -r e2e/e2e-emulator-data emulator-data
76+
77+
- name: Run all Devbox services
78+
run: devbox services up -b
79+
continue-on-error: true
80+
81+
# E2E Testing #
82+
- name: Install Playwright dependencies
83+
run: npm ci
84+
working-directory: e2e
85+
86+
- name: Install Playwright Browsers
87+
run: npx playwright install --with-deps
88+
working-directory: e2e
89+
90+
- name: Wait for Firebase emulators to be available
91+
uses: nev7n/wait_for_response@v1
92+
with:
93+
url: 'http://localhost:4000/'
94+
responseCode: 200
95+
timeout: 90000
96+
interval: 1000
97+
continue-on-error: true
98+
99+
- name: Wait for App to be available
100+
uses: nev7n/wait_for_response@v1
101+
with:
102+
url: 'http://localhost:5173/'
103+
responseCode: 200
104+
timeout: 90000
105+
interval: 1000
106+
continue-on-error: true
107+
108+
- name: Run Playwright tests
109+
run: npx playwright test
110+
working-directory: e2e
111+
continue-on-error: true
112+
113+
- uses: actions/upload-artifact@v4
114+
if: ${{ !cancelled() }}
115+
with:
116+
name: playwright-report
117+
path: e2e/playwright-report/
118+
retention-days: 30
119+
120+
# Devbox Cleanup #
121+
- name: Stop all Devbox services
122+
run: devbox services stop
123+
continue-on-error: true

devbox.json

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -7,7 +7,8 @@
77
"firebase-tools@latest",
88
"google-cloud-sdk@latest",
99
"nodejs@22",
10-
"bruno-cli@latest"
10+
"bruno-cli@latest",
11+
"process-compose@latest"
1112
],
1213
"env_from": ".env",
1314
"shell": {

devbox.lock

Lines changed: 48 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -314,6 +314,54 @@
314314
}
315315
}
316316
},
317+
"process-compose@latest": {
318+
"last_modified": "2025-11-23T21:50:36Z",
319+
"resolved": "github:NixOS/nixpkgs/ee09932cedcef15aaf476f9343d1dea2cb77e261#process-compose",
320+
"source": "devbox-search",
321+
"version": "1.78.0",
322+
"systems": {
323+
"aarch64-darwin": {
324+
"outputs": [
325+
{
326+
"name": "out",
327+
"path": "/nix/store/d00iad83k88x0fq045h5pzhfj9ibdd3a-process-compose-1.78.0",
328+
"default": true
329+
}
330+
],
331+
"store_path": "/nix/store/d00iad83k88x0fq045h5pzhfj9ibdd3a-process-compose-1.78.0"
332+
},
333+
"aarch64-linux": {
334+
"outputs": [
335+
{
336+
"name": "out",
337+
"path": "/nix/store/zx59c11mchqfjpl0yvv2fad87pf3p8mn-process-compose-1.78.0",
338+
"default": true
339+
}
340+
],
341+
"store_path": "/nix/store/zx59c11mchqfjpl0yvv2fad87pf3p8mn-process-compose-1.78.0"
342+
},
343+
"x86_64-darwin": {
344+
"outputs": [
345+
{
346+
"name": "out",
347+
"path": "/nix/store/hwipxpsgzpv8d51xvqdjyx3vbzaaf3rr-process-compose-1.78.0",
348+
"default": true
349+
}
350+
],
351+
"store_path": "/nix/store/hwipxpsgzpv8d51xvqdjyx3vbzaaf3rr-process-compose-1.78.0"
352+
},
353+
"x86_64-linux": {
354+
"outputs": [
355+
{
356+
"name": "out",
357+
"path": "/nix/store/vw9d8v9r0kp44lmizysj7idmqyf9747l-process-compose-1.78.0",
358+
"default": true
359+
}
360+
],
361+
"store_path": "/nix/store/vw9d8v9r0kp44lmizysj7idmqyf9747l-process-compose-1.78.0"
362+
}
363+
}
364+
},
317365
"quarkus@latest": {
318366
"last_modified": "2025-08-11T16:06:55Z",
319367
"resolved": "github:NixOS/nixpkgs/4e942f9ef5b35526597c354d1ded817d1c285ef1#quarkus",

e2e/.github/workflows/playwright.yml

Lines changed: 0 additions & 27 deletions
This file was deleted.

e2e/.gitignore

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -6,3 +6,4 @@ node_modules/
66
/blob-report/
77
/playwright/.cache/
88
/playwright/.auth/
9+
/.auth/
Lines changed: 25 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,25 @@
1+
{
2+
"kind": "identitytoolkit#DownloadAccountResponse",
3+
"users": [
4+
{
5+
"localId": "E2uB0h1FpSUKq5rGObr9jvmbn15E",
6+
"lastLoginAt": "1766942325287",
7+
"emailVerified": false,
8+
"email": "[email protected]",
9+
"salt": "fakeSaltirMZBjlsDBLmp2MfKjTv",
10+
"passwordHash": "fakeHash:salt=fakeSaltirMZBjlsDBLmp2MfKjTv:password=testpassword123",
11+
"passwordUpdatedAt": 1766942325288,
12+
"validSince": "1766942325",
13+
"createdAt": "1766942325287",
14+
"providerUserInfo": [
15+
{
16+
"providerId": "password",
17+
"email": "[email protected]",
18+
"federatedId": "[email protected]",
19+
"rawId": "[email protected]"
20+
}
21+
],
22+
"lastRefreshAt": "2025-12-28T17:18:45.288Z"
23+
}
24+
]
25+
}
Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1 @@
1+
{"signIn":{"allowDuplicateEmails":false},"emailPrivacyConfig":{"enableImprovedEmailPrivacy":false}}
Lines changed: 16 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,16 @@
1+
{
2+
"version": "14.11.2",
3+
"firestore": {
4+
"version": "1.19.8",
5+
"path": "firestore_export",
6+
"metadata_file": "firestore_export/firestore_export.overall_export_metadata"
7+
},
8+
"auth": {
9+
"version": "14.11.2",
10+
"path": "auth_export"
11+
},
12+
"storage": {
13+
"version": "14.11.2",
14+
"path": "storage_export"
15+
}
16+
}

0 commit comments

Comments
 (0)