adds codecov to github workflows and badge to readme #8
Workflow file for this run
This file contains hidden or 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: 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 |