Skip to content
Open
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
27 changes: 24 additions & 3 deletions .github/workflows/e2e.yml
Original file line number Diff line number Diff line change
Expand Up @@ -3,6 +3,8 @@ on:
workflow_dispatch:
pull_request:
branches: [develop]
env:
WAIT_ON_VERSION: '7'
jobs:
test-e2e:
environment: e2e-tests
Expand All @@ -16,7 +18,7 @@ jobs:
- name: Set up node
uses: actions/setup-node@v4
with:
node-version: '18.20.x'
node-version-file: '.nvmrc'
cache: 'npm'

- name: Create .env file
Expand All @@ -27,7 +29,15 @@ jobs:
with:
mongodb-version: '6.0'

- name: Cache node_modules
uses: actions/cache@v4
id: node-modules-cache
with:
path: node_modules
key: node-modules-${{ runner.os }}-node-${{ hashFiles('.nvmrc') }}-${{ hashFiles('package-lock.json') }}

- name: Install dependencies
if: steps.node-modules-cache.outputs.cache-hit != 'true'
run: npm ci

- name: Cache Playwright browsers
Expand All @@ -45,13 +55,24 @@ jobs:
if: steps.playwright-cache.outputs.cache-hit == 'true'
run: npx playwright install-deps chromium

- name: Cache wait-on
uses: actions/cache@v4
id: wait-on-cache
with:
path: ~/.npm/_npx
key: npx-wait-on-${{ env.WAIT_ON_VERSION }}-${{ runner.os }}

- name: Install wait-on
if: steps.wait-on-cache.outputs.cache-hit != 'true'
run: npx -y wait-on@$WAIT_ON_VERSION --version

Comment on lines +58 to +68

Copy link
Copy Markdown
Collaborator Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

previously we were doing the wait-on install in ln 103

I separated it in case cacheing it would help

I don't think it makes a huge difference (3s) but also doesn't hurt

- name: Start app
run: npm run start:e2e > app.log 2>&1 &

- name: Wait for app to be ready
run: |
npx wait-on@7 http://localhost:9000 --timeout 180000 || {
echo "::error::App failed to become ready at http://localhost:9000 within 180s"
npx wait-on@$WAIT_ON_VERSION http://localhost:8000 --timeout 180000 || {
echo "::error::App failed to become ready at http://localhost:8000 within 180s"
echo "----- app.log -----"
cat app.log
exit 1
Expand Down
27 changes: 22 additions & 5 deletions .github/workflows/test.yml
Original file line number Diff line number Diff line change
Expand Up @@ -7,12 +7,29 @@ jobs:
name: Test and lint code base
runs-on: ubuntu-latest
steps:
- uses: actions/checkout@v2
- name: Use Node.js
uses: actions/setup-node@v1
- name: Checkout code
uses: actions/checkout@v4

- name: Set up node
uses: actions/setup-node@v4
with:
node-version-file: '.nvmrc'
cache: 'npm'

- name: Create .env file
run: cp .env.example .env

- name: Cache node_modules
uses: actions/cache@v4
id: node-modules-cache
with:
node-version: '18.20.x'
- run: npm install
Comment on lines -10 to -15

@clairep94 clairep94 Jul 19, 2026

Copy link
Copy Markdown
Collaborator Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

checkout v2 and setup-node v1 are really old so I bumped them both up to 4 to match e2e.yml. Also wasn't sure if cache@v4 required these to be v4

path: node_modules
key: node-modules-${{ runner.os }}-node-${{ hashFiles('.nvmrc') }}-${{ hashFiles('package-lock.json') }}

- name: Install dependencies

Copy link
Copy Markdown
Collaborator

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Sorry if this is is something I could've noted earlier! I think I feel a little cautious about caching node_modulesbecause of the potential for consistency issues with cached installs. However, I don't think this is a major concern, especially since we want this to align with what we have ine2e.yml`, and the runtime improvements are nice!

if: steps.node-modules-cache.outputs.cache-hit != 'true'
run: npm ci

- run: npm run test
- run: npm run typecheck
- run: npm run lint
Loading