Skip to content

Commit e4f11e1

Browse files
committed
cargo-rail: implement release preparation infrastructure; Integrate cargo-semver-checks for API breaking change detection; Parallelize commit analysis with rayon; Add release prepare command with version bumping and changelog generation. added the CI/CD workflows, actions, and scripts/ dir.
1 parent 4d7c234 commit e4f11e1

File tree

25 files changed

+1736
-859
lines changed

25 files changed

+1736
-859
lines changed

.config/nextest.toml

Lines changed: 12 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -6,3 +6,15 @@ fail-fast = false
66
test-threads = "num-cpus"
77
slow-timeout = { period = "30s", terminate-after = 4 }
88
retries = 0
9+
10+
[profile.commit]
11+
status-level = "fail"
12+
success-output = "never"
13+
failure-output = "immediate-final"
14+
fail-fast = false
15+
test-threads = "num-cpus"
16+
slow-timeout = { period = "60s", terminate-after = 4 }
17+
retries = { backoff = "exponential", count = 2, delay = "1s", jitter = true }
18+
19+
[profile.commit.junit]
20+
path = "junit.xml"

.github/actions-lock.yaml

Lines changed: 58 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,58 @@
1+
# GitHub Actions Version Lock File
2+
# ━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━
3+
# Single source of truth for all GitHub Actions used in workflows.
4+
# Managed by Dependabot - DO NOT EDIT MANUALLY UNLESS ADDING NEW ACTIONS.
5+
#
6+
# Usage:
7+
# 1. Add new actions here first with desired semantic version
8+
# 2. Run: just pin-actions (generates SHA-pinned workflows)
9+
# 3. Dependabot automatically updates SHAs when new versions release
10+
#
11+
# Format:
12+
# <action-name>:
13+
# ref: <semantic-version> # What we want (Dependabot monitors this)
14+
# sha: <commit-sha> # Immutable pin (generated)
15+
# updated: <ISO-8601> # Last verification timestamp
16+
#
17+
# Security Note:
18+
# Workflows use SHA-pinned format: uses: actions/checkout@abc123... # v4.1.7
19+
# Dependabot reads the comment (# v4.1.7) and updates the SHA when new versions release.
20+
# ━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━
21+
22+
# ━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━
23+
# Official GitHub Actions
24+
# ━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━
25+
26+
actions/checkout:
27+
ref: v5.0.0
28+
sha: "08c6903cd8c0fde910a37f88322edcfb5dd907a8"
29+
updated: "2025-01-11T00:00:00Z"
30+
notes: "Repository checkout - used in every workflow"
31+
32+
actions/upload-artifact:
33+
ref: v5.0.0
34+
sha: "330a01c490aca151604b8cf639adc76d48f6c5d4"
35+
updated: "2025-01-11T00:00:00Z"
36+
notes: "Upload build artifacts and test results"
37+
38+
# ━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━
39+
# Rust Toolchain & Ecosystem
40+
# ━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━
41+
42+
dtolnay/rust-toolchain:
43+
ref: master
44+
sha: "6d653acede28d24f02e3cd41383119e8b1b35921"
45+
updated: "2025-01-11T00:00:00Z"
46+
notes: "Rust toolchain installation - always tracks latest nightly"
47+
48+
taiki-e/install-action:
49+
ref: v2
50+
sha: "6f9c7cc51aa54b13cbcbd12f8bbf69d8ba405b4b"
51+
updated: "2025-01-11T00:00:00Z"
52+
notes: "Install cargo tools (nextest, just, deny, audit)"
53+
54+
Swatinem/rust-cache:
55+
ref: v2.8.1
56+
sha: "f13886b937689c021905a6b90929199931d60db1"
57+
updated: "2025-01-11T00:00:00Z"
58+
notes: "GitHub runner Rust cache"

.github/actions/setup/action.yaml

