Skip to content

adds codecov to github workflows and badge to readme #8

adds codecov to github workflows and badge to readme

adds codecov to github workflows and badge to readme #8

Workflow file for this run

name: CI with Coverage
on:
push:
branches:
- '*'
pull_request:
branches:
- '*'
jobs:
test:
runs-on: ubuntu-latest
steps:
- name: Checkout code
uses: actions/checkout@v3
- name: Set CI environment variable
run: echo "CI=true" >> $GITHUB_ENV
- name: Set up Python
uses: actions/setup-python@v4
with:
python-version: "3.11"
- name: Install Dependencies
run: |
python -m pip install --upgrade pip
pip install pytest pytest-cov requests pandas
- name: Export API key
env:
FRED_API_KEY: ${{ secrets.FRED_API_KEY }}
run: echo "FRED_API_KEY=$FRED_API_KEY" >> $GITHUB_ENV
- name: Run tests with coverage
run: pytest --cov=full_fred --cov-report=xml --cov-report=term
env:
FRED_API_KEY: ${{ secrets.FRED_API_KEY }}
- name: Upload coverage reports to Codecov
uses: codecov/codecov-action@v5
with:
token: ${{ secrets.CODECOV_TOKEN }}
slug: 7astro7/full_fred