File: reusable-change-detection.yml

package info (click to toggle)
python-build 1.2.2-5
  • links: PTS, VCS
  • area: main
  • in suites: forky, sid
  • size: 508 kB
  • sloc: python: 2,622; makefile: 16
file content (59 lines) | stat: -rw-r--r-- 2,030 bytes parent folder | download | duplicates (2)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
name: change detection
on:
  workflow_call:
    outputs:
      run-docs:
        description: Whether or not build the docs
        value: ${{ jobs.change-detection.outputs.run-docs || false }}
      run-tests:
        description: Whether or not run the tests
        value: ${{ jobs.change-detection.outputs.run-tests || false }}

jobs:
  change-detection:
    name: Identify source changes
    runs-on: ubuntu-latest
    timeout-minutes: 1
    outputs:
      run-docs: ${{ steps.docs-changes.outputs.run-docs || false }}
      run-tests: ${{ steps.tests-changes.outputs.run-tests || false }}
    steps:
      - uses: actions/checkout@v4
      - name: Get a list of the changed runtime-related files
        if: github.event_name == 'pull_request'
        id: changed-testable-files
        uses: Ana06/get-changed-files@v2.3.0
        with:
          filter: |
            src/**
            tests/**
            tox.ini
            pyproject.toml
            .github/workflows/test.yml
            .github/workflows/reusable-type.yml
            .github/workflows/reusable-pytest.yml
      - name: Set a flag for running the tests
        if: >-
          github.event_name != 'pull_request'
          || steps.changed-testable-files.outputs.added_modified_renamed != ''
        id: tests-changes
        run: >-
          echo "run-tests=true" >> "${GITHUB_OUTPUT}"
      - name: Get a list of the changed documentation-related files
        if: github.event_name == 'pull_request'
        id: changed-docs-files
        uses: Ana06/get-changed-files@v2.3.0
        with:
          filter: |
            docs/**
            CHANGELOG.rst
            README.md
            .github/workflows/test.yml
            .github/workflows/reusable-check.yml
      - name: Set a flag for building the docs
        if: >-
          github.event_name != 'pull_request'
          || steps.changed-docs-files.outputs.added_modified_renamed != ''
        id: docs-changes
        run: >-
          echo "run-docs=true" >> "${GITHUB_OUTPUT}"