From 373df4f9bbd3431da16079bf465dbe0ae730fea0 Mon Sep 17 00:00:00 2001 From: Braelyn Boynton Date: Fri, 21 Jun 2024 15:49:20 -0700 Subject: [PATCH] add codecov bot --- .github/workflows/codecov.yml | 45 +++++++++++++++++++++++++++++++---- tox.ini | 7 +++++- 2 files changed, 47 insertions(+), 5 deletions(-) diff --git a/.github/workflows/codecov.yml b/.github/workflows/codecov.yml index 5b29efb0..716ede19 100644 --- a/.github/workflows/codecov.yml +++ b/.github/workflows/codecov.yml @@ -1,4 +1,41 @@ -- name: Upload coverage reports to Codecov - uses: codecov/codecov-action@v4.0.1 - with: - token: ${{ secrets.CODECOV_TOKEN }} \ No newline at end of file +name: Codecov + +on: + push: + branches: [ main ] + pull_request: + branches: [ main ] + +jobs: + test: + runs-on: ubuntu-latest + + strategy: + matrix: + python-version: [3.8, 3.9, 3.10] + + steps: + - name: Checkout code + uses: actions/checkout@v2 + + - name: Set up Python + uses: actions/setup-python@v2 + with: + python-version: ${{ matrix.python-version }} + + - name: Install dependencies + run: | + python -m pip install --upgrade pip + pip install tox + + - name: Run tests with tox + run: tox + + - name: Upload coverage to Codecov + uses: codecov/codecov-action@v2 + with: + token: ${{ secrets.CODECOV_TOKEN }} + files: ./coverage.xml + flags: unittests + name: codecov-umbrella + fail_ci_if_error: true diff --git a/tox.ini b/tox.ini index 5c56417c..1e9d06b7 100644 --- a/tox.ini +++ b/tox.ini @@ -23,4 +23,9 @@ deps = commands = coverage run --source agentops -m pytest coverage report -m - mypy: mypy agentops \ No newline at end of file + coverage xml + mypy: mypy agentops + +[coverage:run] +branch = True +source = . \ No newline at end of file