chore: prepare package for publishing #51
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: Node.js testing CI | |
# Trigger CI on push or pull request to main | |
on: | |
push: | |
branches: | |
- main | |
pull_request: | |
branches: | |
- main | |
jobs: | |
build: | |
runs-on: ubuntu-latest | |
strategy: | |
matrix: | |
node-version: [18.x, 20.x] | |
# 'steps' represent a sequence of tasks that will be executed as part of the job. | |
steps: | |
# Checks-out your repository under $GITHUB_WORKSPACE, so your workflow can access it. | |
- uses: actions/checkout@v3 | |
- name: Use Node.js ${{ matrix.node-version }} | |
uses: actions/setup-node@v3 | |
with: | |
node-version: ${{ matrix.node-version }} | |
- name: Install dependencies | |
# Designed for automated environments like CI. It uses 'package-lock.json'. | |
run: npm ci | |
- name: Run tests | |
# Allow tests to fail | |
run: npm run test:coverage || echo "Tests failed, continuing..." | |
continue-on-error: true | |
- name: Upload coverage reports to Codecov | |
uses: codecov/codecov-action@v3 | |
with: | |
token: ${{ secrets.CODECOV_TOKEN }} | |
directory: ./coverage | |
files: ./coverage/lcov.info | |
flags: tests | |
name: codecov-umbrella # Optional: Custom name for the upload displayed on Codecov |