Skip to content

Commit fa2f4a3

Browse files
miguelgilaclaude
andauthored
ci: consolidate workflows and parallelize CI pipeline (#29)
* ci: consolidate workflows and parallelize CI pipeline Merge test.yml, build.yml, and integration.yml into a single ci.yml workflow. Jobs run in parallel (fmt, clippy, audit, cargo-test, coverage, build-musl, playground-release) with kind-integration waiting only on build-musl artifacts. This eliminates redundant builds, shares musl binaries via artifacts, and replaces the 30s sleep with a functional readiness probe. Co-Authored-By: Claude Opus 4.6 <noreply@anthropic.com> * ci: fix status check names to match repo rulesets The repo rulesets require "Build and Cache" and "kind-integration" but the consolidated workflow used "Build musl binaries" and "Kind Integration Tests", causing PR checks to stay pending. Co-Authored-By: Claude Opus 4.6 <noreply@anthropic.com> --------- Co-authored-by: Claude Opus 4.6 <noreply@anthropic.com>
1 parent 836b9a4 commit fa2f4a3

File tree

6 files changed

+206
-305
lines changed

6 files changed

+206
-305
lines changed

.github/workflows/build.yml

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

.github/workflows/ci.yml

Lines changed: 164 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,164 @@
1+
name: CI
2+
3+
on:
4+
push:
5+
branches: [main]
6+
paths-ignore:
7+
- "**/*.md"
8+
- "docs/**"
9+
- "LICENSE*"
10+
- ".gitignore"
11+
pull_request:
12+
branches: [main]
13+
paths-ignore:
14+
- "**/*.md"
15+
- "docs/**"
16+
- "LICENSE*"
17+
- ".gitignore"
18+
19+
env:
20+
CARGO_TERM_COLOR: always
21+
RUST_BACKTRACE: 1
22+
23+
jobs:
24+
fmt:
25+
name: Format
26+
runs-on: ubuntu-latest
27+
steps:
28+
- uses: actions/checkout@v4
29+
- uses: dtolnay/rust-toolchain@stable
30+
with:
31+
components: rustfmt
32+
- name: Check formatting
33+
run: cargo fmt -- --check
34+
35+
clippy:
36+
name: Clippy
37+
runs-on: ubuntu-latest
38+
steps:
39+
- uses: actions/checkout@v4
40+
- uses: dtolnay/rust-toolchain@stable
41+
with:
42+
components: clippy
43+
- uses: Swatinem/rust-cache@v2
44+
- name: Run clippy
45+
run: cargo clippy --workspace --all-targets -- -D warnings
46+
47+
audit:
48+
name: Security Audit
49+
runs-on: ubuntu-latest
50+
steps:
51+
- uses: actions/checkout@v4
52+
- uses: dtolnay/rust-toolchain@stable
53+
- name: Install cargo-audit
54+
run: cargo install cargo-audit
55+
- name: Run cargo-audit
56+
run: cargo audit
57+
58+
cargo-test:
59+
name: Tests
60+
runs-on: ubuntu-latest
61+
steps:
62+
- uses: actions/checkout@v4
63+
- uses: dtolnay/rust-toolchain@stable
64+
- uses: Swatinem/rust-cache@v2
65+
- name: Run tests
66+
run: cargo test --verbose
67+
68+
coverage:
69+
name: Coverage
70+
runs-on: ubuntu-latest
71+
steps:
72+
- uses: actions/checkout@v4
73+
- uses: dtolnay/rust-toolchain@stable
74+
- uses: Swatinem/rust-cache@v2
75+
- name: Install tarpaulin
76+
uses: taiki-e/install-action@cargo-tarpaulin
77+
- name: Generate coverage
78+
run: cargo tarpaulin
79+
- name: Upload coverage to Codecov
80+
uses: codecov/codecov-action@v3
81+
with:
82+
files: ./cobertura.xml
83+
token: ${{ secrets.CODECOV_TOKEN }}
84+
fail_ci_if_error: false
85+
verbose: true
86+
87+
build-musl:
88+
name: Build and Cache
89+
runs-on: ubuntu-latest
90+
steps:
91+
- uses: actions/checkout@v4
92+
- name: Build all binaries (musl static)
93+
run: |
94+
docker run --rm \
95+
-v ${{ github.workspace }}:/work \
96+
-w /work \
97+
messense/rust-musl-cross:x86_64-musl \
98+
cargo build --release --features agent \
99+
--bin containerd-shim-reaper-v2 \
100+
--bin reaper-runtime \
101+
--bin reaper-agent \
102+
--target x86_64-unknown-linux-musl
103+
- uses: actions/upload-artifact@v4
104+
with:
105+
name: musl-binaries
106+
path: |
107+
target/x86_64-unknown-linux-musl/release/containerd-shim-reaper-v2
108+
target/x86_64-unknown-linux-musl/release/reaper-runtime
109+
target/x86_64-unknown-linux-musl/release/reaper-agent
110+
retention-days: 1
111+
112+
kind-integration:
113+
name: kind-integration
114+
needs: build-musl
115+
runs-on: ubuntu-latest
116+
steps:
117+
- uses: actions/checkout@v4
118+
119+
- uses: actions/download-artifact@v4
120+
with:
121+
name: musl-binaries
122+
path: target/x86_64-unknown-linux-musl/release/
123+
124+
- name: Make binaries executable
125+
run: chmod +x target/x86_64-unknown-linux-musl/release/*
126+
127+
- name: Install kubectl
128+
uses: azure/setup-kubectl@v3
129+
with:
130+
version: "v1.30.0"
131+
132+
- name: Install kind
133+
run: |
134+
[ -x "$(command -v kind)" ] && exit 0
135+
curl -Lo ./kind "https://kind.sigs.k8s.io/dl/v0.23.0/kind-linux-amd64"
136+
chmod +x ./kind
137+
sudo mv ./kind /usr/local/bin/kind
138+
139+
- name: Install Ansible
140+
run: pip install ansible
141+
142+
- name: Run integration tests
143+
uses: nick-fields/retry@v3
144+
with:
145+
timeout_minutes: 20
146+
max_attempts: 2
147+
command: ./scripts/run-integration-tests.sh --skip-cargo
148+
149+
- name: Upload integration test logs
150+
if: always()
151+
uses: actions/upload-artifact@v4
152+
continue-on-error: true
153+
with:
154+
name: integration-test-logs
155+
path: /tmp/reaper-integration-logs/
156+
retention-days: 7
157+
158+
playground-release:
159+
name: Playground Release Tests
160+
runs-on: ubuntu-latest
161+
steps:
162+
- uses: actions/checkout@v4
163+
- name: Test --release resolution modes
164+
run: ./scripts/test-playground-release.sh

.github/workflows/integration.yml

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

0 commit comments

Comments
 (0)