Closed shenxianpeng closed 4 months ago
[x] coverage.yml
for uploading reports only, not running tests. Prefer using artifacts to save coverage data that we can use in uploading coverage reports.
steps:
- uses: actions/checkout@v4
- name: Download all artifacts
uses: actions/download-artifact@v4
with:
path: ci-artifacts
pattern: coverage-data-*
- run: mv ci-artifacts/**/.coverage* ./
- name: Setup python
uses: actions/setup-python@v5
with:
python-version: '3.x'
- name: Create coverage report
run: |
pip3 install coverage[toml]
coverage combine
coverage html
- name: Upload comprehensive coverage HTML report
uses: actions/upload-artifact@v4
with:
name: coverage-report
path: htmlcov/
- run: coverage report && coverage xml
- uses: codecov/codecov-action@v4
env:
CODECOV_TOKEN: ${{secrets.CODECOV_TOKEN}}
with:
files: ./coverage.xml
fail_ci_if_error: true # optional (default = false)
verbose: true # optional (default = false)
Unfortunately, I don't think unit testing would fit well into a reusable workflow. Testing usually involves some software-specific setup in CI.
I really like what you did in https://github.com/nRF24/.github/tree/main/.github/workflows to use reusable workflows
I would also like to try to move some common workflows to .github repo