-
-
Notifications
You must be signed in to change notification settings - Fork 1.7k
Improve speed of CI tests with cacheing #4211
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
base: develop
Are you sure you want to change the base?
Changes from all commits
5f08865
1b524de
fd2e091
246f190
File filter
Filter by extension
Conversations
Jump to
Diff view
Diff view
There are no files selected for viewing
| Original file line number | Diff line number | Diff line change |
|---|---|---|
|
|
@@ -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
Collaborator
Author
There was a problem hiding this comment. Choose a reason for hiding this commentThe 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 | ||
|
Collaborator
There was a problem hiding this comment. Choose a reason for hiding this commentThe 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 |
||
| if: steps.node-modules-cache.outputs.cache-hit != 'true' | ||
| run: npm ci | ||
|
|
||
| - run: npm run test | ||
| - run: npm run typecheck | ||
| - run: npm run lint | ||
There was a problem hiding this comment.
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