Skip to content

Commit

Permalink
fix(ci): correct linting and badge config
Browse files Browse the repository at this point in the history
  • Loading branch information
spool committed Nov 15, 2023
1 parent 61e6eca commit 38eb01e
Show file tree
Hide file tree
Showing 2 changed files with 10 additions and 4 deletions.
5 changes: 1 addition & 4 deletions .github/workflows/ci.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -26,17 +26,14 @@ permissions:
jobs:
linter:
runs-on: ubuntu-latest
defaults:
run:
working-directory: config/
steps:
- name: Checkout Code Repository
uses: actions/checkout@main

- name: Set up Python
uses: actions/setup-python@main
with:
python-version: $MIN_PYTHON_VERSION
python-version: ${{ env.MIN_PYTHON_VERSION }}

- name: Run pre-commit
uses: pre-commit/action@main
Expand Down
9 changes: 9 additions & 0 deletions python/conftest.py
Original file line number Diff line number Diff line change
Expand Up @@ -5,7 +5,9 @@
from typing import Final

import pytest
from coverage_badge.__main__ import main as gen_cov_badge

BADGE_PATH: Final[Path] = Path("docs") / "assets" / "coverage.svg"
CLIMATE_DATA_MOUNT_PATH = Path("/mnt/vmfileshare/ClimateData")
TEST_PATH = Path().absolute()
PYTHON_DIR_NAME: Final[Path] = Path("python")
Expand Down Expand Up @@ -49,3 +51,10 @@ def doctest_auto_fixtures(
doctest_namespace["is_climate_data_mounted"] = is_climate_data_mounted
doctest_namespace["pprint"] = pprint
doctest_namespace["pytest"] = pytest


def pytest_sessionfinish(session, exitstatus):
"""Generate badges for docs after tests finish."""
if exitstatus == 0:
BADGE_PATH.parent.mkdir(parents=True, exist_ok=True)
gen_cov_badge(["-o", f"{BADGE_PATH}", "-f"])

0 comments on commit 38eb01e

Please sign in to comment.