forked from cda-tum/mqt-core
-
Notifications
You must be signed in to change notification settings - Fork 0
134 lines (133 loc) · 4.94 KB
/
reusable-change-detection.yml
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
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
124
125
126
127
128
129
130
131
132
133
134
name: ❓ • Change Detection
on:
workflow_call:
outputs:
run-cpp-tests:
description: Whether to run the C++ tests
value: ${{ jobs.change-detection.outputs.run-cpp-tests || false }}
run-cpp-linter:
description: Whether to run the C++ linter
value: ${{ jobs.change-detection.outputs.run-cpp-linter || false }}
run-python-tests:
description: Whether to run the Python tests
value: ${{ jobs.change-detection.outputs.run-python-tests || false }}
run-code-ql:
description: Whether to run CodeQL
value: ${{ jobs.change-detection.outputs.run-code-ql || false }}
jobs:
change-detection:
name: 🕵️ Check
runs-on: ubuntu-latest
timeout-minutes: 1
outputs:
run-cpp-tests: ${{ steps.cpp-tests-changes.outputs.run-cpp-tests || false }}
run-cpp-linter: ${{ steps.cpp-linter-changes.outputs.run-cpp-linter || false }}
run-python-tests: ${{ steps.python-tests-changes.outputs.run-python-tests || false }}
run-code-ql: ${{ steps.code-ql-changes.outputs.run-code-ql || false }}
steps:
- uses: actions/checkout@v4
- name: Get a list of the changed files relevant for the C++ tests
if: github.event_name == 'pull_request'
id: changed-cpp-testable-files
uses: Ana06/[email protected]
with:
filter: |
include/**
!include/python/**
src/**
!src/mqt/**
!src/python/**
test/**
!test/python/**
CMakeLists.txt
cmake/**
extern/**
.github/codecov.yml
.github/workflows/reusable-cpp-tests-ubuntu.yml
.github/workflows/reusable-cpp-tests-macos.yml
.github/workflows/reusable-cpp-tests-windows.yml
.github/workflows/reusable-cpp-coverage.yml
.github/workflows/reusable-cpp-tests-ci.yml
.github/workflows/ci.yml
- name: Set a flag for running the C++ tests
if: >-
github.event_name != 'pull_request'
|| steps.changed-cpp-testable-files.outputs.added_modified_renamed != ''
id: cpp-tests-changes
run: >-
echo "run-cpp-tests=true" >> "${GITHUB_OUTPUT}"
- name: Get a list of the changed files relevant for the C++ linter
if: github.event_name == 'pull_request'
id: changed-cpp-linter-files
uses: Ana06/[email protected]
with:
filter: |
include/**
!include/python/**
src/**
!src/mqt/**
!src/python/**
test/**
!test/python/**
.clang-tidy
.github/workflows/reusable-cpp-linter.yml
.github/workflows/ci.yml
- name: Set a flag for running the C++ linter
if: >-
github.event_name != 'pull_request'
|| steps.changed-cpp-linter-files.outputs.added_modified_renamed != ''
id: cpp-linter-changes
run: >-
echo "run-cpp-linter=true" >> "${GITHUB_OUTPUT}"
- name: Get a list of the changed files relevant for the Python tests
if: github.event_name == 'pull_request'
id: changed-python-testable-files
uses: Ana06/[email protected]
with:
filter: |
cmake/**
extern/**
include/**
src/**
test/python/**
noxfile.py
pyproject.toml
CMakeLists.txt
.github/codecov.yml
.github/workflows/reusable-python-linter.yml
.github/workflows/reusable-python-tests.yml
.github/workflows/reusable-python-coverage.yml
.github/workflows/reusable-python-ci.yml
.github/workflows/ci.yml
- name: Set a flag for running the Python tests
if: >-
github.event_name != 'pull_request'
|| steps.changed-python-testable-files.outputs.added_modified_renamed != ''
id: python-tests-changes
run: >-
echo "run-python-tests=true" >> "${GITHUB_OUTPUT}"
- name: Get a list of the changed files relevant for CodeQL
if: github.event_name == 'pull_request'
id: changed-code-ql-files
uses: Ana06/[email protected]
with:
filter: |
cmake/**
extern/**
include/**
src/**
test/**
pyproject.toml
CMakeLists.txt
.github/codeql-config.yml
.github/workflows/reusable-code-ql-cpp.yml
.github/workflows/reusable-code-ql-python.yml
.github/workflows/reusable-code-ql.yml
.github/workflows/ci.yml
- name: Set a flag for running CodeQL
if: >-
github.event_name != 'pull_request'
|| steps.changed-code-ql-files.outputs.added_modified_renamed != ''
id: code-ql-changes
run: >-
echo "run-code-ql=true" >> "${GITHUB_OUTPUT}"