Skip to content

CI/CD

CI/CD #26

Workflow file for this run

name: CI/CD
on:
- push
- pull_request
- workflow_dispatch
jobs:
lint:
name: Lint
runs-on: ubuntu-latest
steps:
- uses: actions/checkout@v3
- uses: actions/setup-node@v3
with:
node-version: 16
- run: npm ci
- run: npm run lint
test:
name: Test (Node v${{ matrix.node }})
runs-on: ubuntu-latest
strategy:
matrix:
node: [ 10, 16 ]
steps:
- uses: actions/checkout@v3
- uses: actions/setup-node@v3
with:
node-version: ${{ matrix.node }}
- run: npm ci
- run: npm test
- run: npm run coverage
- uses: codecov/codecov-action@v3
if: matrix.node == 16
with:
files: ./coverage.lcov
publish:
name: Publish on npm
runs-on: ubuntu-latest
if: startsWith(github.ref, 'refs/tags/')
needs:
- lint
- test
steps:
- uses: actions/checkout@v3
- uses: actions/setup-node@v3
with:
node-version: 16
- run: npm ci
- name: Publish on npm
uses: JS-DevTools/npm-publish@v1
with:
token: ${{ secrets.NPM_TOKEN }}