From 358fbf70356f75e50254d3c435fde1a6b6afca94 Mon Sep 17 00:00:00 2001 From: Jeppe Brage Christensen Date: Mon, 4 May 2026 10:02:10 +0200 Subject: [PATCH] add git actions Co-authored-by: Copilot --- .github/workflows/docs.yml | 75 +++++++++++++++++++++++++++++++++++++ .github/workflows/tests.yml | 41 ++++++++++++++++++++ .gitignore | 2 - README.md | 3 +- docs/conf.py | 4 ++ 5 files changed, 122 insertions(+), 3 deletions(-) create mode 100644 .github/workflows/docs.yml create mode 100644 .github/workflows/tests.yml diff --git a/.github/workflows/docs.yml b/.github/workflows/docs.yml new file mode 100644 index 0000000..b9a2e2c --- /dev/null +++ b/.github/workflows/docs.yml @@ -0,0 +1,75 @@ +name: Docs + +on: + push: + branches: + - main + paths: + - ".github/workflows/docs.yml" + - "docs/**" + - "tracketch/**" + - "pyproject.toml" + workflow_dispatch: + +permissions: + contents: read + pages: write + id-token: write + +concurrency: + group: pages + cancel-in-progress: true + +jobs: + build: + runs-on: ubuntu-latest + + steps: + - name: Check out repository + uses: actions/checkout@v4 + + - name: Set up Python + uses: actions/setup-python@v5 + with: + python-version: "3.12" + + - name: Install documentation dependencies + run: | + python -m pip install --upgrade pip + python -m pip install \ + "numpy<=2.2" \ + matplotlib \ + seaborn \ + pyyaml \ + pandas \ + scipy \ + joblib \ + scikit-image \ + "sphinx>=8,<9" \ + "sphinx-rtd-theme>=3.0" + + - name: Build HTML documentation + run: python -m sphinx -b html docs docs/_build/html + + - name: Disable Jekyll processing + run: touch docs/_build/html/.nojekyll + + - name: Configure GitHub Pages + uses: actions/configure-pages@v5 + + - name: Upload Pages artifact + uses: actions/upload-pages-artifact@v3 + with: + path: docs/_build/html + + deploy: + needs: build + runs-on: ubuntu-latest + environment: + name: github-pages + url: ${{ steps.deployment.outputs.page_url }} + + steps: + - name: Deploy to GitHub Pages + id: deployment + uses: actions/deploy-pages@v4 \ No newline at end of file diff --git a/.github/workflows/tests.yml b/.github/workflows/tests.yml new file mode 100644 index 0000000..629a9cf --- /dev/null +++ b/.github/workflows/tests.yml @@ -0,0 +1,41 @@ +name: Tests + +on: + push: + branches: + - main + paths: + - ".github/workflows/tests.yml" + - "tracketch/**" + - "tests/**" + - "pyproject.toml" + pull_request: + branches: + - main + paths: + - ".github/workflows/tests.yml" + - "tracketch/**" + - "tests/**" + - "pyproject.toml" + workflow_dispatch: + +jobs: + pytest: + runs-on: ubuntu-latest + + steps: + - name: Check out repository + uses: actions/checkout@v4 + + - name: Set up Python + uses: actions/setup-python@v5 + with: + python-version: "3.10" + + - name: Install test dependencies + run: | + python -m pip install --upgrade pip + python -m pip install -e ".[dev,numba]" + + - name: Run pytest + run: python -m pytest -q \ No newline at end of file diff --git a/.gitignore b/.gitignore index 0a79849..b6d4078 100644 --- a/.gitignore +++ b/.gitignore @@ -32,8 +32,6 @@ docs/_build/ .env .venv -.github/ - # Ruff .ruff_cache/ diff --git a/README.md b/README.md index 5968d30..cfd4c52 100644 --- a/README.md +++ b/README.md @@ -2,7 +2,8 @@ [![License](https://img.shields.io/badge/license-MIT-green.svg)](LICENSE) [![Python](https://img.shields.io/badge/python-3.10+-blue.svg)](https://www.python.org/) [![Tests](https://img.shields.io/badge/tests-pytest-brightgreen.svg)](tests/) -[![HitCount](https://hits.dwyl.com/{username}/{project-name}.svg)](https://hits.dwyl.com/{username}/{project-name}) +[![HitCount](https://hits.dwyl.com/jbrage/tracketch.svg?style=flat-square&show=unique)](http://hits.dwyl.com/jbrage/tracketch) + # tracketch diff --git a/docs/conf.py b/docs/conf.py index 047cd67..6a6c464 100644 --- a/docs/conf.py +++ b/docs/conf.py @@ -21,6 +21,10 @@ "sphinx.ext.intersphinx", ] +# GitHub Pages builds import the package directly from the repository root. +# Mock native or platform-specific dependencies so autodoc can run in CI. +autodoc_mock_imports = ["numba", "pyamtrack", "skfmm"] + templates_path = ["_templates"] exclude_patterns = ["_build", "publication"]