Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
The table of contents is too big for display.
Diff view
Diff view
  •  
  •  
  •  
4 changes: 2 additions & 2 deletions .github/.release-please-manifest.json
Original file line number Diff line number Diff line change
@@ -1,3 +1,3 @@
{
".": "0.2.1"
}
".": "1.0.3"
}
10 changes: 6 additions & 4 deletions .github/workflows/auto-fix.yml
Original file line number Diff line number Diff line change
Expand Up @@ -3,6 +3,7 @@ name: Auto-fix Code Quality Issues
# Least privilege permissions for auto-fix
permissions:
contents: write
pull-requests: write

on:
push:
Expand All @@ -18,7 +19,6 @@ jobs:
auto-fix:
name: Auto-fix Formatting and Clippy Issues
runs-on: ubuntu-latest
timeout-minutes: 15
if: ${{ !contains(github.event.head_commit.message, '[skip auto-fix]') }}

steps:
Expand All @@ -28,7 +28,7 @@ jobs:
fetch-depth: 0

- name: Install Rust
uses: dtolnay/rust-toolchain@e97e2d8cc328f1b50210efc529dca0028893a2d9
uses: dtolnay/rust-toolchain@5d458579430fc14a04a08a1e7d3694f545e91ce6
with:
components: rustfmt, clippy

Expand Down Expand Up @@ -87,13 +87,15 @@ jobs:
git add .

# Create detailed commit message
FORMAT_NEEDED="${FORMAT_NEEDED_VAR}"
CLIPPY_NEEDED="${CLIPPY_NEEDED_VAR}"
COMMIT_MSG="auto-fix: apply code quality fixes [skip auto-fix]"
if [ "$FORMAT_NEEDED_VAR" = "true" ]; then
if [ "$FORMAT_NEEDED" = "true" ]; then
COMMIT_MSG="$COMMIT_MSG

- Apply cargo fmt formatting"
fi
if [ "$CLIPPY_NEEDED_VAR" = "true" ]; then
if [ "$CLIPPY_NEEDED" = "true" ]; then
COMMIT_MSG="$COMMIT_MSG

- Apply clippy suggestions"
Expand Down
11 changes: 4 additions & 7 deletions .github/workflows/changelog-sync.yml
Original file line number Diff line number Diff line change
Expand Up @@ -12,19 +12,17 @@ on:
default: false

concurrency:
group: changelog-sync-${{ github.ref_name || github.event.repository.default_branch || 'main' }}
group: changelog-sync-${{ github.ref || 'workflow-dispatch' }}
cancel-in-progress: false

permissions:
contents: write
pull-requests: write
actions: write

jobs:
sync-changelog:
name: Sync Changelog with Releases
runs-on: ubuntu-latest
timeout-minutes: 10
steps:
- name: Checkout code
uses: actions/checkout@08eba0b27e820071cde6df949e0beb9ba4906955
Expand Down Expand Up @@ -53,7 +51,7 @@ jobs:
echo "Version $VERSION already exists in changelog, updating..."

# Extract the current entry and replace it
python3 << EOF
python3 << 'EOF'
import re
import sys

Expand Down Expand Up @@ -148,7 +146,7 @@ jobs:
echo "Adding new version $VERSION to changelog..."

# Add new entry after [Unreleased] section
python3 << EOF
python3 << 'EOF'
import re

tag_name = "$TAG_NAME"
Expand Down Expand Up @@ -201,7 +199,7 @@ jobs:
echo "Adding $version to changelog..."

# Add basic entry (detailed sync will happen on next release event)
python3 << EOF
python3 << 'EOF'
import re

version = "$version"
Expand Down Expand Up @@ -269,7 +267,6 @@ jobs:
name: Update Release Descriptions
runs-on: ubuntu-latest
needs: sync-changelog
timeout-minutes: 15
if: github.event_name == 'workflow_dispatch' && github.event.inputs.sync_all == 'true'
steps:
- name: Checkout code
Expand Down
14 changes: 3 additions & 11 deletions .github/workflows/docs.yml
Original file line number Diff line number Diff line change
Expand Up @@ -86,18 +86,10 @@ jobs:
steps:
- uses: actions/checkout@08eba0b27e820071cde6df949e0beb9ba4906955

- name: Install Rust
uses: dtolnay/rust-toolchain@5d458579430fc14a04a08a1e7d3694f545e91ce6

