Refactor and enhance config file handling logic (#39) #20
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: Codecov Coverage | |
on: | |
push: | |
branches: [ "master" ] | |
pull_request: | |
types: [opened, reopened, synchronize, ready_for_review] | |
jobs: | |
coverage: | |
name: ${{ matrix.os }} / Node.js ${{ matrix.node-version }} | |
runs-on: ${{ matrix.os }}-latest | |
strategy: | |
matrix: | |
os: [ Ubuntu, Windows, macOS ] | |
node-version: [ 20.x ] | |
steps: | |
- name: Checkout | |
uses: actions/checkout@v4 | |
- name: Setup Node.js / ${{ matrix.node-version }} | |
uses: actions/setup-node@v4 | |
with: | |
node-version: ${{ matrix.node-version }} | |
cache: 'npm' | |
- name: Clean install the project | |
run: npm ci | |
- name: Run coverage | |
# Currently only run coverage for unit tests | |
run: npx nyc npm run test:unit | |
- name: Upload coverage | |
if: ${{ github.actor != 'dependabot[bot]' || github.actor != 'github-actions[bot]' }} | |
uses: codecov/codecov-action@v4 | |
with: | |
name: codecov-unittest@${{ matrix.os }} | |
fail_ci_if_error: true | |
env_vars: os,node-version | |
directory: './coverage' | |
flags: unittests,${{ matrix.os }} | |
token: ${{ secrets.CODECOV_TOKEN }} | |
verbose: true |