Skip to content

Improve speed of CI tests with cacheing#4211

Open
clairep94 wants to merge 3 commits into
processing:developfrom
clairep94:clairep-cache_package_json_on_workflows
Open

Improve speed of CI tests with cacheing#4211
clairep94 wants to merge 3 commits into
processing:developfrom
clairep94:clairep-cache_package_json_on_workflows

Conversation

@clairep94

@clairep94 clairep94 commented Jul 18, 2026

Copy link
Copy Markdown
Collaborator

Issue:

Fixes #

  • e2e.yml has some cacheing but test.yml has none
  • These can both be improved in speed by cacheing node_modules
    • If anything in package-lock.json is updated, the cache is invalid & we do a full install instead

Demo:

test.yml before vs after hitting the node_modules cache
Screenshot 2026-07-19 at 01 01 58

e2e.yml before and after hitting the node_modules cache
Screenshot 2026-07-19 at 01 01 29

Changes:

I have verified that this pull request:

  • has no linting errors (npm run lint)
  • has no test errors (npm run test)
  • has no typecheck errors (npm run typecheck)
  • is from a uniquely-named feature branch and is up to date with the develop branch.
  • is descriptively named and links to an issue number, i.e. Fixes #123
  • meets the standards outlined in the accessibility guidelines

@clairep94 clairep94 changed the title cache node-modules on workflows runs Improve speed of CI tests with cacheing Jul 19, 2026
@clairep94
clairep94 marked this pull request as ready for review July 19, 2026 00:30
Comment thread .github/workflows/e2e.yml
Comment on lines +87 to +97
- 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

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

Comment on lines -10 to -15
- 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

@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

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant