Skip to content

Merge pull request #3 from DuncanMcPherson/coverage-and-readme #3

Merge pull request #3 from DuncanMcPherson/coverage-and-readme

Merge pull request #3 from DuncanMcPherson/coverage-and-readme #3

Workflow file for this run

name: 'Deploy package to npm'
on:
push:
branches:
- master
env:
NPM_TOKEN: ${{ secrets.NPM_DEPLOY }}
jobs:
build_pack_and_publish:
runs-on: ubuntu-latest
steps:
- uses: actions/checkout@v3
- name: Cache node modules
id: cache-npm
uses: actions/cache@v3
with:
path: ~/.npm
key: ${{ runner.os }}-build-${{ hashFiles('**/package-lock.json') }}
- run: npm ci && npm run build
- run: npm pack
- run: npm publish
coverage:
runs-on: ubuntu-latest
steps:
- uses: actions/checkout@v3
- name: Cache node modules
id: cache-npm
uses: actions/cache@v3
with:
path: ~/.npm
key: ${{ runner.os}}-build-${{ hashFiles('**/package-lock.json') }}
- run: npm ci && npm run test
- name: Upload coverage to codecov
if: always()
uses: codecov/codecov-action@v3
env:
CODECOV_TOKEN: ${{ secrets.CODECOV_TOKEN }}