Skip to content

Commit 959708a

Browse files
chaliyclaude
andauthored
ci: fix duplicate runs and combine fmt/clippy/test (#13)
## What Fix CI workflow to eliminate duplicate job runs and reduce total number of checks. ## Why CI was showing 16 checks with duplicates (Check x2, Rustfmt x2, Clippy x2, etc.) because both `push` and `pull_request` events were firing for the same commits. ## How - Remove `claude/**` from push triggers (PRs handle branch CI via `pull_request` event) - Add concurrency group to cancel in-progress runs when new commits are pushed - Combine `check`, `fmt`, `clippy`, `test` into single `ci` job ## Result - Before: 7 jobs running twice = 14+ checks - After: 4 jobs running once = 4 checks (ci, build, doc, examples) ## Risk - Low - CI behavior change only, no code changes ### Checklist - [x] CI passes - [x] No code changes, workflow only --------- Co-authored-by: Claude <noreply@anthropic.com>
1 parent e82b56d commit 959708a

1 file changed

Lines changed: 12 additions & 35 deletions

File tree

.github/workflows/ci.yml

Lines changed: 12 additions & 35 deletions
Original file line numberDiff line numberDiff line change
@@ -2,9 +2,13 @@ name: CI
22

33
on:
44
push:
5-
branches: [main, "claude/**"]
6-
pull_request:
75
branches: [main]
6+
pull_request:
7+
8+
# Cancel in-progress runs for same PR/branch
9+
concurrency:
10+
group: ${{ github.workflow }}-${{ github.ref }}
11+
cancel-in-progress: true
812

913
permissions:
1014
contents: read
@@ -14,47 +18,20 @@ env:
1418
RUST_BACKTRACE: 1
1519

1620
jobs:
17-
check:
18-
name: Check
19-
runs-on: ubuntu-latest
20-
steps:
21-
- uses: actions/checkout@v4
22-
- uses: dtolnay/rust-toolchain@stable
23-
- uses: Swatinem/rust-cache@v2
24-
- name: Check
25-
run: cargo check --workspace --all-targets
26-
27-
fmt:
28-
name: Rustfmt
29-
runs-on: ubuntu-latest
30-
steps:
31-
- uses: actions/checkout@v4
32-
- uses: dtolnay/rust-toolchain@stable
33-
with:
34-
components: rustfmt
35-
- name: Check formatting
36-
run: cargo fmt --all -- --check
37-
38-
clippy:
39-
name: Clippy
21+
ci:
22+
name: Test
4023
runs-on: ubuntu-latest
4124
steps:
4225
- uses: actions/checkout@v4
4326
- uses: dtolnay/rust-toolchain@stable
4427
with:
45-
components: clippy
28+
components: rustfmt, clippy
4629
- uses: Swatinem/rust-cache@v2
30+
- name: Format
31+
run: cargo fmt --all -- --check
4732
- name: Clippy
4833
run: cargo clippy --workspace --all-targets -- -D warnings
49-
50-
test:
51-
name: Test
52-
runs-on: ubuntu-latest
53-
steps:
54-
- uses: actions/checkout@v4
55-
- uses: dtolnay/rust-toolchain@stable
56-
- uses: Swatinem/rust-cache@v2
57-
- name: Run tests
34+
- name: Test
5835
run: cargo test --workspace
5936

6037
build:

0 commit comments

Comments
 (0)