Skip to content

Commit

Permalink
chore: cache fixtures build in CI (#296)
Browse files Browse the repository at this point in the history
* chore: cache fixtures

* chore: also rebuild on changes to prepare.mjs
  • Loading branch information
Skn0tt authored Feb 26, 2024
1 parent 5b26311 commit 6255c5f
Showing 1 changed file with 12 additions and 0 deletions.
12 changes: 12 additions & 0 deletions .github/workflows/run-tests.yml
Original file line number Diff line number Diff line change
Expand Up @@ -82,7 +82,19 @@ jobs:
run: npm run build
- name: 'Lint'
run: npm run lint
- name: Compute Fixtures Cache Key
id: fixture-cache-key
# Fixtures only need to be rebuilt if anything in the tests/fixtures directory changes,
# so we're using a hash of the files in that directory as the cache key.
run: echo "key=$(git ls-files -s tests/fixtures/ tests/prepare.mjs | git hash-object --stdin)" >> "$GITHUB_OUTPUT"
- name: Cache Fixtures
id: cache-fixtures
uses: actions/cache@v4
with:
path: tests/fixtures
key: integration-fixtures-${{ runner.os }}-${{ steps.fixture-cache-key.outputs.key }}
- name: 'Prepare Fixtures'
if: steps.cache-fixtures.outputs.cache-hit != 'true'
run: npm run pretest
- name: 'Test'
run: npm run test:ci -- --shard=${{ matrix.shard }}

0 comments on commit 6255c5f

Please sign in to comment.