Skip to content

Commit

Permalink
Run only necessary jobs in CI
Browse files Browse the repository at this point in the history
  • Loading branch information
lkubb committed Oct 9, 2024
1 parent e7b8771 commit 4438959
Show file tree
Hide file tree
Showing 2 changed files with 25 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 @@ -20,13 +20,17 @@ jobs:

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

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

Expand Down
21 changes: 21 additions & 0 deletions .github/workflows/get-changed-files.yml
Original file line number Diff line number Diff line change
Expand Up @@ -35,6 +35,27 @@ jobs:
pre-commit:
- added|modified|deleted:
- .pre-commit-config.y?(a)ml
- .pylintrc
docs:
- added|modified|deleted:
- .github/**
- changelog/**
- docs/**
- noxfile.py
- CHANGELOG.md
- pyproject.toml
needs_tests:
- added|modified|deleted:
- .github/**
- data/**
- jinja_extensions/**
- project/**
- tasks/**
- tests/**
- copier.yml
- noxfile.py
- pyproject.toml
- pytest.ini
- name: Echo Changed Files Output
run: echo "${{ toJSON(steps.changed-files.outputs) }}"

0 comments on commit 4438959

Please sign in to comment.