Skip to content

Commit

Permalink
Run only necessary jobs in PR CI
Browse files Browse the repository at this point in the history
  • Loading branch information
lkubb committed Oct 18, 2024
1 parent 7855261 commit ec00c87
Show file tree
Hide file tree
Showing 2 changed files with 19 additions and 0 deletions.
4 changes: 4 additions & 0 deletions .github/workflows/ci.yml
Original file line number Diff line number Diff line change
Expand Up @@ -34,12 +34,16 @@ jobs:
name: Tests
needs:
- pre-commit
- get-changed-files
if: github.event_name != 'pull_request' || fromJSON(needs.get-changed-files.outputs.changed-files)['needs_tests'] == 'true'
uses: ./.github/workflows/test-action.yml

docs:
name: Docs
needs:
- pre-commit
- get-changed-files
if: github.event_name != 'pull_request' || fromJSON(needs.get-changed-files.outputs.changed-files)['docs'] == 'true'
uses: ./.github/workflows/docs-action.yml

deploy-docs:
Expand Down
15 changes: 15 additions & 0 deletions .github/workflows/get-changed-files.yml
Original file line number Diff line number Diff line change
Expand Up @@ -34,6 +34,21 @@ jobs:
- .pre-commit-config.y?(a)ml
- .pylintrc
- pyproject.toml
docs:
- added|modified|deleted:
- .github/**
- docs/**
- noxfile.py
- CHANGELOG.rst
- README.rst
- pyproject.toml
needs_tests:
- added|modified|deleted:
- .github/**
- src/**
- tests/**
- noxfile.py
- pyproject.toml
- name: Echo Changed Files Output
run: echo "${{ toJSON(steps.changed-files.outputs) }}"

0 comments on commit ec00c87

Please sign in to comment.