Skip to content

Commit

Permalink
Update github actions to cache yarn (Turfjs#2113)
Browse files Browse the repository at this point in the history
* Update github actions to cache yarn

Right now the yarn install time takes up over half of our build time, this will probably cut that down dramatically. I copy pasted it directly from their examples: https://github.com/actions/cache/blob/main/examples.md#node---yarn

* wrecked by prettier

Co-authored-by: Matt Fedderly <[email protected]>
  • Loading branch information
mfedderly and mfedderly authored Jun 22, 2021
1 parent 96f0c2c commit a814ba2
Showing 1 changed file with 15 additions and 0 deletions.
15 changes: 15 additions & 0 deletions .github/workflows/turf.yml
Original file line number Diff line number Diff line change
Expand Up @@ -20,5 +20,20 @@ jobs:
uses: actions/setup-node@v1
with:
node-version: ${{ matrix.node-version }}

# figure out the yarn cache directory
- name: Get yarn cache directory path
id: yarn-cache-dir-path
run: echo "::set-output name=dir::$(yarn cache dir)"

# cache the yarn data to speed up builds
- uses: actions/cache@v2
id: yarn-cache
with:
path: ${{ steps.yarn-cache-dir-path.outputs.dir }}
key: ${{ runner.os }}-yarn-${{ hashFiles('**/yarn.lock') }}
restore-keys: |
${{ runner.os }}-yarn-
- run: yarn --frozen-lockfile
- run: yarn test

0 comments on commit a814ba2

Please sign in to comment.