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
20 changes: 8 additions & 12 deletions .github/dependabot.yml
Original file line number Diff line number Diff line change
@@ -1,18 +1,14 @@
version: 2
updates:
# Maintain dependencies for GitHub Actions as recommended in SPEC8:
# https://github.com/scientific-python/specs/pull/325
# At the time of writing, release critical workflows such as
# pypa/gh-action-pypi-publish should use hash-based versioning for security
# reasons. This strategy may be generalized to all other github actions
# in the future.
- package-ecosystem: "uv"
directory: "/"
schedule:
interval: "daily"
labels:
- "dependencies"
- package-ecosystem: "github-actions"
directory: "/"
schedule:
interval: "weekly"
groups:
actions:
patterns:
- "*"
reviewers:
- "glemaitre"
labels:
- "dependencies"
23 changes: 23 additions & 0 deletions .github/workflows/ci.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,23 @@
name: CI

on:
push:
branches:
- main
pull_request:
branches:
- main

permissions:
contents: read

jobs:
lint:
uses: ./.github/workflows/lint.yml

tests:
uses: ./.github/workflows/pytest.yml
secrets: inherit

docs:
uses: ./.github/workflows/docs.yml
48 changes: 35 additions & 13 deletions .github/workflows/deploy-gh-pages.yml
Original file line number Diff line number Diff line change
Expand Up @@ -4,31 +4,53 @@ on:
push:
branches:
- main
tags:
- "v*"
pull_request:
branches:
- main

jobs:
docs-check:
uses: ./.github/workflows/docs.yml

deploy-gh-pages:
needs: docs-check
if: ${{ github.event_name == 'push' }}
runs-on: ubuntu-latest
permissions:
contents: write

steps:
- uses: actions/checkout@v4
with:
fetch-depth: 0
- uses: prefix-dev/setup-pixi@v0.8.3
with:
pixi-version: v0.41.4
environments: doc
frozen: true

- name: Build documentation
run: pixi run -e doc build-doc
- name: Set up Python
uses: actions/setup-python@v5
with:
python-version: "3.13"

- name: Update the main gh-page website
if: ${{ github.event_name == 'push' && github.ref == 'refs/heads/main' }}
uses: peaceiris/actions-gh-pages@v4.0.0
- name: Set up uv
uses: astral-sh/setup-uv@v6
with:
github_token: ${{ secrets.GITHUB_TOKEN }}
publish_dir: ./site
commit_message: "[ci skip] ${{ github.event.head_commit.message }}"
enable-cache: true

- name: Install docs dependencies
run: uv sync --frozen --no-default-groups --group docs

- name: Deploy docs as dev
if: ${{ github.ref == 'refs/heads/main' }}
run: |
git config user.name "github-actions[bot]"
git config user.email "41898282+github-actions[bot]@users.noreply.github.com"
uv run mike deploy --push --update-aliases dev

- name: Deploy versioned docs and update latest
if: ${{ startsWith(github.ref, 'refs/tags/v') }}
run: |
VERSION="${GITHUB_REF_NAME#v}"
git config user.name "github-actions[bot]"
git config user.email "41898282+github-actions[bot]@users.noreply.github.com"
uv run mike deploy --push --update-aliases "$VERSION" latest
uv run mike set-default --push latest
32 changes: 32 additions & 0 deletions .github/workflows/docs.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,32 @@
name: Docs Check

on:
workflow_call:
workflow_dispatch:

permissions:
contents: read

jobs:
docs:
runs-on: ubuntu-latest
steps:
- uses: actions/checkout@v4
with:
fetch-depth: 0

- name: Set up Python
uses: actions/setup-python@v5
with:
python-version: "3.13"

- name: Set up uv
uses: astral-sh/setup-uv@v6
with:
enable-cache: true

- name: Install docs dependencies
run: uv sync --frozen --no-default-groups --group docs

- name: Build documentation (strict, execute notebooks)
run: uv run mkdocs build --strict
31 changes: 19 additions & 12 deletions .github/workflows/lint.yml
Original file line number Diff line number Diff line change
@@ -1,23 +1,30 @@
name: Linter

on:
push:
branches:
- main
pull_request:
branches:
- main
workflow_call:
workflow_dispatch:

jobs:
build:
lint:
runs-on: ubuntu-latest
steps:
- uses: actions/checkout@v4
- uses: prefix-dev/setup-pixi@v0.8.3

- name: Set up Python
uses: actions/setup-python@v5
with:
python-version: "3.13"

- name: Set up uv
uses: astral-sh/setup-uv@v6
with:
pixi-version: v0.41.4
environments: lint
frozen: true
enable-cache: true

- name: Install lint dependencies
run: uv sync --frozen --no-default-groups --group lint

- name: Check format with Black
run: uv run black --check --diff .

- name: Run linter
run: pixi run -e lint lint
run: uv run ruff check .
Loading
Loading