|
21 | 21 |
|
22 | 22 | jobs: |
23 | 23 | # Check if changes were made to the relevant files. |
24 | | - # Always returns true if running on the default branch, to ensure all changes are throughly checked. |
| 24 | + # Always returns true if running on the default branch, to ensure all changes are thoroughly checked. |
25 | 25 | changes: |
26 | 26 | name: Check for changes in Python files |
27 | 27 | runs-on: ubuntu-latest |
|
31 | 31 | # Set job outputs to values from filter step |
32 | 32 | outputs: |
33 | 33 | python: ${{ github.ref_name == github.event.repository.default_branch || steps.filter.outputs.python }} |
| 34 | + extensions: ${{ github.ref_name == github.event.repository.default_branch || steps.filter.outputs.std-extensions }} |
34 | 35 | steps: |
35 | 36 | - uses: actions/checkout@v4 |
36 | 37 | - uses: dorny/paths-filter@v3 |
@@ -179,11 +180,41 @@ jobs: |
179 | 180 | exit 1 |
180 | 181 | fi |
181 | 182 |
|
| 183 | + extension-versions: |
| 184 | + runs-on: ubuntu-latest |
| 185 | + needs: [changes] |
| 186 | + if: ${{ needs.changes.outputs.extensions == 'true' }} |
| 187 | + name: Check std extensions versions |
| 188 | + steps: |
| 189 | + - uses: actions/checkout@v4 |
| 190 | + with: |
| 191 | + fetch-depth: 0 # Need full history to compare with main |
| 192 | + |
| 193 | + - name: Set up Python |
| 194 | + uses: actions/setup-python@v4 |
| 195 | + with: |
| 196 | + python-version: '3.10' |
| 197 | + |
| 198 | + - name: Check if extension versions are updated |
| 199 | + run: | |
| 200 | + # Check against latest tag on the target branch |
| 201 | + # When not on a pull request, base_ref should be empty so we default to HEAD |
| 202 | + if [ -z "$TARGET_REF" ]; then |
| 203 | + BASE_SHA="HEAD~1" |
| 204 | + else |
| 205 | + BASE_SHA=$(git rev-parse origin/$TARGET_REF) |
| 206 | + fi |
| 207 | + echo "Comparing to ref: $BASE_SHA" |
| 208 | +
|
| 209 | + python ./scripts/check_extension_versions.py $BASE_SHA |
| 210 | + env: |
| 211 | + TARGET_REF: ${{ github.base_ref }} |
| 212 | + |
182 | 213 | # This is a meta job to mark successful completion of the required checks, |
183 | 214 | # even if they are skipped due to no changes in the relevant files. |
184 | 215 | required-checks: |
185 | 216 | name: Required checks 🐍 |
186 | | - needs: [changes, check, test, serialization-schema] |
| 217 | + needs: [changes, check, test, serialization-schema, extension-versions] |
187 | 218 | if: ${{ !cancelled() }} |
188 | 219 | runs-on: ubuntu-latest |
189 | 220 | steps: |
|
0 commit comments