Skip to content

add new script for testing with coverage for codecov #3

add new script for testing with coverage for codecov

add new script for testing with coverage for codecov #3

Workflow file for this run

name: Code Coverage
on:
pull_request:
branches:
- main
push:
branches:
- main
workflow_dispatch:
jobs:
code-cov:
runs-on: ubuntu-latest
steps:
- name: Checkout and clone repo
uses: actions/checkout@v4.1.1
- name: Install dependencies
run: npm install
- name: Setup PostgreSQL
uses: Harmon758/postgresql-action@v1.0.0
with:
postgresql db: nc_news_test
postgresql user: test_user
postgresql password: password
- name: Run complete test suite
run: PGDATABASE=nc_news_test PGUSER=test_user PGPASSWORD=password npm run test-with-cov
- name: Upload coverage reports to Codecov
uses: codecov/codecov-action@v3
env:
CODECOV_TOKEN: ${{ secrets.CODECOV_TOKEN }}