Skip to content

Commit d783384

Browse files
authored
Clean up github actions (#24984)
- Merge the file filters into `files-changed.yml` - Remove unused yaml anchors like `&backend` - Merge the `compliance-docs` workflow into `compliance` - Add actions linting - Misc cleanups for whitespace and step names
1 parent e64c2fa commit d783384

File tree

4 files changed

+59
-51
lines changed

4 files changed

+59
-51
lines changed

.github/file-filters.yml

Lines changed: 0 additions & 15 deletions
This file was deleted.

.github/workflows/files-changed.yml

Lines changed: 32 additions & 11 deletions
Original file line numberDiff line numberDiff line change
@@ -1,32 +1,53 @@
1-
name: files changed
1+
name: files-changed
22

33
on:
44
workflow_call:
55
outputs:
6-
docs:
7-
description: "whether docs files changed"
8-
value: ${{ jobs.files-changed.outputs.docs }}
96
backend:
107
description: "whether backend files changed"
11-
value: ${{ jobs.files-changed.outputs.backend }}
8+
value: ${{ jobs.detect.outputs.backend }}
129
frontend:
1310
description: "whether frontend files changed"
14-
value: ${{ jobs.files-changed.outputs.frontend }}
11+
value: ${{ jobs.detect.outputs.frontend }}
12+
docs:
13+
description: "whether docs files changed"
14+
value: ${{ jobs.detect.outputs.docs }}
15+
actions:
16+
description: "whether actions files changed"
17+
value: ${{ jobs.detect.outputs.actions }}
1518

1619
jobs:
17-
files-changed:
20+
detect:
1821
name: detect which files changed
1922
runs-on: ubuntu-latest
2023
timeout-minutes: 3
2124
# Map a step output to a job output
2225
outputs:
23-
docs: ${{ steps.changes.outputs.docs }}
2426
backend: ${{ steps.changes.outputs.backend }}
2527
frontend: ${{ steps.changes.outputs.frontend }}
28+
docs: ${{ steps.changes.outputs.docs }}
29+
actions: ${{ steps.changes.outputs.actions }}
2630
steps:
2731
- uses: actions/checkout@v3
28-
- name: Check for backend file changes
29-
uses: dorny/paths-filter@v2
32+
- uses: dorny/paths-filter@v2
3033
id: changes
3134
with:
32-
filters: .github/file-filters.yml
35+
filters: |
36+
backend:
37+
- "**/*.go"
38+
- "**/*.tmpl"
39+
- "go.mod"
40+
- "go.sum"
41+
42+
frontend:
43+
- "**/*.js"
44+
- "web_src/**"
45+
- "package.json"
46+
- "package-lock.json"
47+
48+
docs:
49+
- "**/*.md"
50+
- "docs/**"
51+
52+
actions:
53+
- ".github/workflows/*"

.github/workflows/pull-compliance-docs.yml

Lines changed: 0 additions & 25 deletions
This file was deleted.

.github/workflows/pull-compliance.yml

Lines changed: 27 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -25,6 +25,7 @@ jobs:
2525
- run: make lint-backend
2626
env:
2727
TAGS: bindata sqlite sqlite_unlock_notify
28+
2829
lint-go-windows:
2930
if: needs.files-changed.outputs.backend == 'true'
3031
needs: files-changed
@@ -41,6 +42,7 @@ jobs:
4142
TAGS: bindata sqlite sqlite_unlock_notify
4243
GOOS: windows
4344
GOARCH: amd64
45+
4446
lint-go-gogit:
4547
if: needs.files-changed.outputs.backend == 'true'
4648
needs: files-changed
@@ -55,6 +57,7 @@ jobs:
5557
- run: make lint-go
5658
env:
5759
TAGS: bindata gogit sqlite sqlite_unlock_notify
60+
5861
checks-backend:
5962
if: needs.files-changed.outputs.backend == 'true'
6063
needs: files-changed
@@ -67,6 +70,7 @@ jobs:
6770
check-latest: true
6871
- run: make deps-backend deps-tools
6972
- run: make --always-make checks-backend # ensure the "go-licenses" make target runs
73+
7074
frontend:
7175
if: needs.files-changed.outputs.frontend == 'true'
7276
needs: files-changed
@@ -79,6 +83,7 @@ jobs:
7983
- run: make deps-frontend
8084
- run: make lint-frontend
8185
- run: make checks-frontend
86+
8287
backend:
8388
if: needs.files-changed.outputs.backend == 'true'
8489
needs: files-changed
@@ -113,3 +118,25 @@ jobs:
113118
env:
114119
GOOS: linux
115120
GOARCH: 386
121+
122+
docs:
123+
if: needs.files-changed.outputs.docs == 'true'
124+
needs: files-changed
125+
runs-on: ubuntu-latest
126+
steps:
127+
- uses: actions/checkout@v3
128+
- uses: actions/setup-node@v3
129+
with:
130+
node-version: 20
131+
- run: make deps-frontend
132+
- run: make lint-md
133+
- run: make docs # test if build could succeed
134+
135+
actions:
136+
if: needs.files-changed.outputs.actions == 'true'
137+
needs: files-changed
138+
runs-on: ubuntu-latest
139+
steps:
140+
- uses: actions/checkout@v3
141+
- uses: actions/setup-go@v4
142+
- run: make lint-actions

0 commit comments

Comments
 (0)