Lines changed: 66 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,66 @@
1+
name: Setup cargo-rail Environment
2+
description: |
3+
Install Rust toolchain, cargo tools, and configure caching.
4+
All actions skip if already installed.
5+
6+
inputs:
7+
cache-key:
8+
description: Additional cache key suffix
9+
required: false
10+
default: ""
11+
12+
runs:
13+
using: composite
14+
steps:
15+
# Install cargo tools FIRST, before Rust toolchain installation
16+
# This prevents Windows issues where massive toolchain updates interfere with cargo bin directory
17+
- name: Install just
18+
uses: taiki-e/install-action@6f9c7cc51aa54b13cbcbd12f8bbf69d8ba405b4b # v2
19+
with:
20+
tool: just
21+
22+
- name: Install cargo-nextest
23+
uses: taiki-e/install-action@6f9c7cc51aa54b13cbcbd12f8bbf69d8ba405b4b # v2
24+
with:
25+
tool: cargo-nextest
26+
27+
- name: Install cargo-deny
28+
uses: taiki-e/install-action@6f9c7cc51aa54b13cbcbd12f8bbf69d8ba405b4b # v2
29+
with:
30+
tool: cargo-deny
31+
32+
- name: Install cargo-audit
33+
uses: taiki-e/install-action@6f9c7cc51aa54b13cbcbd12f8bbf69d8ba405b4b # v2
34+
with:
35+
tool: cargo-audit
36+
37+
- name: Install Rust Nightly Toolchain
38+
uses: dtolnay/rust-toolchain@6d653acede28d24f02e3cd41383119e8b1b35921 # master
39+
with:
40+
toolchain: nightly
41+
components: clippy, rustfmt
42+
43+
- name: Setup Rust Cache
44+
uses: Swatinem/rust-cache@f13886b937689c021905a6b90929199931d60db1 # v2.8.1
45+
with:
46+
# ━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━
47+
# Cache Strategy:
48+
# - Caches: ~/.cargo (deps, tools) and ./target (build artifacts)
49+
# - Cache key includes: workflow, platform, rustc version, Cargo.lock hash
50+
# - Host triple automatically included in cache key
51+
# - Separate caches per workflow and target triple via 'key' input
52+
# ━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━
53+
54+
# Shared prefix: stable across commits (invalidates on bump)
55+
shared-key: "cargo-rail-v1"
56+
57+
# Workflow and platform-specific suffix: commit-ubuntu-latest, commit-macos-latest, etc.
58+
# Ensures each workflow and platform maintains separate cache
59+
key: ${{ inputs.cache-key }}
60+
61+
# Cache even on test failures (build artifacts still useful)
62+
cache-on-failure: true
63+
64+
# Only save from main branch (prevents cache thrashing)
65+
# Feature branches READ from main's cache but don't WRITE new ones
66+
save-if: ${{ github.ref == 'refs/heads/main' }}

.github/dependabot.yaml

