Skip to content

Commit

Permalink
chore: enable cache for npm on GitHub Actions (#629)
Browse files Browse the repository at this point in the history
Co-authored-by: Toru Kobayashi <koba0004@gmail.com>
  • Loading branch information
sosukesuzuki and koba04 committed Aug 10, 2021
1 parent bbe9c58 commit 0308dc2
Show file tree
Hide file tree
Showing 2 changed files with 32 additions and 31 deletions.
1 change: 1 addition & 0 deletions .github/workflows/lint.yml
Expand Up @@ -19,6 +19,7 @@ jobs:
uses: actions/setup-node@v2
with:
node-version: "14"
cache: "npm"

- name: Install dependencies
run: npm ci
Expand Down
62 changes: 31 additions & 31 deletions .github/workflows/test.yml
Expand Up @@ -4,7 +4,7 @@ on:
push:
branches:
- master
- 'renovate/**'
- "renovate/**"
pull_request:

jobs:
Expand All @@ -15,34 +15,34 @@ jobs:
strategy:
matrix:
node-version: [12.x, 14.x, 16.x]

steps:
- uses: actions/checkout@v2
- name: Use Node.js ${{ matrix.node-version }}
uses: actions/setup-node@v2
with:
node-version: ${{ matrix.node-version }}
- name: Install dependencies
run: npm ci
- name: Test
run: npm test
- name: Test examples
run: |
cd examples/build-and-serve
npm i
npm run build:ci
- name: Test in the oldest Google Closure Tools
run: |
npm i --no-save google-closure-compiler@20180910 google-closure-deps@20190325
OLDEST_COMPILER=1 npm run unit
- name: Test examples in the oldest Google Closure Tools
run: |
cd examples/build-and-serve
npm i --no-save google-closure-library@20180910
npm run build:ci
- name: Report coverage to codecov
if: matrix.node-version == '12.x'
env:
CODECOV_TOKEN: ${{ secrets.CODECOV_TOKEN }}
run: npx codecov

steps:
- uses: actions/checkout@v2
- name: Use Node.js ${{ matrix.node-version }}
uses: actions/setup-node@v2
with:
node-version: ${{ matrix.node-version }}
cache: "npm"
- name: Install dependencies
run: npm ci
- name: Test
run: npm test
- name: Test examples
run: |
cd examples/build-and-serve
npm i
npm run build:ci
- name: Test in the oldest Google Closure Tools
run: |
npm i --no-save google-closure-compiler@20180910 google-closure-deps@20190325
OLDEST_COMPILER=1 npm run unit
- name: Test examples in the oldest Google Closure Tools
run: |
cd examples/build-and-serve
npm i --no-save google-closure-library@20180910
npm run build:ci
- name: Report coverage to codecov
if: matrix.node-version == '12.x'
env:
CODECOV_TOKEN: ${{ secrets.CODECOV_TOKEN }}
run: npx codecov

0 comments on commit 0308dc2

Please sign in to comment.