diff --git a/.github/workflows/build.yml b/.github/workflows/build.yml index 97b4ce2b..3559bb81 100644 --- a/.github/workflows/build.yml +++ b/.github/workflows/build.yml @@ -77,15 +77,11 @@ jobs: - name: Test with pytest run: poetry run pytest --cov=milatools --cov-report=xml --cov-append - - name: Upload coverage reports to Codecov - uses: codecov/codecov-action@v4.3.1 + - name: Store coverage report as an artifact + uses: actions/upload-artifact@v2 with: - token: ${{ secrets.CODECOV_TOKEN }} - file: ./coverage.xml - flags: unittests - env_vars: PLATFORM,PYTHON - name: codecov-umbrella - fail_ci_if_error: false + name: coverage-reports + path: ./coverage.xml mock-slurm-integration-tests: name: integration tests with a mock slurm cluster @@ -151,15 +147,11 @@ jobs: env: SLURM_CLUSTER: localhost - - name: Upload coverage reports to Codecov - uses: codecov/codecov-action@v4.3.1 + - name: Store coverage report as an artifact + uses: actions/upload-artifact@v2 with: - token: ${{ secrets.CODECOV_TOKEN }} - file: ./coverage.xml - flags: integrationtests - env_vars: PLATFORM,PYTHON - name: codecov-umbrella - fail_ci_if_error: false + name: coverage-reports + path: ./coverage.xml real-slurm-integration-tests: @@ -178,5 +170,23 @@ jobs: cluster: ${{ matrix.cluster }} python-version: ${{ matrix.python-version }} timeout-minutes: 30 - secrets: - CODECOV_TOKEN: ${{ secrets.CODECOV_TOKEN }} + + # https://about.codecov.io/blog/uploading-code-coverage-in-a-separate-job-on-github-actions/ + upload-coverage-codecov: + needs: [real-slurm-integration-tests] + runs-on: ubuntu-latest + name: Upload coverage reports to Codecov + steps: + - name: Checkout + uses: actions/checkout@v4 + - name: Download artifacts + uses: actions/download-artifact@v4 + - name: Upload coverage reports to Codecov + uses: codecov/codecov-action@v4 + with: + token: ${{ secrets.CODECOV_TOKEN }} + # file: ./coverage.xml # Search for all coverage files from each workflow. + # flags: integrationtests + # env_vars: PLATFORM,PYTHON + # name: codecov-umbrella + fail_ci_if_error: true diff --git a/.github/workflows/full_cluster_tests.yml b/.github/workflows/full_cluster_tests.yml index 98748621..6d98bd45 100644 --- a/.github/workflows/full_cluster_tests.yml +++ b/.github/workflows/full_cluster_tests.yml @@ -27,5 +27,22 @@ jobs: cluster: ${{ matrix.cluster }} python-version: ${{ matrix.python-version }} timeout-minutes: 60 - secrets: - CODECOV_TOKEN: ${{ secrets.CODECOV_TOKEN }} + # https://about.codecov.io/blog/uploading-code-coverage-in-a-separate-job-on-github-actions/ + upload-coverage-codecov: + needs: [real-slurm-integration-tests] + runs-on: ubuntu-latest + name: Upload coverage reports to Codecov + steps: + - name: Checkout + uses: actions/checkout@v4 + - name: Download artifacts + uses: actions/download-artifact@v4 + - name: Upload coverage reports to Codecov + uses: codecov/codecov-action@v4 + with: + token: ${{ secrets.CODECOV_TOKEN }} + # file: ./coverage.xml # Search for all coverage files from each workflow. + flags: integrationtests + # env_vars: PLATFORM,PYTHON + # name: codecov-umbrella + fail_ci_if_error: true diff --git a/.github/workflows/testing.yml b/.github/workflows/testing.yml index 176845ec..155d0b15 100644 --- a/.github/workflows/testing.yml +++ b/.github/workflows/testing.yml @@ -12,9 +12,6 @@ on: required: false type: number default: 30 - secrets: - CODECOV_TOKEN: - required: true workflow_dispatch: @@ -53,12 +50,8 @@ jobs: env: SLURM_CLUSTER: ${{ inputs.cluster }} - - name: Upload coverage reports to Codecov - uses: codecov/codecov-action@v3 + - name: Store coverage report as an artifact + uses: actions/upload-artifact@v2 with: - token: ${{ secrets.CODECOV_TOKEN }} - file: ./coverage.xml - flags: integrationtests - env_vars: PLATFORM,PYTHON - name: codecov-umbrella - fail_ci_if_error: false + name: coverage-reports + path: ./coverage.xml