File tree Expand file tree Collapse file tree 12 files changed +99
-122
lines changed Expand file tree Collapse file tree 12 files changed +99
-122
lines changed Original file line number Diff line number Diff line change
1
+ docs : &docs
2
+ - " **/*.md"
3
+ - " docs/**"
4
+
5
+ backend : &backend
6
+ - " **/*.go"
7
+ - " **/*.tmpl"
8
+ - " go.mod"
9
+ - " go.sum"
10
+
11
+ frontend : &frontend
12
+ - " **/*.js"
13
+ - " web_src/**"
14
+ - " package.json"
15
+ - " package-lock.json"
Original file line number Diff line number Diff line change
1
+ name : files changed
2
+
3
+ on :
4
+ workflow_call :
5
+ outputs :
6
+ docs :
7
+ description : " whether docs files changed"
8
+ value : ${{ jobs.files-changed.outputs.docs }}
9
+ backend :
10
+ description : " whether backend files changed"
11
+ value : ${{ jobs.files-changed.outputs.backend }}
12
+ frontend :
13
+ description : " whether frontend files changed"
14
+ value : ${{ jobs.files-changed.outputs.frontend }}
15
+
16
+ jobs :
17
+ files-changed :
18
+ name : detect which files changed
19
+ runs-on : ubuntu-latest
20
+ timeout-minutes : 3
21
+ # Map a step output to a job output
22
+ outputs :
23
+ docs : ${{ steps.changes.outputs.docs }}
24
+ backend : ${{ steps.changes.outputs.backend }}
25
+ frontend : ${{ steps.changes.outputs.frontend }}
26
+ steps :
27
+ - uses : actions/checkout@v3
28
+ - name : Check for backend file changes
29
+ uses : dorny/paths-filter@v2
30
+ id : changes
31
+ with :
32
+ filters : .github/file-filters.yml
Original file line number Diff line number Diff line change @@ -2,16 +2,18 @@ name: compliance-docs
2
2
3
3
on :
4
4
pull_request :
5
- paths :
6
- - " docs/**"
7
- - " *.md"
8
5
9
6
concurrency :
10
7
group : ${{ github.workflow }}-${{ github.head_ref || github.run_id }}
11
8
cancel-in-progress : true
12
9
13
10
jobs :
11
+ files-changed :
12
+ uses : ./.github/workflows/files-changed.yml
13
+
14
14
compliance-docs :
15
+ if : needs.files-changed.outputs.docs == 'true'
16
+ needs : files-changed
15
17
runs-on : ubuntu-latest
16
18
steps :
17
19
- uses : actions/checkout@v3
Load Diff This file was deleted.
Original file line number Diff line number Diff line change @@ -2,16 +2,18 @@ name: compliance
2
2
3
3
on :
4
4
pull_request :
5
- paths-ignore :
6
- - " docs/**"
7
- - " *.md"
8
5
9
6
concurrency :
10
7
group : ${{ github.workflow }}-${{ github.head_ref || github.run_id }}
11
8
cancel-in-progress : true
12
9
13
10
jobs :
11
+ files-changed :
12
+ uses : ./.github/workflows/files-changed.yml
13
+
14
14
lint-backend :
15
+ if : needs.files-changed.outputs.backend == 'true'
16
+ needs : files-changed
15
17
runs-on : ubuntu-latest
16
18
steps :
17
19
- uses : actions/checkout@v3
24
26
env :
25
27
TAGS : bindata sqlite sqlite_unlock_notify
26
28
lint-go-windows :
29
+ if : needs.files-changed.outputs.backend == 'true'
30
+ needs : files-changed
27
31
runs-on : ubuntu-latest
28
32
steps :
29
33
- uses : actions/checkout@v3
38
42
GOOS : windows
39
43
GOARCH : amd64
40
44
lint-go-gogit :
45
+ if : needs.files-changed.outputs.backend == 'true'
46
+ needs : files-changed
41
47
runs-on : ubuntu-latest
42
48
steps :
43
49
- uses : actions/checkout@v3
50
56
env :
51
57
TAGS : bindata gogit sqlite sqlite_unlock_notify
52
58
checks-backend :
59
+ if : needs.files-changed.outputs.backend == 'true'
60
+ needs : files-changed
53
61
runs-on : ubuntu-latest
54
62
steps :
55
63
- uses : actions/checkout@v3
60
68
- run : make deps-backend deps-tools
61
69
- run : make --always-make checks-backend # ensure the "go-licenses" make target runs
62
70
frontend :
71
+ if : needs.files-changed.outputs.frontend == 'true'
72
+ needs : files-changed
63
73
runs-on : ubuntu-latest
64
74
steps :
65
75
- uses : actions/checkout@v3
70
80
- run : make lint-frontend
71
81
- run : make checks-frontend
72
82
backend :
83
+ if : needs.files-changed.outputs.backend == 'true'
84
+ needs : files-changed
73
85
runs-on : ubuntu-latest
74
86
steps :
75
87
- uses : actions/checkout@v3
Load Diff This file was deleted.
Original file line number Diff line number Diff line change @@ -2,16 +2,18 @@ name: db-tests
2
2
3
3
on :
4
4
pull_request :
5
- paths-ignore :
6
- - " docs/**"
7
- - " *.md"
8
5
9
6
concurrency :
10
7
group : ${{ github.workflow }}-${{ github.head_ref || github.run_id }}
11
8
cancel-in-progress : true
12
9
13
10
jobs :
11
+ files-changed :
12
+ uses : ./.github/workflows/files-changed.yml
13
+
14
14
test-pgsql :
15
+ if : needs.files-changed.outputs.backend == 'true' || needs.files-changed.outputs.frontend == 'true'
16
+ needs : files-changed
15
17
runs-on : ubuntu-latest
16
18
services :
17
19
pgsql :
56
58
USE_REPO_TEST_DIR : 1
57
59
58
60
test-sqlite :
61
+ if : needs.files-changed.outputs.backend == 'true' || needs.files-changed.outputs.frontend == 'true'
62
+ needs : files-changed
59
63
runs-on : ubuntu-latest
60
64
steps :
61
65
- uses : actions/checkout@v3
75
79
USE_REPO_TEST_DIR : 1
76
80
77
81
test-unit :
82
+ if : needs.files-changed.outputs.backend == 'true'
83
+ needs : files-changed
78
84
runs-on : ubuntu-latest
79
85
services :
80
86
mysql :
@@ -138,6 +144,8 @@ jobs:
138
144
GITHUB_READ_TOKEN : ${{ secrets.GITHUB_READ_TOKEN }}
139
145
140
146
test-mysql5 :
147
+ if : needs.files-changed.outputs.backend == 'true' || needs.files-changed.outputs.frontend == 'true'
148
+ needs : files-changed
141
149
runs-on : ubuntu-latest
142
150
services :
143
151
mysql :
@@ -180,6 +188,8 @@ jobs:
180
188
TEST_INDEXER_CODE_ES_URL : " http://elastic:changeme@elasticsearch:9200"
181
189
182
190
test-mysql8 :
191
+ if : needs.files-changed.outputs.backend == 'true' || needs.files-changed.outputs.frontend == 'true'
192
+ needs : files-changed
183
193
runs-on : ubuntu-latest
184
194
services :
185
195
mysql8 :
@@ -207,6 +217,8 @@ jobs:
207
217
USE_REPO_TEST_DIR : 1
208
218
209
219
test-mssql :
220
+ if : needs.files-changed.outputs.backend == 'true' || needs.files-changed.outputs.frontend == 'true'
221
+ needs : files-changed
210
222
runs-on : ubuntu-latest
211
223
services :
212
224
mssql :
Load Diff This file was deleted.
Original file line number Diff line number Diff line change @@ -2,16 +2,18 @@ name: docker-dryrun
2
2
3
3
on :
4
4
pull_request :
5
- paths-ignore :
6
- - " docs/**"
7
- - " *.md"
8
5
9
6
concurrency :
10
7
group : ${{ github.workflow }}-${{ github.head_ref || github.run_id }}
11
8
cancel-in-progress : true
12
9
13
10
jobs :
11
+ files-changed :
12
+ uses : ./.github/workflows/files-changed.yml
13
+
14
14
docker-dryrun :
15
+ if : needs.files-changed.outputs.backend == 'true' || needs.files-changed.outputs.frontend == 'true'
16
+ needs : files-changed
15
17
runs-on : ubuntu-latest
16
18
steps :
17
19
- uses : docker/setup-buildx-action@v2
Load Diff This file was deleted.
You can’t perform that action at this time.
0 commit comments