Skip to content

Commit a47f295

Browse files
authored
chore(ci): Add path filters and concurrency groups to reduce Actions minutes (#1442)
* chore(ci): Add path filters and concurrency groups to reduce Actions minutes 316k minutes consumed in 90 days (~58 hrs/day) on free runners. Several workflows ran on every push regardless of what changed, and lacked concurrency groups causing superseded runs to stack. Changes: - test.yml: Add Go/proto path filters (biggest win — 3 shards × every push) - build.yml: Add Go/Dockerfile/proto path filters - quality.yml: Add Go/shell/Tiltfile path filters - proto.yml: Add proto/buf path filters + concurrency group - markdown.yml: Add *.md path filters + concurrency group - saga-validation.yml: Add path filters to push trigger (PR already had them) + concurrency group - codeql.yml: Add concurrency group (no path filters — security scanning should always run) - security.yml: Add concurrency group (same rationale) - e2e.yml: Add concurrency group (already had path filters) No required status checks are configured, so skipped workflows won't block merging. * fix: Add buf.yaml, buf.lock, Makefile to path filters Address review comments: workflows that run buf generate need buf.yaml and buf.lock in path filters. build.yml also needs Makefile since it runs make test on push events. * fix: Remove path filter from build.yml push trigger to protect tag releases Path filters apply to all push events including tag pushes. A v* tag push on a commit that only changes non-code files would skip the Docker build, breaking releases. Keep path filter on PR trigger only (high frequency), push trigger always runs (low frequency — develop/main/tags). --------- Co-authored-by: Ben Coombs <bjcoombs@users.noreply.github.com>
1 parent 7608503 commit a47f295

9 files changed

Lines changed: 112 additions & 0 deletions

File tree

.github/workflows/build.yml

Lines changed: 11 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -7,6 +7,17 @@ on:
77
- 'v*'
88
pull_request:
99
branches: [develop, main]
10+
paths:
11+
- '**.go'
12+
- 'go.mod'
13+
- 'go.sum'
14+
- 'Dockerfile'
15+
- 'api/proto/**'
16+
- 'buf.yaml'
17+
- 'buf.gen.yaml'
18+
- 'buf.lock'
19+
- 'Makefile'
20+
- '.github/workflows/build.yml'
1021

1122
permissions:
1223
contents: read

.github/workflows/codeql.yml

Lines changed: 4 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -19,6 +19,10 @@ on:
1919
schedule:
2020
- cron: '27 20 * * 4'
2121

22+
concurrency:
23+
group: ${{ github.workflow }}-${{ github.event.pull_request.number || github.ref }}
24+
cancel-in-progress: ${{ github.event_name == 'pull_request' }}
25+
2226
jobs:
2327
analyze:
2428
name: Analyze (${{ matrix.language }})

.github/workflows/e2e.yml

Lines changed: 4 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -18,6 +18,10 @@ on:
1818
permissions:
1919
contents: read
2020

21+
concurrency:
22+
group: ${{ github.workflow }}-${{ github.event.pull_request.number || github.ref }}
23+
cancel-in-progress: true
24+
2125
jobs:
2226
# ===========================================================================
2327
# Build: compile backend binary and frontend assets once, share via artifacts

.github/workflows/markdown.yml

Lines changed: 16 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -3,13 +3,29 @@ name: Markdown
33
on:
44
push:
55
branches: [develop, main]
6+
paths:
7+
- '**.md'
8+
- '.markdownlint-cli2.jsonc'
9+
- 'package.json'
10+
- 'package-lock.json'
11+
- '.github/workflows/markdown.yml'
612
pull_request:
713
branches: [develop, main]
14+
paths:
15+
- '**.md'
16+
- '.markdownlint-cli2.jsonc'
17+
- 'package.json'
18+
- 'package-lock.json'
19+
- '.github/workflows/markdown.yml'
820

921
permissions:
1022
contents: read
1123
pull-requests: write
1224

25+
concurrency:
26+
group: ${{ github.workflow }}-${{ github.event.pull_request.number || github.ref }}
27+
cancel-in-progress: true
28+
1329
jobs:
1430
markdown-lint:
1531
name: Markdown Lint

.github/workflows/proto.yml

Lines changed: 16 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -3,13 +3,29 @@ name: Proto
33
on:
44
push:
55
branches: [develop, main]
6+
paths:
7+
- 'api/proto/**'
8+
- 'buf.yaml'
9+
- 'buf.gen.yaml'
10+
- 'buf.lock'
11+
- '.github/workflows/proto.yml'
612
pull_request:
713
branches: [develop, main]
14+
paths:
15+
- 'api/proto/**'
16+
- 'buf.yaml'
17+
- 'buf.gen.yaml'
18+
- 'buf.lock'
19+
- '.github/workflows/proto.yml'
820

921
permissions:
1022
contents: read
1123
pull-requests: write
1224

25+
concurrency:
26+
group: ${{ github.workflow }}-${{ github.event.pull_request.number || github.ref }}
27+
cancel-in-progress: true
28+
1329
jobs:
1430
proto-lint:
1531
name: Proto Lint

.github/workflows/quality.yml

Lines changed: 24 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -3,8 +3,32 @@ name: Code Quality
33
on:
44
push:
55
branches: [develop, main]
6+
paths:
7+
- '**.go'
8+
- 'go.mod'
9+
- 'go.sum'
10+
- '**.sh'
11+
- 'Tiltfile'
12+
- 'api/proto/**'
13+
- 'buf.yaml'
14+
- 'buf.gen.yaml'
15+
- 'buf.lock'
16+
- '.golangci.yml'
17+
- '.github/workflows/quality.yml'
618
pull_request:
719
branches: [develop, main]
20+
paths:
21+
- '**.go'
22+
- 'go.mod'
23+
- 'go.sum'
24+
- '**.sh'
25+
- 'Tiltfile'
26+
- 'api/proto/**'
27+
- 'buf.yaml'
28+
- 'buf.gen.yaml'
29+
- 'buf.lock'
30+
- '.golangci.yml'
31+
- '.github/workflows/quality.yml'
832

933
permissions:
1034
contents: read

.github/workflows/saga-validation.yml

Lines changed: 13 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -3,6 +3,15 @@ name: Saga Script Validation
33
on:
44
push:
55
branches: [develop, main]
6+
paths:
7+
- 'services/**/sagas/**/*.star'
8+
- 'services/reference-data/saga/defaults/**/*.star'
9+
- 'shared/pkg/saga/schema/handlers.yaml'
10+
- 'shared/pkg/saga/validator.go'
11+
- 'shared/pkg/saga/starlark_runner.go'
12+
- 'shared/pkg/saga/schema/**/*.go'
13+
- 'services/reference-data/saga/reference_validator.go'
14+
- '.github/workflows/saga-validation.yml'
615
pull_request:
716
branches: [develop, main]
817
paths:
@@ -19,6 +28,10 @@ permissions:
1928
contents: read
2029
pull-requests: write
2130

31+
concurrency:
32+
group: ${{ github.workflow }}-${{ github.event.pull_request.number || github.ref }}
33+
cancel-in-progress: true
34+
2235
jobs:
2336
validate-saga-scripts:
2437
name: Validate All Saga Scripts

.github/workflows/security.yml

Lines changed: 4 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -14,6 +14,10 @@ permissions:
1414
security-events: write
1515
pull-requests: write
1616

17+
concurrency:
18+
group: ${{ github.workflow }}-${{ github.event.pull_request.number || github.ref }}
19+
cancel-in-progress: ${{ github.event_name == 'pull_request' }}
20+
1721
jobs:
1822
govulncheck:
1923
name: Go Vulnerability Check

.github/workflows/test.yml

Lines changed: 20 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -3,8 +3,28 @@ name: Test
33
on:
44
push:
55
branches: [develop, main]
6+
paths:
7+
- '**.go'
8+
- 'go.mod'
9+
- 'go.sum'
10+
- 'api/proto/**'
11+
- 'buf.yaml'
12+
- 'buf.gen.yaml'
13+
- 'buf.lock'
14+
- 'Makefile'
15+
- '.github/workflows/test.yml'
616
pull_request:
717
branches: [develop, main]
18+
paths:
19+
- '**.go'
20+
- 'go.mod'
21+
- 'go.sum'
22+
- 'api/proto/**'
23+
- 'buf.yaml'
24+
- 'buf.gen.yaml'
25+
- 'buf.lock'
26+
- 'Makefile'
27+
- '.github/workflows/test.yml'
828

929
permissions:
1030
contents: read

0 commit comments

Comments
 (0)