diff --git a/.codecov.yml b/.codecov.yml index a93095486..3e147d151 100644 --- a/.codecov.yml +++ b/.codecov.yml @@ -6,6 +6,4 @@ codecov: # https://docs.codecov.io/v4.3.6/docs/comparing-commits allow_coverage_offsets: true - token: 6dafc396-e7f5-4221-a38a-8b07a49fbdae - comment: off diff --git a/.github/workflows/test-windows.yml b/.github/workflows/test-windows.yml index 075707bf6..30f302d20 100644 --- a/.github/workflows/test-windows.yml +++ b/.github/workflows/test-windows.yml @@ -55,10 +55,9 @@ jobs: python-version: ${{ matrix.python-version }} architecture: ${{ matrix.architecture }} - - name: pip install wheel pytest pytest-cov codecov + - name: pip install wheel pytest pytest-cov run: | "%pythonLocation%\python.exe" -m pip install wheel pytest pytest-cov - pip install codecov shell: cmd - name: Fetch dependencies @@ -357,8 +356,11 @@ jobs: path: Tests/errors - name: Upload coverage - run: 'codecov --file "%GITHUB_WORKSPACE%\coverage.xml" --name "%pythonLocation%"' - shell: cmd + if: success() + uses: codecov/codecov-action@v1 + with: + token: ${{ secrets.CODECOV_TOKEN }} + name: ${{ runner.os }} Python ${{ matrix.python-version }} - name: Build wheel id: wheel diff --git a/.github/workflows/test.yml b/.github/workflows/test.yml index 163250248..580aff824 100644 --- a/.github/workflows/test.yml +++ b/.github/workflows/test.yml @@ -71,5 +71,13 @@ jobs: run: | .travis/after_success.sh env: + MATRIX_OS: ${{ matrix.os }} CODECOV_TOKEN: ${{ secrets.CODECOV_TOKEN }} COVERALLS_REPO_TOKEN: ${{ secrets.COVERALLS_REPO_TOKEN }} + + - name: Upload coverage + if: success() + uses: codecov/codecov-action@v1 + with: + token: ${{ secrets.CODECOV_TOKEN }} + name: ${{ matrix.os }} Python ${{ matrix.python-version }} diff --git a/.travis/after_success.sh b/.travis/after_success.sh index 721a469b6..ec4f027b4 100755 --- a/.travis/after_success.sh +++ b/.travis/after_success.sh @@ -1,7 +1,12 @@ #!/bin/bash # gather the coverage data -sudo apt-get -qq install lcov +if [[ "$MATRIX_OS" == "macOS-latest" ]]; then + brew install lcov +else + sudo apt-get -qq install lcov +fi + lcov --capture --directory . -b . --output-file coverage.info # filter to remove system headers lcov --remove coverage.info '/usr/*' -o coverage.filtered.info @@ -13,7 +18,9 @@ coverage report pip install codecov pip install coveralls-merge coveralls-merge coverage.c.json -codecov +if [[ $TRAVIS ]]; then + codecov +fi if [ "$TRAVIS_PYTHON_VERSION" == "3.7" ] && [ "$DOCKER" == "" ]; then # Coverage and quality reports on just the latest diff.