Skip to content

Commit f102faf

Browse files
committed
Remove duplicated caching logic from workflows
1 parent ef64da4 commit f102faf

File tree

2 files changed

+6
-45
lines changed

2 files changed

+6
-45
lines changed

.github/workflows/ci.yml

Lines changed: 4 additions & 30 deletions
Original file line numberDiff line numberDiff line change
@@ -13,21 +13,8 @@ jobs:
1313
with:
1414
node-version: "lts/*"
1515
cache: 'npm'
16-
- name: Create Checksum of package.json
17-
run: echo PACKAGE_CHECKSUM="$(shasum package.json | awk '{ print $1 }')" >> "$GITHUB_ENV"
18-
- name: Restore Cache
19-
uses: actions/cache/restore@v4
20-
with:
21-
path: ./node_modules
22-
key: v1-dependencies-${{ env.PACKAGE_CHECKSUM }}
23-
- name: Install Dependencies
24-
run: npm install
25-
- name: Save Cache
26-
uses: actions/cache/save@v4
27-
id: cache
28-
with:
29-
path: ./node_modules
30-
key: v1-dependencies-${{ env.PACKAGE_CHECKSUM }}
16+
- name: install dependencies
17+
run: npm ci
3118
- name: lint javascript
3219
run: npm run lint
3320
test:
@@ -56,21 +43,8 @@ jobs:
5643
with:
5744
node-version: "lts/*"
5845
cache: 'npm'
59-
- name: Create Checksum of package.json
60-
run: echo PACKAGE_CHECKSUM="$(shasum package.json | awk '{ print $1 }')" >> "$GITHUB_ENV"
61-
- name: Restore Cache
62-
uses: actions/cache/restore@v4
63-
with:
64-
path: ./node_modules
65-
key: v1-dependencies-${{ env.PACKAGE_CHECKSUM }}
66-
- name: Install Dependencies
67-
run: npm install
68-
- name: Save Cache
69-
uses: actions/cache/save@v4
70-
id: cache
71-
with:
72-
path: ./node_modules
73-
key: v1-dependencies-${{ env.PACKAGE_CHECKSUM }}
46+
- name: install dependencies
47+
run: npm ci
7448
- name: run tests
7549
run: npm test
7650
deploy_dev:

.github/workflows/deploy.yml

Lines changed: 2 additions & 15 deletions
Original file line numberDiff line numberDiff line change
@@ -46,21 +46,8 @@ jobs:
4646
with:
4747
node-version: "lts/*"
4848
cache: 'npm'
49-
- name: Create Checksum of package.json
50-
run: echo PACKAGE_CHECKSUM="$(shasum package.json | awk '{ print $1 }')" >> "$GITHUB_ENV"
51-
- name: Restore Cache
52-
uses: actions/cache/restore@v4
53-
with:
54-
path: ./node_modules
55-
key: v1-dependencies-${{ env.PACKAGE_CHECKSUM }}
56-
- name: Install Dependencies
57-
run: npm install
58-
- name: Save Cache
59-
uses: actions/cache/save@v4
60-
id: cache
61-
with:
62-
path: ./node_modules
63-
key: v1-dependencies-${{ env.PACKAGE_CHECKSUM }}
49+
- name: install dependencies
50+
run: npm ci
6451
- name: Replace env vars in manifest.yml file
6552
run: |
6653
sudo apt-get update

0 commit comments

Comments
 (0)