Skip to content

testing with GitHub coverage upload #893

testing with GitHub coverage upload

testing with GitHub coverage upload #893

Workflow file for this run

name: CI
on:
push:
branches:
- main
tags:
- "*"
pull_request:
schedule:
# Weekly Monday 9AM build
# * is a special character in YAML so you have to quote this string
- cron: "0 9 * * 1"
workflow_dispatch:
concurrency:
group: ${{ github.workflow }}-${{ github.ref }}
cancel-in-progress: true
jobs:
test:
uses: zacharyburnett/github-actions-workflows/.github/workflows/tox.yml@tox/coverage_github_actions
with:
envs: |
- linux: py310-oldestdeps-cov-xdist
coverage: github
- linux: py310-xdist
- macos: py311-xdist
- linux: py311-cov-xdist
coverage: github
- linux: py311-downstreamdeps-cov-xdist
coverage: github
- linux: py312-nolegacypath-cov-xdist
coverage: github
test_downstream:
uses: OpenAstronomy/github-actions-workflows/.github/workflows/tox.yml@v1
with:
setenv: |
CRDS_PATH: /tmp/data/crds_cache
CRDS_CLIENT_RETRY_COUNT: 3
CRDS_CLIENT_RETRY_DELAY_SECONDS: 20
envs: |
- linux: py311-jwst-xdist
- linux: py311-romancal-xdist
report_diff_test_coverage:
needs: [ test ]
if: always() && github.event_name == 'pull_request'
name: report diff test coverage
runs-on: ubuntu-latest
steps:
- uses: actions/setup-python@v5
with:
python-version: 3
- run: pip install diff-cover coverage
- uses: actions/checkout@v4
with:
fetch-depth: 0
- run: pip install .
- uses: actions/download-artifact@v4
with:
pattern: ".coverage*"
merge-multiple: true
- run: |
[ "$(ls -A .coverage*)" ] && exit 0 || exit 1
- run: coverage xml
- run: diff-cover coverage.xml --compare-branch origin/${{ github.base_ref }} --markdown-report diff_coverage.md
- run: cat diff_coverage.md >> $GITHUB_STEP_SUMMARY
- if: github.event_name == 'pull_request_target'
uses: thollander/[email protected]
with:
filePath: diff_coverage.md
pr_number: ${{ github.event.number }}
comment_tag: diff-coverage
GITHUB_TOKEN: ${{ secrets.PULL_REQUEST_COMMENTER_TOKEN }}