From 5f08865d4aa8196304a3663e6cee450c539249bb Mon Sep 17 00:00:00 2001 From: Claire Peng Date: Sun, 19 Jul 2026 00:37:51 +0100 Subject: [PATCH 1/3] cache node_modules on e2e.yml --- .github/workflows/e2e.yml | 10 +++++++++- 1 file changed, 9 insertions(+), 1 deletion(-) diff --git a/.github/workflows/e2e.yml b/.github/workflows/e2e.yml index d3603cbbf9..557f7d6791 100644 --- a/.github/workflows/e2e.yml +++ b/.github/workflows/e2e.yml @@ -45,7 +45,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 @@ -56,7 +56,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 From 1b524deda6f449d1dddf87b0692ad9bf10e668df Mon Sep 17 00:00:00 2001 From: Claire Peng Date: Sun, 19 Jul 2026 00:46:18 +0100 Subject: [PATCH 2/3] update actions sources on test.yml and cache node_modules --- .github/workflows/test.yml | 27 ++++++++++++++++++++++----- 1 file changed, 22 insertions(+), 5 deletions(-) diff --git a/.github/workflows/test.yml b/.github/workflows/test.yml index 4a39783065..494de973d4 100644 --- a/.github/workflows/test.yml +++ b/.github/workflows/test.yml @@ -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 + 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 + - run: npm run test - run: npm run typecheck - run: npm run lint From fd2e0912f4fb6fa3828a1e77893a0d68035af8db Mon Sep 17 00:00:00 2001 From: Claire Peng Date: Sun, 19 Jul 2026 01:06:55 +0100 Subject: [PATCH 3/3] cache wait-on during e2e.yml --- .github/workflows/e2e.yml | 15 ++++++++++++++- 1 file changed, 14 insertions(+), 1 deletion(-) diff --git a/.github/workflows/e2e.yml b/.github/workflows/e2e.yml index 557f7d6791..df83d69fe8 100644 --- a/.github/workflows/e2e.yml +++ b/.github/workflows/e2e.yml @@ -5,6 +5,8 @@ on: branches: [develop] issue_comment: types: [created] +env: + WAIT_ON_VERSION: '7' jobs: test-e2e: # temporary while new e2e environment is not yet created: @@ -82,12 +84,23 @@ 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 + - name: Start app run: npm start > app.log 2>&1 & - name: Wait for app to be ready run: | - npx wait-on@7 http://localhost:8000 --timeout 180000 || { + 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