Skip to content

Commit

Permalink
Conditionally upload code coverage
Browse files Browse the repository at this point in the history
Signed-off-by: Cristian Le <cristian.le@mpsd.mpg.de>
  • Loading branch information
LecrisUT authored and mwouts committed Jan 12, 2024
1 parent 113d2c2 commit 1870d19
Show file tree
Hide file tree
Showing 4 changed files with 22 additions and 0 deletions.
6 changes: 6 additions & 0 deletions .github/workflows/ci.yml
Expand Up @@ -39,14 +39,19 @@ jobs:
test-pip:
needs: [ pre-commit ]
uses: ./.github/workflows/step_tests-pip.yml
with:
coverage: ${{ github.event_name != 'schedule' }}

coverage:
needs: [ test-pip ]
uses: ./.github/workflows/step_coverage.yml
if: github.event_name != 'schedule'

test-conda:
needs: [ test-pip ]
uses: ./.github/workflows/step_tests-conda.yml
with:
coverage: ${{ github.event_name != 'schedule' }}

test-ui:
needs: [ test-pip ]
Expand All @@ -66,4 +71,5 @@ jobs:
- uses: re-actors/alls-green@release/v1
with:
jobs: ${{ toJSON(needs) }}
allowed-skips: coverage
if: always()
4 changes: 4 additions & 0 deletions .github/workflows/release.yml
Expand Up @@ -27,11 +27,15 @@ jobs:
test-pip:
needs: [ pre-commit ]
uses: ./.github/workflows/step_tests-pip.yml
with:
coverage: false
if: "! inputs.skip-tests"

test-conda:
needs: [ test-pip ]
uses: ./.github/workflows/step_tests-conda.yml
with:
coverage: false
if: "! inputs.skip-tests"

test-ui:
Expand Down
6 changes: 6 additions & 0 deletions .github/workflows/step_tests-conda.yml
Expand Up @@ -3,6 +3,11 @@ run-name: Run Conda tests for different OS

on:
workflow_call:
inputs:
coverage:
type: boolean
description: Upload coverage to CodeCov
default: true

permissions:
contents: read
Expand Down Expand Up @@ -64,3 +69,4 @@ jobs:
with:
fail_ci_if_error: true
verbose: true
if: inputs.coverage
6 changes: 6 additions & 0 deletions .github/workflows/step_tests-pip.yml
Expand Up @@ -3,6 +3,11 @@ run-name: Run main tests using Pip

on:
workflow_call:
inputs:
coverage:
type: boolean
description: Upload coverage to CodeCov
default: true

permissions:
contents: read
Expand Down Expand Up @@ -86,3 +91,4 @@ jobs:
with:
fail_ci_if_error: true
verbose: true
if: inputs.coverage

0 comments on commit 1870d19

Please sign in to comment.