- name: Cache cargo registry
uses: actions/cache@0057852bfaa89a56745cba8c7296529d2fc39830
with:
path: |
~/.cargo/registry
~/.cargo/git
key: ${{ runner.os }}-cargo-docs-${{ hashFiles('**/Cargo.lock') }}
- name: Install Rust
uses: dtolnay/rust-toolchain@5d458579430fc14a04a08a1e7d3694f545e91ce6

- name: Check documentation
- name: Check documentation
run: cargo doc --no-deps --workspace --document-private-items

- name: Comment on PR if docs issues
Expand Down
94 changes: 55 additions & 39 deletions .github/workflows/enhanced-ci.yml
Original file line number Diff line number Diff line change
Expand Up @@ -10,8 +10,10 @@ on:
pull_request:
branches: [main, develop]
schedule:
- cron: '0 2 * * 0' # Weekly on Sunday at 2 AM UTC for security scans
- cron: '0 2 * * 1' # Weekly on Monday at 2 AM UTC for performance benchmarks
# Weekly on Sunday at 2 AM UTC for security scans
- cron: '0 2 * * 0'
# Weekly on Monday at 2 AM UTC for performance benchmarks
- cron: '0 2 * * 1'
workflow_dispatch:

# Concurrency controls to prevent overlapping runs
Expand Down Expand Up @@ -125,40 +127,53 @@ jobs:
run: |
echo "🔧 Checking formatting..."
if ! cargo fmt --all -- --check; then
echo "Formatting issues found, applying fixes..."
cargo fmt --all
echo "format_fixed=true" >> $GITHUB_OUTPUT
echo "Formatting issues found, applying fixes..."
cargo fmt --all
echo "format_fixed=true" >> $GITHUB_OUTPUT
else
echo "✅ Formatting is correct"
echo "format_fixed=false" >> $GITHUB_OUTPUT
echo "✅ Formatting is correct"
echo "format_fixed=false" >> $GITHUB_OUTPUT
fi

- name: Check and auto-fix clippy issues
id: clippy-check
run: |
echo "🔧 Running clippy..."
if ! cargo clippy --all-targets --all-features -- -D warnings; then
echo "Clippy issues found, attempting fixes..."
cargo clippy --all-targets --all-features --fix --allow-dirty
echo "clippy_fixed=true" >> $GITHUB_OUTPUT
echo "Clippy issues found, attempting fixes..."
cargo clippy --all-targets --all-features --fix --allow-dirty
echo "clippy_fixed=true" >> $GITHUB_OUTPUT
else
echo "✅ Clippy checks passed"
echo "clippy_fixed=false" >> $GITHUB_OUTPUT
echo "✅ Clippy checks passed"
echo "clippy_fixed=false" >> $GITHUB_OUTPUT
fi

- name: Check workspace integrity
run: cargo check --workspace --all-targets

- name: Commit fixes if applied
if: steps.format-check.outputs.format_fixed == 'true' || steps.clippy-check.outputs.clippy_fixed == 'true'
if: steps.format-check.outputs.format_fixed == 'true' || steps.clippy-check.outputs.clippy_fixed == 'true'
run: |
git config --local user.email "41898282+github-actions[bot]@users.noreply.github.com"
git config --local user.name "github-actions[bot]"
if [[ $(git status --porcelain) ]]; then
git add .
git commit -m "chore: auto-fix formatting and clippy issues"
git push
fi

if ! git diff --quiet; then
git add .

COMMIT_MSG="auto-fix: apply code quality fixes"
if [[ "${{ steps.format-check.outputs.format_fixed }}" == "true" ]]; then
COMMIT_MSG="$COMMIT_MSG
- Apply cargo fmt formatting"
fi
if [[ "${{ steps.clippy-check.outputs.clippy_fixed }}" == "true" ]]; then
COMMIT_MSG="$COMMIT_MSG
- Apply clippy suggestions"
fi

git commit -m "$COMMIT_MSG"
git push
echo "✅ Code quality fixes applied and pushed!"
fi

# Security scanning (comprehensive)
security-scan:
Expand Down Expand Up @@ -205,7 +220,7 @@ jobs:

- name: Secrets detection
uses: gitleaks/gitleaks-action@ff98106e4c7b2bc287b24eaf42907196329070c7
env:
env:
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }}

