fix readme badges #83
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
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: 18 | |
- run: npm ci | |
- run: npm run lint | |
test: | |
name: Test (Node v${{ matrix.node }}) | |
runs-on: ubuntu-latest | |
strategy: | |
matrix: | |
node: [16, 18] | |
steps: | |
- uses: actions/checkout@v3 | |
- uses: actions/setup-node@v3 | |
with: | |
node-version: ${{ matrix.node }} | |
- run: npm ci | |
- run: npm run test:coverage | |
- run: npm run build | |
- uses: codecov/codecov-action@v3 | |
if: matrix.node == 18 | |
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: 18 | |
- run: npm ci | |
- run: npm run build | |
- uses: JS-DevTools/npm-publish@v2 | |
with: | |
token: ${{ secrets.NPM_TOKEN }} |