Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
9 changes: 1 addition & 8 deletions .github/workflows/ci.yml
Original file line number Diff line number Diff line change
Expand Up @@ -38,14 +38,7 @@ jobs:
- name: Install geosae
run: pip install -e ".[dev,viz]"
- name: Test
run: pytest -q --cov --cov-report=xml
- name: Upload coverage
if: matrix.python-version == '3.12'
uses: codecov/codecov-action@v5
with:
files: coverage.xml
token: ${{ secrets.CODECOV_TOKEN }}
fail_ci_if_error: false
run: pytest -q

docs:
runs-on: ubuntu-latest
Expand Down
18 changes: 15 additions & 3 deletions .github/workflows/docs.yml
Original file line number Diff line number Diff line change
@@ -1,6 +1,7 @@
name: Docs

# Deploys the documentation site to GitHub Pages from main.
# Deploys the documentation site to GitHub Pages from main, with the coverage.json that the
# README's coverage badge reads (a shields.io endpoint).

on:
push:
Expand All @@ -27,10 +28,21 @@ jobs:
cache: pip
- name: Install CPU torch
run: pip install torch --index-url https://download.pytorch.org/whl/cpu
- name: Install geosae with docs tooling
run: pip install -e ".[docs]"
- name: Install geosae with docs and test tooling
run: pip install -e ".[docs,dev,viz]"
- name: Build docs
run: mkdocs build --strict
- name: Measure test coverage
run: pytest -q --cov --cov-report=json:coverage.json
- name: Write the coverage badge
run: |
python - <<'PY'
import json
pct = json.load(open("coverage.json"))["totals"]["percent_covered"]
color = "brightgreen" if pct >= 80 else "yellow" if pct >= 60 else "orange"
badge = {"schemaVersion": 1, "label": "coverage", "message": f"{pct:.0f}%", "color": color}
json.dump(badge, open("site/coverage.json", "w"))
PY
- uses: actions/upload-pages-artifact@v3
with:
path: site/
Expand Down
2 changes: 1 addition & 1 deletion README.md
Original file line number Diff line number Diff line change
Expand Up @@ -9,7 +9,7 @@

<p align="center">
<a href="https://github.com/EarthyScience/geosae/actions/workflows/ci.yml"><img alt="CI" src="https://img.shields.io/github/actions/workflow/status/EarthyScience/geosae/ci.yml?branch=main&label=CI"></a>
<a href="https://codecov.io/gh/EarthyScience/geosae"><img alt="Coverage" src="https://codecov.io/gh/EarthyScience/geosae/branch/main/graph/badge.svg"></a>
<a href="https://github.com/EarthyScience/geosae/actions/workflows/docs.yml"><img alt="Coverage" src="https://img.shields.io/endpoint?url=https%3A%2F%2Fearthyscience.github.io%2Fgeosae%2Fcoverage.json"></a>
<a href="https://pypi.org/project/geosae/"><img alt="PyPI" src="https://img.shields.io/pypi/v/geosae"></a>
<a href="https://pypi.org/project/geosae/"><img alt="Python versions" src="https://img.shields.io/pypi/pyversions/geosae"></a>
<a href="https://earthyscience.github.io/geosae"><img alt="Documentation" src="https://img.shields.io/github/actions/workflow/status/EarthyScience/geosae/docs.yml?branch=main&label=docs"></a>
Expand Down
Loading