Skip to content

Commit

Permalink
Merge pull request #2 from nora-codecov/setup
Browse files Browse the repository at this point in the history
add gh workflow
  • Loading branch information
nora-codecov authored Nov 7, 2024
2 parents 81198dd + 04232f5 commit dc31afb
Show file tree
Hide file tree
Showing 2 changed files with 31 additions and 1 deletion.
31 changes: 31 additions & 0 deletions .github/workflows/api.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,31 @@
name: API workflow

on: [push, pull_request]

jobs:
build:
runs-on: ubuntu-latest
name: Test python API
steps:
- name: Checkout codecov-cli test branch
uses: actions/checkout@v4
with:
repository: codecov/codecov-cli
ref: 53289f820ca3f2c05994292aa77d179732d1ed5a
submodules: 'true'
- name: Run Codecov with test branch of CLI
run: |
pip install -r requirements.txt
pip install .
- 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
run: pytest --cov=api.calculator --cov-report=xml
- name: Upload to Codecov
run: |
set -e # Stop script on error?
codecovcli -v upload-process
1 change: 0 additions & 1 deletion api/calculator/test_calculator.py
Original file line number Diff line number Diff line change
Expand Up @@ -28,4 +28,3 @@ def test_divide():
assert Calculator.divide(1.0, 2.0) == 0.5
assert Calculator.divide(0, 2.0) == 0
assert Calculator.divide(-4, 2.0) == -2.0

0 comments on commit dc31afb

Please sign in to comment.