refactored environment dependent variables #687
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 Badges | |
on: | |
workflow_dispatch: | |
push: | |
paths: | |
- .github/workflows/coverage.yml | |
- cat_win/** | |
# only trigger on development branch | |
branches: | |
- 'dev' | |
jobs: | |
build: | |
runs-on: ubuntu-latest | |
strategy: | |
fail-fast: false | |
steps: | |
- name: Set Windows Line Ending | |
run: | | |
git config --global core.autocrlf true | |
- name: Git Checkout | |
uses: actions/checkout@v4 | |
with: | |
ref: 'dev' | |
- name: Install Python 3.10 | |
id: python | |
uses: actions/setup-python@v5 | |
with: | |
python-version: '3.10' | |
cache: 'pip' | |
- name: Update PIP | |
run: | | |
python -m pip install --upgrade pip | |
- name: Setup Dependencies | |
run: | | |
python -m pip install --upgrade -r ./workflowHelper/requirements-dev.txt | |
- name: Generate Reports | |
run: | | |
python -m coverage run -m pytest ./cat_win/tests/ --junitxml=./reports/pytest.xml | |
python -m coverage xml -o ./reports/coverage.xml | |
- name: Show Missing Coverage | |
run: | | |
python -m coverage report --show-missing | |
- name: Generate Badges | |
run: | | |
python -m genbadge.main tests -i ./reports/pytest.xml -o ./temp/badge-tests.svg | |
python -m genbadge.main coverage -i ./reports/coverage.xml -o ./temp/badge-coverage.svg | |
- name: Show Changes | |
run: | | |
git status | |
- name: Stash Changes | |
run: | | |
git config --local user.name 'github-actions[bot]' | |
git config --local user.email 'github-actions[bot]@users.noreply.github.com' | |
git add ./temp/* | |
git stash -- temp | |
git clean -df | |
git restore . | |
- name: Fetch Badges Branch | |
run: | | |
git fetch origin badges | |
git checkout badges | |
git stash pop | |
- name: Copy To Badges | |
run: | | |
python -c "import sys; import shutil; shutil.copytree('./temp', './badges', dirs_exist_ok=True)" | |
- name: Commit & Push | |
run: | | |
git add ./badges/* | |
git reset ./temp/* | |
git status | |
git commit -m "🤖Generated Coverage Badges." | |
git push origin HEAD:badges | |
continue-on-error: true |