File tree Expand file tree Collapse file tree 3 files changed +36
-21
lines changed Expand file tree Collapse file tree 3 files changed +36
-21
lines changed Original file line number Diff line number Diff line change @@ -130,9 +130,11 @@ jobs:
130
130
matrix-0 : ${{ steps.set-matrix.outputs.matrix-0 }}
131
131
matrix-1 : ${{ steps.set-matrix.outputs.matrix-1 }}
132
132
any_builds : ${{ steps.set-matrix.outputs.any_builds }}
133
- pythonbuild_changed : ${{ steps.changed .outputs.pythonbuild_any_changed }}
133
+ pythonbuild_changed : ${{ steps.check-pythonbuild .outputs.changed }}
134
134
steps :
135
135
- uses : actions/checkout@v4
136
+ with :
137
+ fetch-depth : 0 # fetch history for subsequent `git diff`
136
138
137
139
- name : Set up Python
138
140
uses : astral-sh/setup-uv@v4
@@ -167,12 +169,15 @@ jobs:
167
169
echo "any_builds=false" >> $GITHUB_OUTPUT
168
170
fi
169
171
170
- - uses : tj-actions/changed-files@v45
171
- id : changed
172
- with :
173
- files_yaml : |
174
- pythonbuild:
175
- - "src/*.rs"
172
+ - name : Check if the `pythonbuild` crate changed
173
+ id : check-pythonbuild
174
+ run : |
175
+ if git diff --quiet ${{ github.event.pull_request.base.sha || 'origin/main' }}...HEAD -- ':src/*.rs'; then
176
+ echo "changed=false" >> "$GITHUB_OUTPUT"
177
+ else
178
+ echo "changed=true" >> "$GITHUB_OUTPUT"
179
+ fi
180
+
176
181
177
182
build-0 :
178
183
needs :
Original file line number Diff line number Diff line change 48
48
outputs :
49
49
matrix : ${{ steps.set-matrix.outputs.matrix }}
50
50
any_builds : ${{ steps.set-matrix.outputs.any_builds }}
51
- pythonbuild_changed : ${{ steps.changed .outputs.pythonbuild_any_changed }}
51
+ pythonbuild_changed : ${{ steps.check-pythonbuild .outputs.changed }}
52
52
steps :
53
53
- uses : actions/checkout@v4
54
+ with :
55
+ fetch-depth : 0 # fetch history for subsequent `git diff`
54
56
55
57
- name : Set up Python
56
58
uses : astral-sh/setup-uv@v4
@@ -77,12 +79,14 @@ jobs:
77
79
echo "any_builds=false" >> $GITHUB_OUTPUT
78
80
fi
79
81
80
- - uses : tj-actions/changed-files@v45
81
- id : changed
82
- with :
83
- files_yaml : |
84
- pythonbuild:
85
- - "src/*.rs"
82
+ - name : Check if the `pythonbuild` crate changed
83
+ id : check-pythonbuild
84
+ run : |
85
+ if git diff --quiet ${{ github.event.pull_request.base.sha || 'origin/main' }}...HEAD -- ':src/*.rs'; then
86
+ echo "changed=false" >> "$GITHUB_OUTPUT"
87
+ else
88
+ echo "changed=true" >> "$GITHUB_OUTPUT"
89
+ fi
86
90
build :
87
91
needs :
88
92
- generate-matrix
Original file line number Diff line number Diff line change 48
48
outputs :
49
49
matrix : ${{ steps.set-matrix.outputs.matrix }}
50
50
any_builds : ${{ steps.set-matrix.outputs.any_builds }}
51
- pythonbuild_changed : ${{ steps.changed .outputs.pythonbuild_any_changed }}
51
+ pythonbuild_changed : ${{ steps.check-pythonbuild .outputs.changed }}
52
52
steps :
53
53
- uses : actions/checkout@v4
54
+ with :
55
+ fetch-depth : 0 # fetch history for subsequent `git diff`
54
56
55
57
- name : Set up Python
56
58
uses : astral-sh/setup-uv@v4
@@ -77,12 +79,16 @@ jobs:
77
79
echo "any_builds=false" >> $GITHUB_OUTPUT
78
80
fi
79
81
80
- - uses : tj-actions/changed-files@v45
81
- id : changed
82
- with :
83
- files_yaml : |
84
- pythonbuild:
85
- - "src/*.rs"
82
+
83
+ - name : Check if the `pythonbuild` crate changed
84
+ id : check-pythonbuild
85
+ shell : bash
86
+ run : |
87
+ if git diff --quiet ${{ github.event.pull_request.base.sha || 'origin/main' }}...HEAD -- ':src/*.rs'; then
88
+ echo "changed=false" >> "$GITHUB_OUTPUT"
89
+ else
90
+ echo "changed=true" >> "$GITHUB_OUTPUT"
91
+ fi
86
92
87
93
build :
88
94
needs :
You can’t perform that action at this time.
0 commit comments