- name: Upload security reports
Expand All @@ -232,19 +247,19 @@ jobs:
uses: actions/cache@0057852bfaa89a56745cba8c7296529d2fc39830
with:
path: |
~/.cargo/registry
~/.cargo/git
~/.cargo/registry
~/.cargo/git
key: ${{ runner.os }}-cargo-registry-${{ hashFiles('**/Cargo.lock') }}
restore-keys: |
${{ runner.os }}-cargo-registry-
${{ runner.os }}-cargo-registry-

- name: Cache target
uses: actions/cache@0057852bfaa89a56745cba8c7296529d2fc39830
with:
path: target
key: ${{ runner.os }}-target-${{ hashFiles('**/Cargo.lock') }}
restore-keys: |
${{ runner.os }}-target-
${{ runner.os }}-target-

- name: Build workspace
run: cargo build --workspace --all-targets --all-features
Expand All @@ -267,13 +282,14 @@ jobs:
rust: beta

steps:
- uses: actions/checkout@08eba0b27e820071cde6df949e0beb9ba4906955
-
uses: actions/checkout@08eba0b27e820071cde6df949e0beb9ba4906955
with:
fetch-depth: 0
- name: Install Rust
uses: dtolnay/rust-toolchain@5d458579430fc14a04a08a1e7d3694f545e91ce6
with:
toolchain: ${{ matrix.rust }}
uses: dtolnay/rust-toolchain@5d458579430fc14a04a08a1e7d3694f545e91ce6
with:
toolchain: ${{ matrix.rust }}

- name: Install cargo-nextest
uses: taiki-e/install-action@fa0639a7132933c4081764bded317e92c04e5c07
Expand Down Expand Up @@ -554,8 +570,8 @@ jobs:
- name: Check documentation
run: |
if [ ! -d "target/doc" ]; then
echo "❌ Documentation build failed"
exit 1
echo "❌ Documentation build failed"
exit 1
fi
echo "✅ Documentation built successfully"

Expand Down Expand Up @@ -586,16 +602,16 @@ jobs:
uses: actions/github-script@f28e40c7f34bde8b3046d885e986cb6290c5673b
with:
script: |
github.rest.issues.createComment({
issue_number: context.issue.number,
owner: context.repo.owner,
repo: context.repo.repo,
body: '🚨 **Code Review Issues Detected**\n\n' +
'Clippy found warnings or errors that need to be addressed:\n\n' +
'```bash\ncargo clippy --all-targets --all-features -- -D warnings\n```\n\n' +
'Please fix these issues before merging. You can run:\n' +
'```bash\ncargo clippy --fix --allow-dirty\n```'
})
github.rest.issues.createComment({
issue_number: context.issue.number,
owner: context.repo.owner,
repo: context.repo.repo,
body: '🚨 **Code Review Issues Detected**\n\n' +
'Clippy found warnings or errors that need to be addressed:\n\n' +
'```bash\ncargo clippy --all-targets --all-features -- -D warnings\n```\n\n' +
'Please fix these issues before merging. You can run:\n' +
'```bash\ncargo clippy --fix --allow-dirty\n```'
})

# Final CI status aggregation
ci-complete:
Expand Down
30 changes: 13 additions & 17 deletions .github/workflows/monitor.yml
Original file line number Diff line number Diff line change
Expand Up @@ -17,22 +17,18 @@ concurrency:
cancel-in-progress: false

jobs:
monitor:
runs-on: ubuntu-latest
timeout-minutes: 10
permissions:
issues: write
contents: read
actions: read
security-events: write
steps:
- name: Checkout repository
uses: actions/checkout@11bd71901bbe5b1630ceea73d27597364c9af683
monitor:
runs-on: ubuntu-latest
permissions:
issues: write
contents: read
actions: read
security-events: write
steps:
- name: Checkout repository
uses: actions/checkout@08eba0b27e820071cde6df949e0beb9ba4906955

- name: Install jq
run: sudo apt-get update && sudo apt-get install -y jq

- name: List recent workflow runs
- name: List recent workflow runs
run: |
# Calculate date 24 hours ago in ISO 8601 format
since=$(date -u -d '24 hours ago' +%Y-%m-%dT%H:%M:%SZ)
Expand All @@ -58,8 +54,8 @@ jobs:

- name: Check for failures in monitored workflows
run: |
# Define monitored workflows (without .yml extension)
workflows=("Auto-fix Code Quality Issues" "Enhanced CI/CD" "Deploy Docs" "Release Management")
# Define monitored workflows (without .yml extension)
workflows=("Auto-fix Code Quality Issues" "CI" "Deploy Docs" "Release Build")

failures=()

Expand Down
Loading
Loading