Skip to content

Commit

Permalink
ci: Externalize repo files checking
Browse files Browse the repository at this point in the history
  • Loading branch information
frascuchon committed Jul 2, 2023
1 parent de5d908 commit 1440e16
Show file tree
Hide file tree
Showing 2 changed files with 38 additions and 0 deletions.
28 changes: 28 additions & 0 deletions .github/workflows/check-repo-files.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,28 @@
name: Check repository files

on:
workflow_call:
outputs:
pythonCode:
description: "True if some files in python code have changed"
value: ${{ jobs.check-repo-files.outputs.pythonCode }}

jobs:
check-repo-files:
name: Check repo files
runs-on: ubuntu-latest
outputs:
pythonCode: ${{ steps.path_filter.outputs.pythonCode }}
steps:
- name: Checkout Code 🛎
uses: actions/checkout@v2
- name: Check affected files
uses: dorny/paths-filter@v2
id: path_filter
with:
filters: |
pythonCode:
- 'src/**'
- 'tests/**'
- 'pyproject.toml'
- 'setup.py'
10 changes: 10 additions & 0 deletions .github/workflows/package.yml
Original file line number Diff line number Diff line change
Expand Up @@ -29,6 +29,16 @@ env:

jobs:

check_repo_files:
name: Check source changes
uses: ./.github/workflows/check-repo-files.yml

show_changes:
runs-on: ubuntu-latest
needs: check_repo_files
steps:
- run: echo ${{ needs.check_repo_files.outputs.pythonCode }}

run_tests:
name: Run server tests
uses: ./.github/workflows/run-python-tests.yml
Expand Down

0 comments on commit 1440e16

Please sign in to comment.