Merge pull request #1 from ULAS-HiPR/dev #1
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
name: Generate Coverage Report | |
on: | |
push: | |
branches: | |
- main # Update this to match your main branch | |
jobs: | |
coverage: | |
name: Generate Coverage Report | |
runs-on: ubuntu-latest | |
steps: | |
- name: Checkout repository | |
uses: actions/checkout@v2 | |
- name: Set up Python | |
uses: actions/setup-python@v2 | |
with: | |
python-version: 3.x | |
- name: Install dependencies | |
run: | | |
pip install coverage tabulate | |
- name: Run tests and collect coverage | |
run: | | |
coverage run -m unittest discover -s tests | |
- name: Generate Markdown table from coverage report | |
run: | | |
coverage report --format markdown > coverage_table.md | |
- name: Commit coverage report changes | |
run: | | |
git config --local user.email "[email protected]" | |
git config --local user.name "GitHub Actions" | |
git add coverage_table.md | |
git commit -m "Add coverage report" | |
- name: Push changes | |
uses: ad-m/github-push-action@master | |
with: | |
github_token: ${{ secrets.GITHUB_TOKEN }} |