Skip to content

Commit b1c47b6

Browse files
committed
CI: cache npm packages between runs
Every android-test and ios-test job runs "npm install" from scratch, re-downloading the full dependency tree on every run. Cache ~/.npm keyed on package-lock.json and test/test.ts (whose changes can alter installed test-app dependencies), with an OS-scoped restore-key fallback for partial hits.
1 parent 431fe6a commit b1c47b6

1 file changed

Lines changed: 18 additions & 0 deletions

File tree

.github/workflows/ci-test.yml

Lines changed: 18 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -37,6 +37,15 @@ jobs:
3737

3838
- uses: jdx/mise-action@v4
3939

40+
- name: Cache npm packages
41+
uses: actions/cache@v6
42+
with:
43+
path: ~/.npm
44+
# Note about test.ts: some NPM package versions are hardcoded here and installed during the test run.
45+
key: ${{ runner.os }}-npm-${{ hashFiles('package-lock.json', 'test/test.ts') }}
46+
restore-keys: |
47+
${{ runner.os }}-npm-
48+
4049
- name: Install dependencies
4150
run: npm install
4251

@@ -76,6 +85,15 @@ jobs:
7685

7786
- uses: jdx/mise-action@v4
7887

88+
- name: Cache npm packages
89+
uses: actions/cache@v6
90+
with:
91+
path: ~/.npm
92+
# Note about test.ts: some NPM package versions are hardcoded here and installed during the test run.
93+
key: ${{ runner.os }}-npm-${{ hashFiles('package-lock.json', 'test/test.ts') }}
94+
restore-keys: |
95+
${{ runner.os }}-npm-
96+
7997
- name: Run iOS Tests
8098
run: |
8199
npm install

0 commit comments

Comments
 (0)