Skip to content

Commit

Permalink
add npm ci and caching
Browse files Browse the repository at this point in the history
  • Loading branch information
bahmutov committed Nov 10, 2019
1 parent 22d80b4 commit ba181c7
Showing 1 changed file with 16 additions and 4 deletions.
20 changes: 16 additions & 4 deletions .github/workflows/main.yml
Original file line number Diff line number Diff line change
Expand Up @@ -5,12 +5,24 @@ jobs:
build-and-test:
runs-on: ubuntu-latest
name: Build and test
env:
# need environment variables for publishing new release
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }}
NPM_TOKEN: ${{ secrets.NPM_TOKEN }}
steps:
- name: Checkout
uses: actions/checkout@v1

# caching NPM dependencies
# https://github.com/actions/cache/blob/master/examples.md#node---npm
- uses: actions/cache@v1
with:
path: ~/.npm
key: ${{ runner.os }}-node-${{ hashFiles('**/package-lock.json') }}
restore-keys: |
${{ runner.os }}-node-
- run: node -v
- run: npm ci
- run: npm test
- run: npm run semantic-release
env:
# need environment variables for publishing new release
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }}
NPM_TOKEN: ${{ secrets.NPM_TOKEN }}

0 comments on commit ba181c7

Please sign in to comment.