fix coverage-report gh action #37
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 | |
jobs: | |
generate_coverage: | |
name: Generate Coverage Report | |
permissions: | |
contents: write | |
pages: write | |
id-token: write | |
runs-on: ubuntu-latest | |
steps: | |
- uses: actions/checkout@v4 | |
- name: Setup conda | |
uses: s-weigand/setup-conda@v1 | |
with: | |
update-conda: true | |
python-version: 3.11 | |
conda-channels: anaconda, conda-forge | |
- name: Conda install dependencies | |
run: conda install -c conda-forge pyproj==3.6.0 | |
- name: Install dependencies | |
run: | | |
python3 -m pip install --upgrade pip | |
python3 -m pip install --force-reinstall -e ".[dev]" | |
- name: Test with pytest and generate coverage report | |
run: | | |
python3 -m coverage run --source=src/geodense -m pytest -v tests | |
python3 -m coverage html -d htmlcov | |
python3 -m coverage json -o htmlcov/coverage.json | |
python3 util.py gen-cov-badge htmlcov/coverage.json htmlcov/badge.json | |
ls -lah htmlcov | |
- name: Deploy 🚀 | |
uses: JamesIves/github-pages-deploy-action@v4 | |
with: | |
folder: htmlcov # The folder the action should deploy. | |
branch: coverage-report |