Skip to content
Open
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
12 changes: 12 additions & 0 deletions .github/workflows/docs.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -7,10 +7,14 @@ on:
- 'docs/**'
- 'mkdocs.yml'
- 'flixopt/**'
- '.github/workflows/**'
pull_request:
types: [opened, synchronize, reopened, ready_for_review]
paths:
- 'docs/**'
- 'mkdocs.yml'
- 'flixopt/**'
- '.github/workflows/**'
workflow_dispatch:
workflow_call:
inputs:
Expand Down Expand Up @@ -81,6 +85,14 @@ jobs:
grep -vFf slow_notebooks.txt | \
xargs -P 4 -I {} sh -c 'jupyter execute --inplace "$1" || exit 255' _ {}

- name: Execute slow notebooks
if: steps.notebook-cache.outputs.cache-hit != 'true' && github.event.pull_request.draft != 'true'
run: |
set -eo pipefail
# Execute slow notebooks in parallel (skip on draft PRs)
cd docs/notebooks && cat slow_notebooks.txt | \
xargs -P 4 -I {} sh -c 'jupyter execute --inplace "$1" || exit 255' _ {}

- name: Build docs
env:
MKDOCS_JUPYTER_EXECUTE: "false"
Expand Down
20 changes: 19 additions & 1 deletion .github/workflows/tests.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -3,8 +3,19 @@ name: Tests
on:
push:
branches: [main]
paths:
- 'flixopt/**'
- 'tests/**'
- 'pyproject.toml'
- '.github/workflows/**'
pull_request:
types: [opened, synchronize, reopened, ready_for_review]
branches: ["**"]
paths:
- 'flixopt/**'
- 'tests/**'
- 'pyproject.toml'
- '.github/workflows/**'
workflow_dispatch:
workflow_call: # Allow release.yaml to call this workflow.

Expand Down Expand Up @@ -62,7 +73,14 @@ jobs:
run: uv pip install --system .[dev]

- name: Run tests
run: pytest -v --numprocesses=auto
run: |
if [[ "${{ github.event.pull_request.draft }}" == "true" ]]; then
# Draft PR: skip examples, slow, and deprecated_api
pytest -v --numprocesses=auto -m "not examples and not slow and not deprecated_api"
else
# Ready PR & main push: examples excluded via addopts
pytest -v --numprocesses=auto
fi

test-examples:
runs-on: ubuntu-24.04
Expand Down