Skip to content
This repository has been archived by the owner on Apr 26, 2024. It is now read-only.

Commit

Permalink
chore: Use caching in setup-node
Browse files Browse the repository at this point in the history
NPM caching is now built into setup-node, so the manual cache can be removed
Use the top level v2 checkout at the same time
  • Loading branch information
nschonni committed Nov 1, 2021
1 parent 03111fa commit e4a6a3d
Show file tree
Hide file tree
Showing 5 changed files with 11 additions and 19 deletions.
2 changes: 1 addition & 1 deletion .github/workflows/cleanup-staging.yml
Original file line number Diff line number Diff line change
Expand Up @@ -8,7 +8,7 @@ jobs:
build:
runs-on: ubuntu-latest
steps:
- uses: actions/checkout@v2.3.5
- uses: actions/checkout@v2

- name: Setup GCloud
uses: google-github-actions/setup-gcloud@master
Expand Down
11 changes: 4 additions & 7 deletions .github/workflows/gatsby.yml
Original file line number Diff line number Diff line change
Expand Up @@ -6,17 +6,14 @@ jobs:
test-ci:
runs-on: ubuntu-latest
steps:
- uses: actions/checkout@v2.3.5
- uses: actions/checkout@v2

- uses: actions/cache@v2.1.6
- name: Set up Node.js
uses: actions/setup-node@v2
with:
path: ~/.npm
key: ${{ runner.os }}-node-${{ hashFiles('**/package-lock.json') }}
restore-keys: |
${{ runner.os }}-node-
cache: npm

- name: Install Dependencies
if: steps.cache.outputs.cache-hit != 'true'
run: npm ci

- name: Run test and coverage
Expand Down
2 changes: 1 addition & 1 deletion .github/workflows/generate-preview.yml
Original file line number Diff line number Diff line change
Expand Up @@ -10,7 +10,7 @@ jobs:
if: github.event.label.name == 'create-preview'
steps:

- uses: actions/checkout@v2.3.5
- uses: actions/checkout@v2
with:
ref: ${{ github.event.pull_request.head.sha }}

Expand Down
13 changes: 4 additions & 9 deletions .github/workflows/test.yml
Original file line number Diff line number Diff line change
Expand Up @@ -10,19 +10,14 @@ jobs:
test-ci:
runs-on: ubuntu-latest
steps:
- uses: actions/checkout@v2.3.5
- uses: actions/checkout@v2

- uses: actions/setup-node@v2.4.1

- uses: actions/cache@v2.1.6
- name: Set up Node.js
uses: actions/setup-node@v2
with:
path: ~/.npm
key: ${{ runner.os }}-node-${{ hashFiles('**/package-lock.json') }}
restore-keys: |
${{ runner.os }}-node-
cache: npm

- name: Install Dependencies
if: steps.cache.outputs.cache-hit != 'true'
run: npm ci

- name: Run linting
Expand Down
2 changes: 1 addition & 1 deletion .github/workflows/upload-to-staging.yml
Original file line number Diff line number Diff line change
Expand Up @@ -9,7 +9,7 @@ jobs:
runs-on: ubuntu-latest
if: github.event.issue.pull_request != null && github.event.comment.body == '/preview'
steps:
- uses: actions/checkout@v2.3.5
- uses: actions/checkout@v2

- name: Checkout Git Branch
run: |
Expand Down

0 comments on commit e4a6a3d

Please sign in to comment.