Skip to content

Commit

Permalink
use cache on test workflow
Browse files Browse the repository at this point in the history
  • Loading branch information
calintamas committed Mar 2, 2021
1 parent c179c42 commit 41c24b7
Show file tree
Hide file tree
Showing 2 changed files with 19 additions and 4 deletions.
2 changes: 0 additions & 2 deletions .github/workflows/publish.yml
Original file line number Diff line number Diff line change
Expand Up @@ -16,8 +16,6 @@ jobs:
- run: npm install -g yarn
- name: Install dependencies
run: yarn
# - name: Run tests
# run: yarn test
- id: publish
uses: JS-DevTools/npm-publish@v1
with:
Expand Down
21 changes: 19 additions & 2 deletions .github/workflows/tests.yml
Original file line number Diff line number Diff line change
Expand Up @@ -8,19 +8,36 @@ jobs:
steps:
- name: Checkout
uses: actions/checkout@v1

- name: Setup Node.js
uses: actions/setup-node@v1
with:
node-version: 12
- run: npm install -g yarn

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

- name: Restore yarn cache
uses: actions/cache@v2
id: yarn-cache # use this to check for `cache-hit` (`steps.yarn-cache.outputs.cache-hit != 'true'`)
with:
path: ${{ steps.yarn-cache-dir-path.outputs.dir }}
key: ${{ runner.os }}-yarn-${{ hashFiles('**/yarn.lock') }}
restore-keys: |
${{ runner.os }}-yarn-
- name: Install dependencies
run: yarn
run: yarn --prefer-offline

- name: Setup React Native environment
run: |
yarn add react-native@0.63.4
yarn add react@16.13.1
- name: Run tests
run: yarn test --coverage

- name: Coveralls
uses: coverallsapp/github-action@master
with:
Expand Down

0 comments on commit 41c24b7

Please sign in to comment.