Skip to content

Commit 347f61e

Browse files
grdsdevclaude
andauthored
ci: optimize CI workflow with path filtering (#775)
* test(ci): improve release workflow with better error handling and remove problematic conditional * test(ci): add release workflow testing infrastructure * docs: add release workflow testing guide * test(ci): trigger CI workflow to test release process * feat: add feature test for semantic-release analysis * test(ci): add CI monitoring script for release workflow testing * feat(ci): add wait-on-check action to ensure CI passes before release * refactor(ci): remove workflow_run triggers and use direct push triggers * fix(ci): remove wait-on-check action that was causing issues * remove all files used for testing * fix release.yml * feat(ci): add path filtering to optimize CI workflow execution Add intelligent path filtering to CI workflow to only run when files that could impact the build are changed. This includes source code, tests, examples, package configuration, build files, and CI configuration itself. This optimization reduces unnecessary CI runs for documentation changes, README updates, or other non-code modifications while ensuring all impactful changes trigger the build. 🤖 Generated with [Claude Code](https://claude.ai/code) Co-Authored-By: Claude <[email protected]> --------- Co-authored-by: Claude <[email protected]>
1 parent f5b5ee3 commit 347f61e

File tree

2 files changed

+33
-13
lines changed

2 files changed

+33
-13
lines changed

.github/workflows/ci.yml

Lines changed: 24 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -4,9 +4,33 @@ on:
44
push:
55
branches:
66
- main
7+
paths:
8+
- 'Sources/**'
9+
- 'Tests/**'
10+
- 'Examples/**'
11+
- '*.swift'
12+
- 'Package.swift'
13+
- 'Package.resolved'
14+
- '.github/workflows/ci.yml'
15+
- 'Makefile'
16+
- '*.xcodeproj/**'
17+
- '*.xcworkspace/**'
18+
- '.swiftpm/**'
719
pull_request:
820
branches:
921
- "*"
22+
paths:
23+
- 'Sources/**'
24+
- 'Tests/**'
25+
- 'Examples/**'
26+
- '*.swift'
27+
- 'Package.swift'
28+
- 'Package.resolved'
29+
- '.github/workflows/ci.yml'
30+
- 'Makefile'
31+
- '*.xcodeproj/**'
32+
- '*.xcworkspace/**'
33+
- '.swiftpm/**'
1034
workflow_dispatch:
1135

1236
concurrency:

.github/workflows/release.yml

Lines changed: 9 additions & 13 deletions
Original file line numberDiff line numberDiff line change
@@ -5,27 +5,16 @@ on:
55
branches:
66
- main
77
- rc
8+
89
workflow_dispatch:
910

1011
permissions:
1112
contents: read
1213

1314
jobs:
14-
check-ci-status:
15-
runs-on: ubuntu-latest
16-
steps:
17-
- name: Wait for CI workflow
18-
uses: lewagon/[email protected]
19-
with:
20-
ref: ${{ github.ref }}
21-
check-name: 'CI'
22-
repo-token: ${{ secrets.GITHUB_TOKEN }}
23-
wait-interval: 30
24-
2515
release:
2616
runs-on: ubuntu-latest
27-
if: "!contains(github.event.head_commit.message, 'skip ci')"
28-
needs: [check-ci-status]
17+
if: ${{ !contains(github.event.head_commit.message, 'skip ci') }}
2918
permissions:
3019
contents: write
3120
issues: write
@@ -40,6 +29,7 @@ jobs:
4029
with:
4130
app-id: ${{ secrets.APP_ID }}
4231
private-key: ${{ secrets.PRIVATE_KEY }}
32+
4333
- name: Checkout
4434
uses: actions/checkout@v4
4535
with:
@@ -57,6 +47,12 @@ jobs:
5747
run: npm ci
5848

5949
- name: Run semantic-release
50+
id: semantic-release
6051
run: npx semantic-release
6152
env:
6253
GITHUB_TOKEN: ${{ steps.app-token.outputs.token }}
54+
continue-on-error: false
55+
56+
- name: Check if release was created
57+
if: steps.semantic-release.outcome == 'success'
58+
run: echo "Release created successfully"

0 commit comments

Comments
 (0)