Lines changed: 74 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,74 @@
1+
version: 2
2+
updates:
3+
# ━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━
4+
# Rust Dependencies (Cargo)
5+
# ━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━
6+
7+
# Daily patch/minor updates; grouped and auto-merged.
8+
- package-ecosystem: "cargo"
9+
directory: "/"
10+
schedule:
11+
interval: "daily"
12+
time: "06:00"
13+
timezone: "America/New_York"
14+
open-pull-requests-limit: 10
15+
rebase-strategy: "auto"
16+
17+
ignore:
18+
- dependency-name: "*"
19+
update-types: ["version-update:semver-major"]
20+
21+
groups:
22+
rust-patch-updates:
23+
patterns: ["*"]
24+
update-types: ["patch"]
25+
rust-minor-updates:
26+
patterns: ["*"]
27+
update-types: ["minor"]
28+
29+
# Weekly major updates; ungrouped for easier review.
30+
- package-ecosystem: "cargo"
31+
directory: "/"
32+
schedule:
33+
interval: "weekly"
34+
day: "tuesday"
35+
time: "06:00"
36+
timezone: "America/New_York"
37+
open-pull-requests-limit: 5
38+
rebase-strategy: "auto"
39+
40+
# Only include major updates
41+
ignore:
42+
- dependency-name: "*"
43+
update-types: ["version-update:semver-minor", "version-update:semver-patch"]
44+
45+
# ━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━
46+
# GitHub Actions (Security-Critical: SHA-Pinned)
47+
# ━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━
48+
# Dependabot understands SHA-pinned actions when formatted as:
49+
# uses: actions/checkout@abc123... # v4.1.7
50+
#
51+
# It will:
52+
# 1. Monitor the semantic version in the comment
53+
# 2. Update the SHA when new versions release
54+
# 3. Preserve the SHA-pinned format for security
55+
# ━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━
56+
57+
- package-ecosystem: "github-actions"
58+
directory: "/"
59+
schedule:
60+
interval: "weekly"
61+
day: "monday"
62+
time: "06:00"
63+
timezone: "America/New_York"
64+
open-pull-requests-limit: 10
65+
rebase-strategy: "auto"
66+
67+
# Group all GitHub Actions updates to reduce PR noise
68+
groups:
69+
github-actions:
70+
patterns: ["*"]
71+
update-types: ["minor", "patch"]
72+
73+
# Note: Major version updates are NOT grouped
74+
# These require manual review due to potential breaking changes

.github/workflows/commit.yaml

Lines changed: 75 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,75 @@
1+
name: Commit
2+
3+
on:
4+
push:
5+
branches:
6+
- "**"
7+
8+
# Allow manual trigger
9+
workflow_dispatch:
10+
11+
# Cancel in-progress runs for the same branch
12+
concurrency:
13+
group: ${{ github.workflow }}-${{ github.ref }}
14+
cancel-in-progress: true
15+
16+
env:
17+
RUST_BACKTRACE: 1
18+
CARGO_TERM_COLOR: always
19+
CARGO_RAIL_TEST_MODE: commit
20+
CARGO_INCREMENTAL: 0
21+
22+
# Lock down permissions to read-only by default
23+
permissions:
24+
contents: read
25+
26+
jobs:
27+
ci:
28+
name: CI (${{ matrix.target.name }})
29+
runs-on: ${{ matrix.target.runner }}
30+
timeout-minutes: 30
31+
strategy:
32+
fail-fast: true
33+
matrix:
34+
target:
35+
# Linux x86-64 (GitHub Free)
36+
- name: x86_64-unknown-linux-gnu
37+
runner: ubuntu-latest
38+
cache-key: commit-linux-x64
39+
40+
# Linux ARM64 (GitHub Pro)
41+
- name: aarch64-unknown-linux-gnu
42+
runner: ubuntu-24.04-arm
43+
cache-key: commit-linux-arm64
44+
45+
# Windows x86-64 (GitHub Free)
46+
- name: x86_64-pc-windows-msvc
47+
runner: windows-latest
48+
cache-key: commit-windows-x64
49+
50+
steps:
51+
- name: Checkout
52+
uses: actions/checkout@08c6903cd8c0fde910a37f88322edcfb5dd907a8 # v5.0.0
53+
54+
- name: Setup
55+
uses: ./.github/actions/setup
56+
with:
57+
cache-key: ${{ matrix.target.cache-key }}
58+
59+
- name: Quality Checks
60+
run: just ci-check
61+
62+
- name: Build
63+
run: just build
64+
65+
- name: Tests
66+
run: just test
67+
68+
- name: Upload Test Results (on failure)
69+
if: failure()
70+
uses: actions/upload-artifact@330a01c490aca151604b8cf639adc76d48f6c5d4 # v5.0.0
71+
with:
72+
name: test-results-${{ matrix.target.name }}
73+
path: target/nextest/
74+
retention-days: 7
75+
if-no-files-found: ignore

0 commit comments

Comments
 (0)