Skip to content

Commit 9f9024e

Browse files
committed
Add commit message triggers for CI control
Implemented SciPy-style commit message patterns: Debug control: [show debug] - Show detailed debug output (Windows only, off by default) Platform skip patterns: [skip linux] - Skip all Linux test jobs [skip macos] - Skip all macOS test jobs [skip windows] - Skip all Windows test jobs [skip ci] - Skip all test jobs Examples: 'Fix documentation [skip ci]' 'Debug Windows issue [show debug]' 'Test Linux fix [skip windows] [skip macos]'
1 parent 82a5592 commit 9f9024e

5 files changed

Lines changed: 18 additions & 1 deletion

File tree

.github/workflows/test-linux-basic.yml

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -5,6 +5,8 @@ on:
55

66
jobs:
77
test-linux:
8+
# Skip if commit message contains [skip linux] or [skip ci]
9+
if: "!contains(github.event.head_commit.message, '[skip linux]') && !contains(github.event.head_commit.message, '[skip ci]')"
810
runs-on: ubuntu-latest
911

1012
steps:

.github/workflows/test-linux-conda.yml

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -5,6 +5,8 @@ on:
55

66
jobs:
77
test-conda-mkl:
8+
# Skip if commit message contains [skip linux] or [skip ci]
9+
if: "!contains(github.event.head_commit.message, '[skip linux]') && !contains(github.event.head_commit.message, '[skip ci]')"
810
runs-on: ubuntu-latest
911

1012
steps:

.github/workflows/test-macos.yml

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -5,6 +5,8 @@ on:
55

66
jobs:
77
test-macos:
8+
# Skip if commit message contains [skip macos] or [skip ci]
9+
if: "!contains(github.event.head_commit.message, '[skip macos]') && !contains(github.event.head_commit.message, '[skip ci]')"
810
runs-on: macos-latest
911

1012
steps:

.github/workflows/test-matrix.yml

Lines changed: 8 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -5,6 +5,8 @@ on:
55

66
jobs:
77
test:
8+
# Skip if commit message contains [skip ci]
9+
if: "!contains(github.event.head_commit.message, '[skip ci]')"
810
strategy:
911
fail-fast: false
1012
matrix:
@@ -14,6 +16,10 @@ jobs:
1416
# Optionally exclude some combinations if needed
1517
- os: windows-latest
1618
python-version: '3.11' # Example: skip older Python on Windows
19+
# Skip platforms based on commit message
20+
- os: ${{ contains(github.event.head_commit.message, '[skip linux]') && 'ubuntu-latest' || '' }}
21+
- os: ${{ contains(github.event.head_commit.message, '[skip macos]') && 'macos-latest' || '' }}
22+
- os: ${{ contains(github.event.head_commit.message, '[skip windows]') && 'windows-latest' || '' }}
1723

1824
runs-on: ${{ matrix.os }}
1925
name: Test on ${{ matrix.os }} - Python ${{ matrix.python-version }}
@@ -62,7 +68,8 @@ jobs:
6268
meson install -C build --destdir="${PWD}/build-install"
6369
6470
- name: Debug - Check install directory (Windows only)
65-
if: runner.os == 'Windows'
71+
# Only run if commit message contains [show debug]
72+
if: runner.os == 'Windows' && contains(github.event.head_commit.message, '[show debug]')
6673
shell: bash -l {0}
6774
run: |
6875
echo "=== Checking build-install structure ==="

.github/workflows/test-windows.yml

Lines changed: 4 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -5,6 +5,8 @@ on:
55

66
jobs:
77
test-windows:
8+
# Skip if commit message contains [skip windows] or [skip ci]
9+
if: "!contains(github.event.head_commit.message, '[skip windows]') && !contains(github.event.head_commit.message, '[skip ci]')"
810
runs-on: windows-latest
911

1012
steps:
@@ -44,6 +46,8 @@ jobs:
4446
meson install -C build --destdir="${PWD}/build-install"
4547
4648
- name: Debug - Check install directory structure
49+
# Only run if commit message contains [show debug]
50+
if: contains(github.event.head_commit.message, '[show debug]')
4751
shell: bash -l {0}
4852
run: |
4953
echo "=== Checking build-install structure ==="

0 commit comments

Comments
 (0)