From 77dd6bf49b886921103a2d092c33f2f2068b9424 Mon Sep 17 00:00:00 2001 From: Santiago Martinez Date: Sun, 16 Jul 2023 15:29:48 +0100 Subject: [PATCH] Added coverage workflow --- .github/workflows/coverage.yml | 38 ++++++++++++++++++++++++++++++++++ 1 file changed, 38 insertions(+) create mode 100644 .github/workflows/coverage.yml diff --git a/.github/workflows/coverage.yml b/.github/workflows/coverage.yml new file mode 100644 index 0000000..b575afb --- /dev/null +++ b/.github/workflows/coverage.yml @@ -0,0 +1,38 @@ +name: Coverage + +on: + push: + branches: ["main"] + + pull_request: + branches: ["main"] + +jobs: + build: + + runs-on: ubuntu-latest + + steps: + - uses: actions/checkout@v3 + + - name: Set up Python 3.11 + uses: actions/setup-python@v4 + with: + python-version: '3.11' + + - name: Install dependencies + run: | + python -m pip install --upgrade pip + python -m pip install pytest hypothesis coverage pytest-coverage + python -m pip install . + + - name: Run Tests + run: | + pytest tests -v --cov-config .coveragerc --cov=src/soundevent/ -l --tb=sort --maxfail=1 tests/ + coverage xml + coverage html + + - name: Upload coverage reports to Codecov + uses: codecov/codecov-action@v3 + env: + CODECOV_TOKEN: ${{ secrets.CODECOV_TOKEN }}