From 4ecc378d3063298f5caa2ba2a952fd0f9f50a42b Mon Sep 17 00:00:00 2001 From: Tom Hu Date: Sun, 27 Apr 2025 23:22:54 -0700 Subject: [PATCH] chore: add Codecov test analytics --- .github/workflows/tests.yml | 35 ++++++++++++++++++++++++++++++----- 1 file changed, 30 insertions(+), 5 deletions(-) diff --git a/.github/workflows/tests.yml b/.github/workflows/tests.yml index d9b4b000c..4343c6f44 100644 --- a/.github/workflows/tests.yml +++ b/.github/workflows/tests.yml @@ -162,7 +162,12 @@ jobs: micromamba list - name: Run tests run: | - python -m pytest -vv --cov=pymc --cov-report=xml --no-cov-on-fail --cov-report term --durations=50 $TEST_SUBSET + python -m pytest -vv --cov=pymc --cov-report=xml --no-cov-on-fail --cov-report term --junitxml=junit.xml -o junit_family=legacy --durations=50 $TEST_SUBSET + - name: Upload test results to Codecov + if: ${{ !cancelled() }} # Run even if tests fail + uses: codecov/test-results-action@v1 + with: + token: ${{ secrets.CODECOV_TOKEN }} - name: Upload coverage to Codecov uses: codecov/codecov-action@v5 with: @@ -214,7 +219,12 @@ jobs: # This job uses a cmd shell, therefore the environment variable syntax is different! # The ">-" in the next line replaces newlines with spaces (see https://stackoverflow.com/a/66809682). run: >- - python -m pytest -vv --cov=pymc --cov-report=xml --no-cov-on-fail --cov-report term --durations=50 %TEST_SUBSET% + python -m pytest -vv --cov=pymc --cov-report=xml --no-cov-on-fail --cov-report term --junitxml=junit.xml -o junit_family=legacy --durations=50 %TEST_SUBSET% + - name: Upload test results to Codecov + if: ${{ !cancelled() }} # Run even if tests fail + uses: codecov/test-results-action@v1 + with: + token: ${{ secrets.CODECOV_TOKEN }} - name: Upload coverage to Codecov uses: codecov/codecov-action@v5 with: @@ -272,7 +282,12 @@ jobs: micromamba list - name: Run tests run: | - python -m pytest -vv --cov=pymc --cov-report=xml --no-cov-on-fail --cov-report term --durations=50 $TEST_SUBSET + python -m pytest -vv --cov=pymc --cov-report=xml --no-cov-on-fail --cov-report term --junitxml=junit.xml -o junit_family=legacy --durations=50 $TEST_SUBSET + - name: Upload test results to Codecov + if: ${{ !cancelled() }} # Run even if tests fail + uses: codecov/test-results-action@v1 + with: + token: ${{ secrets.CODECOV_TOKEN }} - name: Upload coverage to Codecov uses: codecov/codecov-action@v5 with: @@ -322,7 +337,12 @@ jobs: micromamba list - name: Run tests run: | - python -m pytest -vv --cov=pymc --cov-report=xml --no-cov-on-fail --cov-report term --durations=50 $TEST_SUBSET + python -m pytest -vv --cov=pymc --cov-report=xml --no-cov-on-fail --cov-report term --junitxml=junit.xml -o junit_family=legacy --durations=50 $TEST_SUBSET + - name: Upload test results to Codecov + if: ${{ !cancelled() }} # Run even if tests fail + uses: codecov/test-results-action@v1 + with: + token: ${{ secrets.CODECOV_TOKEN }} - name: Upload coverage to Codecov uses: codecov/codecov-action@v5 with: @@ -370,7 +390,12 @@ jobs: # This job uses a cmd shell, therefore the environment variable syntax is different! # The ">-" in the next line replaces newlines with spaces (see https://stackoverflow.com/a/66809682). run: >- - python -m pytest -vv --cov=pymc --cov-report=xml --no-cov-on-fail --cov-report term --durations=50 %TEST_SUBSET% + python -m pytest -vv --cov=pymc --cov-report=xml --no-cov-on-fail --cov-report term --junitxml=junit.xml -o junit_family=legacy --durations=50 %TEST_SUBSET% + - name: Upload test results to Codecov + if: ${{ !cancelled() }} # Run even if tests fail + uses: codecov/test-results-action@v1 + with: + token: ${{ secrets.CODECOV_TOKEN }} - name: Upload coverage to Codecov uses: codecov/codecov-action@v5 with: