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
70 changes: 70 additions & 0 deletions .github/workflows/docs.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,70 @@
# Builds the MkDocs documentation site and deploys it to GitHub Pages.
#
# Setup (one time, in the repository settings):
# Settings > Pages > Build and deployment > Source: "GitHub Actions"
#
# After that, every push to `master` that touches the docs, the source, or this
# workflow rebuilds and publishes https://<owner>.github.io/radCAD/.

name: Documentation

on:
push:
branches: [ master ]
paths:
- 'docs/**'
- 'mkdocs.yml'
- 'radcad/**'
- '.github/workflows/docs.yml'
pull_request:
branches: [ master ]
paths:
- 'docs/**'
- 'mkdocs.yml'
- 'radcad/**'
- '.github/workflows/docs.yml'
workflow_dispatch:

# Allow only one concurrent deployment, skipping runs queued between the run
# in-progress and latest queued. Do not cancel in-progress runs.
concurrency:
group: pages
cancel-in-progress: false

jobs:
build:
runs-on: ubuntu-latest
steps:
- uses: actions/checkout@v4
- name: Set up Python
uses: actions/setup-python@v5
with:
python-version: '3.11'
- name: Install uv
run: python -m pip install --upgrade pip uv
- name: Build site (strict)
# `uv run` syncs radCAD plus the docs extras (no dev group) from the
# lockfile, then runs mkdocs in that environment.
run: uv run --frozen --extra docs --no-dev mkdocs build --strict
- name: Upload Pages artifact
# Only publish from master; PRs build for validation only.
if: github.event_name == 'push' || github.event_name == 'workflow_dispatch'
uses: actions/upload-pages-artifact@v3
with:
path: site

deploy:
# Only deploy on push to master / manual dispatch, not on pull requests.
if: github.event_name == 'push' || github.event_name == 'workflow_dispatch'
needs: build
runs-on: ubuntu-latest
permissions:
pages: write
id-token: write
environment:
name: github-pages
url: ${{ steps.deployment.outputs.page_url }}
steps:
- name: Deploy to GitHub Pages
id: deployment
uses: actions/deploy-pages@v4
27 changes: 11 additions & 16 deletions .github/workflows/python.yml
Original file line number Diff line number Diff line change
Expand Up @@ -15,7 +15,12 @@ on:

jobs:
build:
runs-on: ${{ matrix.os }}-latest
# `macOS-latest` is arm64 (macos-14+). PyTables only ships macOS arm64
# wheels from 3.10.1 (Python 3.10+); Python 3.8/3.9 use older `tables` with
# x86_64-only wheels, so route those to the Intel `macos-13` runner to avoid
# a source build. Python 3.10+ runs on arm64. Ubuntu and Windows keep
# `*-latest`.
runs-on: ${{ (matrix.os == 'macOS' && matrix.python-minor-version < 10) && 'macos-13' || format('{0}-latest', matrix.os) }}
strategy:
fail-fast: false
matrix:
Expand All @@ -31,22 +36,12 @@ jobs:
uses: actions/setup-python@v2
with:
python-version: ${{ env.python-version }}
- name: Install build dependencies
- name: Install uv and Nox
run: |
python -m pip install --upgrade pip setuptools wheel
python -m pip install pdm nox
- name: Install build dependencies for MacOS
if: ${{ matrix.os == 'macOS' }}
run: |
brew install hdf5 c-blosc
- name: Install radCAD dependencies for Python 3.8
if: ${{ matrix.python-minor-version == 8 }}
run: |
pdm sync -d -G compat --lockfile pdm-py38.lock
- name: Install radCAD dependencies for Python 3.9+
if: ${{ matrix.python-minor-version >= 9 }}
run: |
pdm sync -d -G compat --lockfile pdm.lock
python -m pip install --upgrade pip
python -m pip install uv nox
- name: Run tests using Nox
# Nox creates the per-version venv and uses `uv sync --frozen` (single
# uv.lock) to install the project and dependencies into it.
run: |
python -m nox -s tests-${{ env.python-version }}
1 change: 1 addition & 0 deletions .python-version
Original file line number Diff line number Diff line change
@@ -0,0 +1 @@
3.12
Loading
Loading