From b7c49361826d81207cb89fe14b34e21404b9d18e Mon Sep 17 00:00:00 2001 From: FBumann <117816358+FBumann@users.noreply.github.com> Date: Sat, 10 Jan 2026 15:40:30 +0100 Subject: [PATCH 1/8] Speed up ci by only ranning fast tests on drafts --- .github/workflows/tests.yaml | 7 ++++++- 1 file changed, 6 insertions(+), 1 deletion(-) diff --git a/.github/workflows/tests.yaml b/.github/workflows/tests.yaml index 151974368..3b9394a71 100644 --- a/.github/workflows/tests.yaml +++ b/.github/workflows/tests.yaml @@ -61,7 +61,12 @@ jobs: run: uv pip install --system .[dev] - name: Run tests - run: pytest -v --numprocesses=auto + run: | + if [[ "${{ github.event.pull_request.draft }}" == "true" ]]; then + pytest -v --numprocesses=auto -m "not slow" + else + pytest -v --numprocesses=auto + fi test-examples: runs-on: ubuntu-24.04 From ecf9265d06899f5c7a3d8df227c5007c3da0c3b1 Mon Sep 17 00:00:00 2001 From: FBumann <117816358+FBumann@users.noreply.github.com> Date: Sat, 10 Jan 2026 15:46:22 +0100 Subject: [PATCH 2/8] Remove deprecated from drafts --- .github/workflows/tests.yaml | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/.github/workflows/tests.yaml b/.github/workflows/tests.yaml index 3b9394a71..ef7ec0f75 100644 --- a/.github/workflows/tests.yaml +++ b/.github/workflows/tests.yaml @@ -63,7 +63,7 @@ jobs: - name: Run tests run: | if [[ "${{ github.event.pull_request.draft }}" == "true" ]]; then - pytest -v --numprocesses=auto -m "not slow" + pytest -v --numprocesses=auto -m "not slow and not deprecated_api" else pytest -v --numprocesses=auto fi From cfaeda055e9efc5b45814680fa34b6798d700121 Mon Sep 17 00:00:00 2001 From: FBumann <117816358+FBumann@users.noreply.github.com> Date: Sat, 10 Jan 2026 15:53:40 +0100 Subject: [PATCH 3/8] Improve test selection --- .github/workflows/tests.yaml | 4 +++- 1 file changed, 3 insertions(+), 1 deletion(-) diff --git a/.github/workflows/tests.yaml b/.github/workflows/tests.yaml index ef7ec0f75..caf463850 100644 --- a/.github/workflows/tests.yaml +++ b/.github/workflows/tests.yaml @@ -63,8 +63,10 @@ jobs: - name: Run tests run: | if [[ "${{ github.event.pull_request.draft }}" == "true" ]]; then - pytest -v --numprocesses=auto -m "not slow and not deprecated_api" + # 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 From a594b569893352903597a47c989bb57ba98e6100 Mon Sep 17 00:00:00 2001 From: FBumann <117816358+FBumann@users.noreply.github.com> Date: Sat, 10 Jan 2026 15:54:56 +0100 Subject: [PATCH 4/8] Make docs match this pattern --- .github/workflows/docs.yaml | 8 ++++++++ 1 file changed, 8 insertions(+) diff --git a/.github/workflows/docs.yaml b/.github/workflows/docs.yaml index c7488d702..302de2083 100644 --- a/.github/workflows/docs.yaml +++ b/.github/workflows/docs.yaml @@ -91,6 +91,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 (skip on draft PRs) + cd docs/notebooks && cat slow_notebooks.txt | \ + xargs -I {} sh -c 'jupyter execute --inplace "$1" || exit 255' _ {} + - name: Build docs env: MKDOCS_JUPYTER_EXECUTE: "false" From 80e52e59ad5be0c4834324a5783db88e93bbbf78 Mon Sep 17 00:00:00 2001 From: FBumann <117816358+FBumann@users.noreply.github.com> Date: Sat, 10 Jan 2026 15:57:57 +0100 Subject: [PATCH 5/8] Add include paths to workflows: - flixopt/** (source code) - tests/** (test files) - pyproject.toml (config/dependencies) --- .github/workflows/tests.yaml | 8 ++++++++ 1 file changed, 8 insertions(+) diff --git a/.github/workflows/tests.yaml b/.github/workflows/tests.yaml index caf463850..e0c8cb89f 100644 --- a/.github/workflows/tests.yaml +++ b/.github/workflows/tests.yaml @@ -3,8 +3,16 @@ name: Tests on: push: branches: [main] + paths: + - 'flixopt/**' + - 'tests/**' + - 'pyproject.toml' pull_request: branches: ["**"] + paths: + - 'flixopt/**' + - 'tests/**' + - 'pyproject.toml' workflow_dispatch: concurrency: From 960943533055e988e63c4664637c3eaf1726953f Mon Sep 17 00:00:00 2001 From: FBumann <117816358+FBumann@users.noreply.github.com> Date: Sat, 10 Jan 2026 15:59:31 +0100 Subject: [PATCH 6/8] Added .github/workflows/** to both tests and docs workflows. Now CI config changes will trigger both. --- .github/workflows/docs.yaml | 2 ++ .github/workflows/tests.yaml | 2 ++ 2 files changed, 4 insertions(+) diff --git a/.github/workflows/docs.yaml b/.github/workflows/docs.yaml index 302de2083..2f0d7c6e3 100644 --- a/.github/workflows/docs.yaml +++ b/.github/workflows/docs.yaml @@ -7,11 +7,13 @@ on: - 'docs/**' - 'mkdocs.yml' - 'flixopt/**' + - '.github/workflows/**' pull_request: paths: - 'docs/**' - 'mkdocs.yml' - 'flixopt/**' # notebooks import flixopt; catch library changes that break docs + - '.github/workflows/**' workflow_dispatch: inputs: deploy: diff --git a/.github/workflows/tests.yaml b/.github/workflows/tests.yaml index e0c8cb89f..62a192974 100644 --- a/.github/workflows/tests.yaml +++ b/.github/workflows/tests.yaml @@ -7,12 +7,14 @@ on: - 'flixopt/**' - 'tests/**' - 'pyproject.toml' + - '.github/workflows/**' pull_request: branches: ["**"] paths: - 'flixopt/**' - 'tests/**' - 'pyproject.toml' + - '.github/workflows/**' workflow_dispatch: concurrency: From 2cc84c2a692a4ebc3f7473c91e71fc5e028ebc77 Mon Sep 17 00:00:00 2001 From: FBumann <117816358+FBumann@users.noreply.github.com> Date: Sat, 10 Jan 2026 17:54:36 +0100 Subject: [PATCH 7/8] Retrigger CI From ee492588835d99ba5a5acd28e2cb565ba594e527 Mon Sep 17 00:00:00 2001 From: FBumann <117816358+FBumann@users.noreply.github.com> Date: Sat, 10 Jan 2026 17:58:02 +0100 Subject: [PATCH 8/8] Ensure workflows are triggered on ready_for_review --- .github/workflows/docs.yaml | 7 ++++--- .github/workflows/tests.yaml | 1 + 2 files changed, 5 insertions(+), 3 deletions(-) diff --git a/.github/workflows/docs.yaml b/.github/workflows/docs.yaml index 2f0d7c6e3..6addc2745 100644 --- a/.github/workflows/docs.yaml +++ b/.github/workflows/docs.yaml @@ -9,6 +9,7 @@ on: - 'flixopt/**' - '.github/workflows/**' pull_request: + types: [opened, synchronize, reopened, ready_for_review] paths: - 'docs/**' - 'mkdocs.yml' @@ -94,12 +95,12 @@ jobs: 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 + if: steps.notebook-cache.outputs.cache-hit != 'true' && github.event.pull_request.draft != 'true' run: | set -eo pipefail - # Execute slow notebooks (skip on draft PRs) + # Execute slow notebooks in parallel (skip on draft PRs) cd docs/notebooks && cat slow_notebooks.txt | \ - xargs -I {} sh -c 'jupyter execute --inplace "$1" || exit 255' _ {} + xargs -P 4 -I {} sh -c 'jupyter execute --inplace "$1" || exit 255' _ {} - name: Build docs env: diff --git a/.github/workflows/tests.yaml b/.github/workflows/tests.yaml index 62a192974..4dc7e91a3 100644 --- a/.github/workflows/tests.yaml +++ b/.github/workflows/tests.yaml @@ -9,6 +9,7 @@ on: - 'pyproject.toml' - '.github/workflows/**' pull_request: + types: [opened, synchronize, reopened, ready_for_review] branches: ["**"] paths: - 'flixopt/**'