Skip to content

Commit

Permalink
chore: use built in cache of actions/setup-node
Browse files Browse the repository at this point in the history
  • Loading branch information
SimenB committed Jul 12, 2021
1 parent 9f4f669 commit a4229bb
Show file tree
Hide file tree
Showing 2 changed files with 18 additions and 75 deletions.
2 changes: 1 addition & 1 deletion .github/workflows/lint.yml
Original file line number Diff line number Diff line change
Expand Up @@ -18,6 +18,6 @@ jobs:
steps:
- uses: actions/checkout@v2
- name: Danger
uses: danger/[email protected].4
uses: danger/[email protected].6
env:
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }}
91 changes: 17 additions & 74 deletions .github/workflows/nodejs.yml
Original file line number Diff line number Diff line change
Expand Up @@ -18,20 +18,11 @@ jobs:
steps:
- uses: actions/checkout@v2

- uses: actions/setup-node@v2.1.5
- uses: actions/setup-node@v2.2.0
with:
node-version: 14.x
cache: yarn

- name: Get yarn cache
id: yarn-cache
run: echo "::set-output name=dir::$(yarn config get cacheFolder)"

- uses: actions/[email protected]
with:
path: ${{ steps.yarn-cache.outputs.dir }}
key: yarn2-${{ hashFiles('yarn.lock') }}
restore-keys: |
yarn2-
- name: Validate cache
env:
# Use PnP and disable postinstall scripts as this just needs to
Expand All @@ -45,18 +36,10 @@ jobs:
runs-on: ubuntu-latest
steps:
- uses: actions/checkout@v2
- name: Get yarn cache
id: yarn-cache
run: echo "::set-output name=dir::$(yarn config get cacheFolder)"
- uses: actions/cache@v2
with:
path: ${{ steps.yarn-cache.outputs.dir }}
key: yarn2-${{ hashFiles('yarn.lock') }}
restore-keys: |
yarn2-
- uses: actions/[email protected]
- uses: actions/[email protected]
with:
node-version: 14.x
cache: yarn
- name: install
run: yarn
- name: run prettier
Expand All @@ -67,18 +50,10 @@ jobs:
runs-on: ubuntu-latest
steps:
- uses: actions/checkout@v2
- name: Get yarn cache
id: yarn-cache
run: echo "::set-output name=dir::$(yarn config get cacheFolder)"
- uses: actions/cache@v2
with:
path: ${{ steps.yarn-cache.outputs.dir }}
key: yarn2-${{ hashFiles('yarn.lock') }}
restore-keys: |
yarn2-
- uses: actions/[email protected]
- uses: actions/[email protected]
with:
node-version: 14.x
cache: yarn
- name: install
run: yarn
- name: run typecheck
Expand All @@ -87,7 +62,7 @@ jobs:
test-node:
name:
# prettier-ignore
Test on Node.js v${{ matrix.node-version }} and eslint v${{matrix.eslint-version }}
Test on Node.js v${{ matrix.node-version }} and eslint v${{ matrix.eslint-version }}
needs: prepare-yarn-cache
strategy:
fail-fast: false
Expand All @@ -98,23 +73,15 @@ jobs:

steps:
- uses: actions/checkout@v2
- name: Get yarn cache
id: yarn-cache
run: echo "::set-output name=dir::$(yarn config get cacheFolder)"
- uses: actions/cache@v2
with:
path: ${{ steps.yarn-cache.outputs.dir }}
key: yarn2-${{ hashFiles('yarn.lock') }}
restore-keys: |
yarn2-
- name: Use Node.js ${{ matrix.node-version }}
uses: actions/setup-node@v2.1.5
uses: actions/setup-node@v2.2.0
with:
node-version: ${{ matrix.node-version }}
- name: install with eslint v${{matrix.eslint-version }}
cache: yarn
- name: install with eslint v${{ matrix.eslint-version }}
run: |
yarn
yarn add --dev eslint@${{matrix.eslint-version }}
yarn add --dev eslint@${{ matrix.eslint-version }}
- name: run tests
# only collect coverage on eslint versions that support the suggestions api
run: yarn test --coverage ${{ matrix.eslint-version >= 6 }}
Expand All @@ -133,18 +100,10 @@ jobs:

steps:
- uses: actions/checkout@v2
- name: Get yarn cache
id: yarn-cache
run: echo "::set-output name=dir::$(yarn config get cacheFolder)"
- uses: actions/cache@v2
with:
path: ${{ steps.yarn-cache.outputs.dir }}
key: yarn2-${{ hashFiles('yarn.lock') }}
restore-keys: |
yarn2-
- uses: actions/[email protected]
- uses: actions/[email protected]
with:
node-version: 14.x
cache: yarn
- name: install
run: yarn
- name: run tests
Expand All @@ -158,18 +117,10 @@ jobs:
runs-on: ubuntu-latest
steps:
- uses: actions/checkout@v2
- name: Get yarn cache
id: yarn-cache
run: echo "::set-output name=dir::$(yarn config get cacheFolder)"
- uses: actions/cache@v2
with:
path: ${{ steps.yarn-cache.outputs.dir }}
key: yarn2-${{ hashFiles('yarn.lock') }}
restore-keys: |
yarn2-
- uses: actions/[email protected]
- uses: actions/[email protected]
with:
node-version: 14.x
cache: yarn
- name: install
run: yarn
- name: regenerate docs
Expand All @@ -189,18 +140,10 @@ jobs:
runs-on: ubuntu-latest
steps:
- uses: actions/checkout@v2
- name: Get yarn cache
id: yarn-cache
run: echo "::set-output name=dir::$(yarn config get cacheFolder)"
- uses: actions/cache@v2
with:
path: ${{ steps.yarn-cache.outputs.dir }}
key: yarn2-${{ hashFiles('yarn.lock') }}
restore-keys: |
yarn2-
- uses: actions/[email protected]
- uses: actions/[email protected]
with:
node-version: 14.x
cache: yarn
- name: install
run: yarn
- run: yarn semantic-release
Expand Down

0 comments on commit a4229bb

Please sign in to comment.