| 1 |
name: change detection |
| 2 |
on: |
| 3 |
workflow_call: |
| 4 |
outputs: |
| 5 |
run-docs: |
| 6 |
description: Whether or not build the docs |
| 7 |
value: ${{ jobs.change-detection.outputs.run-docs || false }} |
| 8 |
run-tests: |
| 9 |
description: Whether or not run the tests |
| 10 |
value: ${{ jobs.change-detection.outputs.run-tests || false }} |
| 11 |
|
| 12 |
permissions: {} |
| 13 |
|
| 14 |
jobs: |
| 15 |
change-detection: |
| 16 |
name: Identify source changes |
| 17 |
runs-on: ubuntu-latest |
| 18 |
timeout-minutes: 1 |
| 19 |
outputs: |
| 20 |
run-docs: ${{ steps.docs-changes.outputs.run-docs || false }} |
| 21 |
run-tests: ${{ steps.tests-changes.outputs.run-tests || false }} |
| 22 |
steps: |
| 23 |
- uses: actions/checkout@9c091bb21b7c1c1d1991bb908d89e4e9dddfe3e0 # v7.0.0 |
| 24 |
with: |
| 25 |
persist-credentials: false |
| 26 |
- name: Get a list of the changed runtime-related files |
| 27 |
if: github.event_name == 'pull_request' |
| 28 |
id: changed-testable-files |
| 29 |
uses: Ana06/get-changed-files@25f79e676e7ea1868813e21465014798211fad8c # v2.3.0 |
| 30 |
with: |
| 31 |
filter: | |
| 32 |
src/** |
| 33 |
tests/** |
| 34 |
tox.toml |
| 35 |
pyproject.toml |
| 36 |
.github/workflows/test.yml |
| 37 |
.github/workflows/reusable-type.yml |
| 38 |
.github/workflows/reusable-pytest.yml |
| 39 |
- name: Set a flag for running the tests |
| 40 |
if: >- |
| 41 |
github.event_name != 'pull_request' |
| 42 |
|| steps.changed-testable-files.outputs.added_modified_renamed != '' |
| 43 |
id: tests-changes |
| 44 |
run: >- |
| 45 |
echo "run-tests=true" >> "${GITHUB_OUTPUT}" |
| 46 |
- name: Get a list of the changed documentation-related files |
| 47 |
if: github.event_name == 'pull_request' |
| 48 |
id: changed-docs-files |
| 49 |
uses: Ana06/get-changed-files@25f79e676e7ea1868813e21465014798211fad8c # v2.3.0 |
| 50 |
with: |
| 51 |
filter: | |
| 52 |
docs/** |
| 53 |
CHANGELOG.rst |
| 54 |
README.md |
| 55 |
.github/workflows/test.yml |
| 56 |
.github/workflows/reusable-docs.yml |
| 57 |
- name: Set a flag for building the docs |
| 58 |
if: >- |
| 59 |
github.event_name != 'pull_request' |
| 60 |
|| steps.changed-docs-files.outputs.added_modified_renamed != '' |
| 61 |
id: docs-changes |
| 62 |
run: >- |
| 63 |
echo "run-docs=true" >> "${GITHUB_OUTPUT}" |