Skip to content

Commit

Permalink
Update code-coverage.yml
Browse files Browse the repository at this point in the history
  • Loading branch information
thivinanandh authored May 3, 2024
1 parent 50908ee commit 1d242f8
Showing 1 changed file with 23 additions and 17 deletions.
40 changes: 23 additions & 17 deletions .github/workflows/code-coverage.yml
Original file line number Diff line number Diff line change
@@ -1,26 +1,32 @@
name: Code-Coverage Workflow

on:
push:
branches: [ main ]
pull_request:
branches: [ main ]
workflow_dispatch:
push:
branches: [ main ]
pull_request:
branches: [ main ]
workflow_dispatch:

jobs:
build:
runs-on: ubuntu-latest
name: Test python API
steps:
- uses: actions/checkout@v4
- uses: actions/setup-python@v2
build:
runs-on: ubuntu-latest
name: Test python API
steps:
- uses: actions/checkout@v4
- uses: actions/setup-python@v2
with:
python-version: '3.10'
- name: Install requirements
run: pip install -r api/requirements.txt
- name: Run tests and collect coverage
python-version: '3.10'

- name: Install requirements
run: |
python -m pip install --upgrade pip
pip install -r requirements.txt
pip install pytest pytest-cov codecov
- name: Run tests and collect coverage
run: pytest --cov=api.calculator --cov-report=xml
- name: Upload coverage reports to Codecov with GitHub Action

- name: Upload coverage reports to Codecov with GitHub Action
uses: codecov/codecov-action@v4.2.0
env:
CODECOV_TOKEN: ${{ secrets.CODECOV_TOKEN }}
CODECOV_TOKEN: ${{ secrets.CODECOV_TOKEN }}

0 comments on commit 1d242f8

Please sign in to comment.