From 7dc3038ab06cc07409d76c0eca1d6ae4b6f65ad0 Mon Sep 17 00:00:00 2001 From: F-G Fernandez <26927750+frgfm@users.noreply.github.com> Date: Wed, 24 Jan 2024 14:07:33 +0100 Subject: [PATCH] ci: Decouple coverage report & upload --- .github/workflows/tests.yml | 21 ++++++++++++++------- 1 file changed, 14 insertions(+), 7 deletions(-) diff --git a/.github/workflows/tests.yml b/.github/workflows/tests.yml index 62e4c71..5e8e821 100644 --- a/.github/workflows/tests.yml +++ b/.github/workflows/tests.yml @@ -33,18 +33,25 @@ jobs: pip install -e ".[test]" - name: Run unittests run: pytest --cov=torchcam --cov-report xml tests/ + - uses: actions/upload-artifact@v2 + with: + name: coverage-reports + path: ./coverage.xml + + codecov-upload: + runs-on: ubuntu-latest + needs: pytest + steps: + - uses: actions/checkout@v2 + with: + persist-credentials: false + - uses: actions/download-artifact@v2 - uses: codecov/codecov-action@v3 with: token: ${{ secrets.CODECOV_TOKEN }} flags: unittests + directory: ./coverage-reports fail_ci_if_error: true - - name: Backup upload - env: - CODECOV_TOKEN: ${{ secrets.CODECOV_TOKEN }} - run: | - curl -Os https://uploader.codecov.io/latest/linux/codecov - chmod +x codecov - ./codecov -t ${CODECOV_TOKEN} -f ./coverage.xml --flags unittests --verbose headers: runs-on: ${{ matrix.os }}