-
Notifications
You must be signed in to change notification settings - Fork 815
132 lines (118 loc) · 3.51 KB
/
Copy pathdynamic-ci.yml
File metadata and controls
132 lines (118 loc) · 3.51 KB
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
name: Dynamic CI
on:
push:
branches:
- main
- release/[0-9]+.[0-9]+
pull_request:
types: [opened, synchronize, reopened, ready_for_review]
merge_group:
types: [checks_requested]
permissions:
contents: read
checks: write
actions: read
packages: write
jobs:
filter:
name: Filter changed files
runs-on: ubuntu-latest
permissions:
pull-requests: read
outputs:
docs: ${{ steps.filter.outputs.docs }}
code: ${{ steps.filter.outputs.code }}
hooks: ${{ steps.filter.outputs.hooks }}
steps:
- name: Checkout code
uses: actions/checkout@v7
- name: Detect changed files
id: filter
uses: dorny/paths-filter@v4
with:
# 'base' and 'ref' are ignored for pull requests
# For merge group events, compare against the target branch (main)
base: ${{ github.event.merge_group.base_ref }}
# For merge group events, use the merge group head ref
ref: ${{ github.event.merge_group.head_ref }}
filters: |
docs:
- '.github/workflows/automatic-doc-checks.yml'
- 'docs/**'
code:
- ".github/workflows/linux*"
- ".github/workflows/macos.yml"
- ".github/workflows/windows.yml"
- ".github/.codecov.yml"
- ".clang-tidy"
- "3rd-party/**"
- "completions/**"
- "data/*"
- "debian/**"
- "include/**"
- "packaging/**"
- "snap/**"
- "snap-wrappers/**"
- "src/**"
- "rxx/**"
- "tests/**"
- ".gitmodules"
- "CMakeLists.txt"
- "vcpkg-configuration.json"
- "vcpkg.json"
hooks:
- "git-hooks/**"
docs:
name: Docs
needs: filter
if: needs.filter.outputs.docs == 'true'
uses: "./.github/workflows/automatic-doc-checks.yml"
lint:
name: Lint
needs: filter
uses: "./.github/workflows/lint.yml"
linux:
name: Linux
needs: filter
if: needs.filter.outputs.code == 'true'
uses: "./.github/workflows/linux.yml"
secrets: inherit
macos:
name: macOS
needs: filter
if: needs.filter.outputs.code == 'true'
uses: "./.github/workflows/macos.yml"
secrets: inherit
windows:
name: Windows
needs: filter
if: needs.filter.outputs.code == 'true'
uses: "./.github/workflows/windows.yml"
secrets: inherit
hooks:
name: Hooks
needs: filter
if: needs.filter.outputs.hooks == 'true'
uses: "./.github/workflows/test-hooks.yml"
finalize:
name: Finalize
runs-on: ubuntu-latest
if: ${{ always() }}
needs: [docs, lint, linux, windows, macos, hooks]
steps:
- name: Docs failure check
if: ${{
needs.docs.result == 'failure' || needs.docs.result == 'cancelled'
}}
run: exit 1
- name: Compilation failure check
if: ${{
needs.lint.result == 'failure' || needs.lint.result == 'cancelled' ||
needs.linux.result == 'failure' || needs.linux.result == 'cancelled' ||
needs.windows.result == 'failure' || needs.windows.result == 'cancelled' ||
needs.macos.result == 'failure' || needs.macos.result == 'cancelled'
}}
run: exit 1
- name: Hooks failure check
if: ${{ needs.hooks.result == 'failure' || needs.hooks.result == 'cancelled' }}
run: exit 1