Skip to content

Commit 3f25ca4

Browse files
committed
Skip building pythonbuild when not needed
1 parent 295069d commit 3f25ca4

File tree

1 file changed

+13
-2
lines changed

1 file changed

+13
-2
lines changed

.github/workflows/linux.yml

Lines changed: 13 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -14,6 +14,9 @@ env:
1414

1515
jobs:
1616
pythonbuild:
17+
if: ${{ needs.generate-matrix.outputs.pythonbuild_changed == 'true' || needs.generate-matrix.outputs.any_builds == 'true' || github.ref == 'refs/heads/main' }}
18+
needs:
19+
- generate-matrix
1720
runs-on: depot-ubuntu-22.04
1821
steps:
1922
- name: Install System Dependencies
@@ -46,9 +49,9 @@ jobs:
4649
path: target/release/pythonbuild
4750

4851
image:
52+
if: ${{ needs.generate-matrix.outputs.any_builds == 'true' }}
4953
needs:
5054
- generate-matrix
51-
if: ${{ needs.generate-matrix.outputs.any_builds == 'true' }}
5255
strategy:
5356
fail-fast: false
5457
matrix:
@@ -123,6 +126,7 @@ jobs:
123126
outputs:
124127
matrix: ${{ steps.set-matrix.outputs.matrix }}
125128
any_builds: ${{ steps.set-matrix.outputs.any_builds }}
129+
pythonbuild_changed: ${{ steps.changed.outputs.pythonbuild_any_changed }}
126130
steps:
127131
- uses: actions/checkout@v4
128132

@@ -150,7 +154,14 @@ jobs:
150154
# Build matrix is empty
151155
echo "any_builds=false" >> $GITHUB_OUTPUT
152156
fi
153-
157+
158+
- uses: tj-actions/changed-files@v45
159+
id: changed
160+
with:
161+
files_yaml: |
162+
pythonbuild:
163+
- "src/*.rs"
164+
154165
build:
155166
needs:
156167
- generate-matrix

0 commit comments

Comments
 (0)