Merge pull request #2024 from borglab/fix-req-check

Edit required check so that it doesn't hang when only non-code files modified
release/4.3a0
Frank Dellaert 2025-02-16 00:45:09 -05:00 committed by GitHub
commit 52b11e26d5
No known key found for this signature in database
GPG Key ID: B5690EEEBB952194
1 changed files with 25 additions and 6 deletions

View File

@ -1,11 +1,9 @@
name: Python CI
on:
pull_request:
paths-ignore:
- '**.md'
- '**.ipynb'
- 'myst.yml'
# Since this is a required check, specify paths-ignore in the check-paths job
# instead of under 'pull_request:'. Otherwise, the check is still required but
# never runs, and a maintainer must bypass the check in order to merge the PR.
on: [pull_request]
# Every time you make a push to your PR, it cancel immediately the previous checks,
# and start a new one. The other runner will be available more quickly to your PR.
@ -14,7 +12,28 @@ concurrency:
cancel-in-progress: true
jobs:
# Check paths to changed files to see if any are non-ignored.
check-paths:
runs-on: ubuntu-latest
outputs:
should_run: ${{ steps.filter.outputs.relevant_changes }}
steps:
- name: Check modified files
id: filter
uses: dorny/paths-filter@v2
with:
filters: |
relevant_changes:
- '!**.md'
- '!**.ipynb'
- '!myst.yml'
- '**' # Match everything else
build:
# Only run build if relevant files have been modified in this PR.
needs: check-paths
if: needs.check-paths.outputs.should_run == 'true'
name: ${{ matrix.name }} ${{ matrix.build_type }} Python ${{ matrix.python_version }}
runs-on: ${{ matrix.os }}