feat: test coverage #92
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: cov | |
on: | |
pull_request: | |
branches: | |
- main | |
workflow_dispatch: | |
jobs: | |
upload-coverage-report: | |
runs-on: ubuntu-latest | |
permissions: | |
actions: read | |
contents: write | |
security-events: write | |
strategy: | |
matrix: | |
node-version: [16.x, 17.x, 18.x, 19.x, 20.x] | |
steps: | |
- name: Checkout | |
uses: actions/[email protected] | |
- name: Setup Node.js ${{ matrix.node-version }} | |
uses: actions/[email protected] | |
with: | |
node-version: ${{ matrix.node-version }} | |
- name: Test with Coverage | |
env: | |
JWT_SECRET: ${{ secrets.JWT_SECRET }} | |
TESTING_NODE_ENV: ${{ secrets.TESTING_NODE_ENV }} | |
TESTING_DB_HOST: ${{ secrets.TESTING_DB_HOST }} | |
TESTING_DB_PORT_NUMBER: ${{ secrets.TESTING_DB_PORT_NUMBER }} | |
TESTING_DB_NAME: ${{ secrets.TESTING_DB_NAME }} | |
TESTING_DB_USERNAME: ${{ secrets.TESTING_DB_USERNAME }} | |
TESTING_DB_PASSWORD: ${{ secrets.TESTING_DB_PASSWORD }} | |
IMAGE_PREFIX: ${{ secrets.IMAGE_PREFIX }} | |
run: | | |
npm ci --legacy-peer-deps | |
npm run test:cov | |
- name: Upload Coverage Report to Codecov | |
uses: codecov/codecov-action@v3 | |
with: | |
token: ${{ secrets.CODECOV_TOKEN }} | |
files: coverage/clover.xml,coverage/coverage-final.json,coverage/lcov.info,!test/coverage/clover.xml,!test/coverage/coverage-final.json,!test/coverage/lcov.info | |
fail_ci_if_error: true | |
flags: unit_test | |
name: OpenriceCanadaBackend | |
verbose: true |