Skip to content

Commit 13bbc77

Browse files
authored
Build: Commit package-lock.json, improve caching in CI
Changes: 1. Commit package-lock.json. 2. Use cache settings built into `actions/setup-node`, drop `actions/cache` - it is simpler to maintain that way and it fixes Windows-specific issues. 3. Switch from `npm install` to `npm ci` in CI. 4. Update `actions/checkout` from v4.2.2 to v5.0.0. Closes gh-2369
1 parent beac2ea commit 13bbc77

File tree

5 files changed

+4591
-42
lines changed

5 files changed

+4591
-42
lines changed

.github/workflows/codeql-analysis.yml

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -20,7 +20,7 @@ jobs:
2020

2121
steps:
2222
- name: Checkout repository
23-
uses: actions/checkout@11bd71901bbe5b1630ceea73d27597364c9af683 # v4.2.2
23+
uses: actions/checkout@08c6903cd8c0fde910a37f88322edcfb5dd907a8 # v5.0.0
2424
with:
2525
# We must fetch at least the immediate parents so that if this is
2626
# a pull request then we can checkout the head.

.github/workflows/filestash.yml

Lines changed: 4 additions & 10 deletions
Original file line numberDiff line numberDiff line change
@@ -17,23 +17,17 @@ jobs:
1717
name: Update Filestash
1818
steps:
1919
- name: Checkout
20-
uses: actions/checkout@11bd71901bbe5b1630ceea73d27597364c9af683 # v4.2.2
20+
uses: actions/checkout@08c6903cd8c0fde910a37f88322edcfb5dd907a8 # v5.0.0
2121

2222
- name: Use Node.js ${{ env.NODE_VERSION }}
2323
uses: actions/setup-node@49933ea5288caeca8642d1e84afbd3f7d6820020 # v4.4.0
2424
with:
2525
node-version: ${{ env.NODE_VERSION }}
26-
27-
- name: Cache
28-
uses: actions/cache@5a3ec84eff668545956fd18022155c47e93e2684 # v4.2.3
29-
with:
30-
path: ~/.npm
31-
key: ${{ runner.os }}-node-${{ env.NODE_VERSION }}-npm-lock-${{ hashFiles('**/package-lock.json') }}
32-
restore-keys: |
33-
${{ runner.os }}-node-${{ env.NODE_VERSION }}-npm-lock-
26+
cache: npm
27+
cache-dependency-path: '**/package-lock.json'
3428

3529
- name: Install dependencies
36-
run: npm install
30+
run: npm ci
3731

3832
- name: Build
3933
run: npm run build

.github/workflows/node.js.yml

Lines changed: 12 additions & 30 deletions
Original file line numberDiff line numberDiff line change
@@ -31,23 +31,17 @@ jobs:
3131

3232
steps:
3333
- name: Checkout
34-
uses: actions/checkout@11bd71901bbe5b1630ceea73d27597364c9af683 # v4.2.2
34+
uses: actions/checkout@08c6903cd8c0fde910a37f88322edcfb5dd907a8 # v5.0.0
3535

3636
- name: Use Node.js ${{ env.NODE_VERSION }}
3737
uses: actions/setup-node@49933ea5288caeca8642d1e84afbd3f7d6820020 # v4.4.0
3838
with:
3939
node-version: ${{ env.NODE_VERSION }}
40-
41-
- name: Cache
42-
uses: actions/cache@5a3ec84eff668545956fd18022155c47e93e2684 # v4.2.3
43-
with:
44-
path: ~/.npm
45-
key: ${{ runner.os }}-node-${{ env.NODE_VERSION }}-npm-lock-${{ hashFiles('**/package-lock.json') }}
46-
restore-keys: |
47-
${{ runner.os }}-node-${{ env.NODE_VERSION }}-npm-lock-
40+
cache: npm
41+
cache-dependency-path: '**/package-lock.json'
4842

4943
- name: Install npm dependencies
50-
run: npm install
44+
run: npm ci
5145

5246
- name: Build
5347
run: npm run build
@@ -76,23 +70,17 @@ jobs:
7670
name: jQuery stable
7771
steps:
7872
- name: Checkout
79-
uses: actions/checkout@11bd71901bbe5b1630ceea73d27597364c9af683 # v4.2.2
73+
uses: actions/checkout@08c6903cd8c0fde910a37f88322edcfb5dd907a8 # v5.0.0
8074

8175
- name: Use Node.js ${{ env.NODE_VERSION }}
8276
uses: actions/setup-node@49933ea5288caeca8642d1e84afbd3f7d6820020 # v4.4.0
8377
with:
8478
node-version: ${{ env.NODE_VERSION }}
85-
86-
- name: Cache
87-
uses: actions/cache@5a3ec84eff668545956fd18022155c47e93e2684 # v4.2.3
88-
with:
89-
path: ~/.npm
90-
key: ${{ runner.os }}-node-${{ env.NODE_VERSION }}-npm-lock-${{ hashFiles('**/package-lock.json') }}
91-
restore-keys: |
92-
${{ runner.os }}-node-${{ env.NODE_VERSION }}-npm-lock-
79+
cache: npm
80+
cache-dependency-path: '**/package-lock.json'
9381

9482
- name: Install dependencies
95-
run: npm install
83+
run: npm ci
9684

9785
- name: Build
9886
run: npm run build
@@ -114,23 +102,17 @@ jobs:
114102
name: jQuery stable
115103
steps:
116104
- name: Checkout
117-
uses: actions/checkout@11bd71901bbe5b1630ceea73d27597364c9af683 # v4.2.2
105+
uses: actions/checkout@08c6903cd8c0fde910a37f88322edcfb5dd907a8 # v5.0.0
118106

119107
- name: Use Node.js ${{ env.NODE_VERSION }}
120108
uses: actions/setup-node@49933ea5288caeca8642d1e84afbd3f7d6820020 # v4.4.0
121109
with:
122110
node-version: ${{ env.NODE_VERSION }}
123-
124-
- name: Cache
125-
uses: actions/cache@5a3ec84eff668545956fd18022155c47e93e2684 # v4.2.3
126-
with:
127-
path: ~/.npm
128-
key: ${{ runner.os }}-node-${{ env.NODE_VERSION }}-npm-lock-${{ hashFiles('**/package-lock.json') }}
129-
restore-keys: |
130-
${{ runner.os }}-node-${{ env.NODE_VERSION }}-npm-lock-
111+
cache: npm
112+
cache-dependency-path: '**/package-lock.json'
131113

132114
- name: Install dependencies
133-
run: npm install
115+
run: npm ci
134116

135117
- name: Build
136118
run: npm run build

.gitignore

Lines changed: 0 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -2,5 +2,4 @@ dist
22
bower_components
33
node_modules
44
.sizecache.json
5-
package-lock.json
65
local.log

0 commit comments

Comments
 (0)