Skip to content

Commit 8e76d8f

Browse files
authored
ci: using built-in caching from setup-node (#1501)
1 parent 2a05e29 commit 8e76d8f

File tree

4 files changed

+24
-60
lines changed

4 files changed

+24
-60
lines changed

.github/workflows/ci.yml

Lines changed: 12 additions & 32 deletions
Original file line numberDiff line numberDiff line change
@@ -10,13 +10,8 @@ jobs:
1010
- uses: Brightspace/third-party-actions@actions/setup-node
1111
with:
1212
node-version: '14'
13-
- uses: Brightspace/third-party-actions@actions/cache
14-
id: cache
15-
with:
16-
path: '**/node_modules'
17-
key: npm-${{ hashFiles('**/package-lock.json') }}
13+
cache: 'npm'
1814
- name: Install dependencies
19-
if: steps.cache.outputs.cache-hit != 'true'
2015
run: npm ci
2116
- name: Build
2217
run: npm run build
@@ -35,13 +30,8 @@ jobs:
3530
- uses: Brightspace/third-party-actions@actions/setup-node
3631
with:
3732
node-version: '14'
38-
- uses: Brightspace/third-party-actions@actions/cache
39-
id: cache
40-
with:
41-
path: '**/node_modules'
42-
key: npm-${{ hashFiles('**/package-lock.json') }}
33+
cache: 'npm'
4334
- name: Install dependencies
44-
if: steps.cache.outputs.cache-hit != 'true'
4535
run: npm ci
4636
- name: Build
4737
run: npm run build
@@ -56,23 +46,18 @@ jobs:
5646
- uses: Brightspace/third-party-actions@actions/setup-node
5747
with:
5848
node-version: '14'
59-
- uses: Brightspace/third-party-actions@actions/cache
60-
id: cache
61-
with:
62-
path: '**/node_modules'
63-
key: npm-${{ hashFiles('**/package-lock.json') }}
49+
cache: 'npm'
6450
- name: Install dependencies
65-
if: steps.cache.outputs.cache-hit != 'true'
66-
run: npm ci
51+
run: |
52+
npm ci
53+
npm install karma-browserstack-launcher@1 --no-save
6754
- name: Build
6855
run: npm run build
6956
- name: BrowserStack
7057
env:
7158
BROWSERSTACK_USERNAME: ${{ secrets.BROWSERSTACK_USERNAME }}
7259
BROWSERSTACK_ACCESS_KEY: ${{ secrets.BROWSERSTACK_ACCESS_KEY }}
73-
run: |
74-
npm install karma-browserstack-launcher@1 --no-save
75-
npx karma start karma.bs.conf.js
60+
run: npx karma start karma.bs.conf.js
7661
sauce:
7762
name: Unit Tests (SauceLabs)
7863
timeout-minutes: 10
@@ -83,20 +68,15 @@ jobs:
8368
- uses: Brightspace/third-party-actions@actions/setup-node
8469
with:
8570
node-version: '14'
86-
- uses: Brightspace/third-party-actions@actions/cache
87-
id: cache
88-
with:
89-
path: '**/node_modules'
90-
key: npm-${{ hashFiles('**/package-lock.json') }}
71+
cache: 'npm'
9172
- name: Install dependencies
92-
if: steps.cache.outputs.cache-hit != 'true'
93-
run: npm ci
73+
run: |
74+
npm ci
75+
npm install karma-sauce-launcher@2 --no-save
9476
- name: Build
9577
run: npm run build
9678
- name: SauceLabs
9779
env:
9880
SAUCE_USERNAME: Gaudi1
9981
SAUCE_ACCESS_KEY: ${{ secrets.SAUCE_ACCESS_KEY_GAUDI }}
100-
run: |
101-
npm install karma-sauce-launcher@2 --no-save
102-
npx karma start karma.sauce.conf.js
82+
run: npx karma start karma.sauce.conf.js

.github/workflows/license-checker.yml

Lines changed: 4 additions & 9 deletions
Original file line numberDiff line numberDiff line change
@@ -10,15 +10,10 @@ jobs:
1010
- uses: Brightspace/third-party-actions@actions/setup-node
1111
with:
1212
node-version: '14'
13-
- uses: Brightspace/third-party-actions@actions/cache
14-
id: cache
15-
with:
16-
path: '**/node_modules'
17-
key: npm-${{ hashFiles('**/package-lock.json') }}
13+
cache: 'npm'
1814
- name: Install dependencies
19-
if: steps.cache.outputs.cache-hit != 'true'
20-
run: npm ci
21-
- name: Check License
2215
run: |
16+
npm ci
2317
npm install d2l-license-checker@4 --no-save
24-
npx d2l-license-checker -p
18+
- name: Check License
19+
run: npx d2l-license-checker -p

.github/workflows/release.yml

Lines changed: 4 additions & 9 deletions
Original file line numberDiff line numberDiff line change
@@ -18,16 +18,11 @@ jobs:
1818
- uses: Brightspace/third-party-actions@actions/setup-node
1919
with:
2020
node-version: '14'
21-
- uses: Brightspace/third-party-actions@actions/cache
22-
id: cache
23-
with:
24-
path: '**/node_modules'
25-
key: npm-${{ hashFiles('**/package-lock.json') }}
21+
cache: 'npm'
2622
- name: Install dependencies
27-
if: steps.cache.outputs.cache-hit != 'true'
28-
run: npm ci
29-
- name: Install analyzer
30-
run: npm i web-component-analyzer --no-save
23+
run: |
24+
npm ci
25+
npm install web-component-analyzer --no-save
3126
- name: Build
3227
run: npm run build
3328
- name: Create custom-elements.json

.github/workflows/visual-diff.yml

Lines changed: 4 additions & 10 deletions
Original file line numberDiff line numberDiff line change
@@ -10,20 +10,14 @@ jobs:
1010
- uses: Brightspace/third-party-actions@actions/setup-node
1111
with:
1212
node-version: '14'
13-
- uses: Brightspace/third-party-actions@actions/cache
14-
id: cache
15-
with:
16-
path: '**/node_modules'
17-
key: npm-${{ hashFiles('**/package-lock.json') }}
13+
cache: 'npm'
1814
- name: Install dependencies
19-
if: steps.cache.outputs.cache-hit != 'true'
20-
run: npm ci
21-
- name: Build
22-
run: npm run build
23-
- name: Install ko
2415
run: |
16+
npm ci
2517
sudo apt-get install language-pack-ko
2618
sudo apt-get install korean*
19+
- name: Build
20+
run: npm run build
2721
- name: Visual Diff Tests
2822
uses: BrightspaceUI/actions/visual-diff@master
2923
with:

0 commit comments

Comments
 (0)