Skip to content
Closed
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
13 changes: 11 additions & 2 deletions .github/workflows/test.yml
Original file line number Diff line number Diff line change
Expand Up @@ -30,10 +30,10 @@ jobs:
- name: Setup Node
uses: ./.github/actions/composite/setupNode

- name: Cache Jest cache
- name: Restore Jest cache
id: cache-jest-cache
# v5.0.1
uses: actions/cache@9255dc7a253b0ccc959486e2bca901246202afeb
uses: actions/cache/restore@9255dc7a253b0ccc959486e2bca901246202afeb
with:
path: .jest-cache
# Per-shard key: each shard only instruments the ~1/8 of suites it runs, so a single
Expand All @@ -45,6 +45,15 @@ jobs:
- name: Jest tests
run: npm test -- --silent --shard=${{ fromJSON(matrix.chunk) }}/${{ strategy.job-total }} --maxWorkers=6 --coverage --coverageDirectory=coverage/shard-${{ matrix.chunk }}

# Saves even when tests fail, so a shard that timed out on a cold cache runs warm next time.
- name: Save Jest cache
if: ${{ always() && steps.cache-jest-cache.outputs.cache-hit != 'true' }}
# v5.0.1
uses: actions/cache/save@9255dc7a253b0ccc959486e2bca901246202afeb
with:
path: .jest-cache
key: ${{ steps.cache-jest-cache.outputs.cache-primary-key }}

- name: Upload coverage to Codecov (PRs - tokenless)
if: ${{ github.event_name == 'pull_request' }}
# v7
Expand Down
Loading