Skip to content

Commit 2e78e7d

Browse files
committed
fix: apply GitHub Actions workflow improvements and fixes
1 parent 2ff9489 commit 2e78e7d

File tree

13 files changed

+227
-226
lines changed

13 files changed

+227
-226
lines changed

.github/workflows/auto-fix.yml

Lines changed: 4 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -3,7 +3,6 @@ name: Auto-fix Code Quality Issues
33
# Least privilege permissions for auto-fix
44
permissions:
55
contents: write
6-
pull-requests: write
76

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

2424
steps:
@@ -28,7 +28,7 @@ jobs:
2828
fetch-depth: 0
2929

3030
- name: Install Rust
31-
uses: dtolnay/rust-toolchain@5d458579430fc14a04a08a1e7d3694f545e91ce6
31+
uses: dtolnay/rust-toolchain@e97e2d8cc328f1b50210efc529dca0028893a2d9
3232
with:
3333
components: rustfmt, clippy
3434

@@ -87,15 +87,13 @@ jobs:
8787
git add .
8888
8989
# Create detailed commit message
90-
FORMAT_NEEDED="${FORMAT_NEEDED_VAR}"
91-
CLIPPY_NEEDED="${CLIPPY_NEEDED_VAR}"
9290
COMMIT_MSG="auto-fix: apply code quality fixes [skip auto-fix]"
93-
if [ "$FORMAT_NEEDED" = "true" ]; then
91+
if [ "$FORMAT_NEEDED_VAR" = "true" ]; then
9492
COMMIT_MSG="$COMMIT_MSG
9593
9694
- Apply cargo fmt formatting"
9795
fi
98-
if [ "$CLIPPY_NEEDED" = "true" ]; then
96+
if [ "$CLIPPY_NEEDED_VAR" = "true" ]; then
9997
COMMIT_MSG="$COMMIT_MSG
10098
10199
- Apply clippy suggestions"

.github/workflows/changelog-sync.yml

Lines changed: 7 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -12,17 +12,19 @@ on:
1212
default: false
1313

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

1818
permissions:
1919
contents: write
2020
pull-requests: write
21+
actions: write
2122

2223
jobs:
2324
sync-changelog:
2425
name: Sync Changelog with Releases
2526
runs-on: ubuntu-latest
27+
timeout-minutes: 10
2628
steps:
2729
- name: Checkout code
2830
uses: actions/checkout@08eba0b27e820071cde6df949e0beb9ba4906955
@@ -51,7 +53,7 @@ jobs:
5153
echo "Version $VERSION already exists in changelog, updating..."
5254
5355
# Extract the current entry and replace it
54-
python3 << 'EOF'
56+
python3 << EOF
5557
import re
5658
import sys
5759
@@ -146,7 +148,7 @@ jobs:
146148
echo "Adding new version $VERSION to changelog..."
147149
148150
# Add new entry after [Unreleased] section
149-
python3 << 'EOF'
151+
python3 << EOF
150152
import re
151153
152154
tag_name = "$TAG_NAME"
@@ -199,7 +201,7 @@ jobs:
199201
echo "Adding $version to changelog..."
200202
201203
# Add basic entry (detailed sync will happen on next release event)
202-
python3 << 'EOF'
204+
python3 << EOF
203205
import re
204206
205207
version = "$version"
@@ -267,6 +269,7 @@ jobs:
267269
name: Update Release Descriptions
268270
runs-on: ubuntu-latest
269271
needs: sync-changelog
272+
timeout-minutes: 15
270273
if: github.event_name == 'workflow_dispatch' && github.event.inputs.sync_all == 'true'
271274
steps:
272275
- name: Checkout code

.github/workflows/docs.yml

Lines changed: 11 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -86,10 +86,18 @@ jobs:
8686
steps:
8787
- uses: actions/checkout@08eba0b27e820071cde6df949e0beb9ba4906955
8888

89-
- name: Install Rust
90-
uses: dtolnay/rust-toolchain@5d458579430fc14a04a08a1e7d3694f545e91ce6
89+
- name: Install Rust
90+
uses: dtolnay/rust-toolchain@5d458579430fc14a04a08a1e7d3694f545e91ce6
91+
92+
- name: Cache cargo registry
93+
uses: actions/cache@0057852bfaa89a56745cba8c7296529d2fc39830
94+
with:
95+
path: |
96+
~/.cargo/registry
97+
~/.cargo/git
98+
key: ${{ runner.os }}-cargo-docs-${{ hashFiles('**/Cargo.lock') }}
9199

92-
- name: Check documentation
100+
- name: Check documentation
93101
run: cargo doc --no-deps --workspace --document-private-items
94102

95103
- name: Comment on PR if docs issues

.github/workflows/enhanced-ci.yml

Lines changed: 14 additions & 16 deletions
Original file line numberDiff line numberDiff line change
@@ -10,10 +10,8 @@ on:
1010
pull_request:
1111
branches: [main, develop]
1212
schedule:
13-
# Weekly on Sunday at 2 AM UTC for security scans
14-
- cron: '0 2 * * 0'
15-
# Weekly on Monday at 2 AM UTC for performance benchmarks
16-
- cron: '0 2 * * 1'
13+
- cron: '0 2 * * 0' # Weekly on Sunday at 2 AM UTC for security scans
14+
- cron: '0 2 * * 1' # Weekly on Monday at 2 AM UTC for performance benchmarks
1715
workflow_dispatch:
1816

1917
# Concurrency controls to prevent overlapping runs
@@ -556,8 +554,8 @@ jobs:
556554
- name: Check documentation
557555
run: |
558556
if [ ! -d "target/doc" ]; then
559-
echo "❌ Documentation build failed"
560-
exit 1
557+
echo "❌ Documentation build failed"
558+
exit 1
561559
fi
562560
echo "✅ Documentation built successfully"
563561
@@ -588,16 +586,16 @@ jobs:
588586
uses: actions/github-script@f28e40c7f34bde8b3046d885e986cb6290c5673b
589587
with:
590588
script: |
591-
github.rest.issues.createComment({
592-
issue_number: context.issue.number,
593-
owner: context.repo.owner,
594-
repo: context.repo.repo,
595-
body: '🚨 **Code Review Issues Detected**\n\n' +
596-
'Clippy found warnings or errors that need to be addressed:\n\n' +
597-
'```bash\ncargo clippy --all-targets --all-features -- -D warnings\n```\n\n' +
598-
'Please fix these issues before merging. You can run:\n' +
599-
'```bash\ncargo clippy --fix --allow-dirty\n```'
600-
})
589+
github.rest.issues.createComment({
590+
issue_number: context.issue.number,
591+
owner: context.repo.owner,
592+
repo: context.repo.repo,
593+
body: '🚨 **Code Review Issues Detected**\n\n' +
594+
'Clippy found warnings or errors that need to be addressed:\n\n' +
595+
'```bash\ncargo clippy --all-targets --all-features -- -D warnings\n```\n\n' +
596+
'Please fix these issues before merging. You can run:\n' +
597+
'```bash\ncargo clippy --fix --allow-dirty\n```'
598+
})
601599
602600
# Final CI status aggregation
603601
ci-complete:

.github/workflows/monitor.yml

Lines changed: 17 additions & 13 deletions
Original file line numberDiff line numberDiff line change
@@ -17,18 +17,22 @@ concurrency:
1717
cancel-in-progress: false
1818

1919
jobs:
20-
monitor:
21-
runs-on: ubuntu-latest
22-
permissions:
23-
issues: write
24-
contents: read
25-
actions: read
26-
security-events: write
27-
steps:
28-
- name: Checkout repository
29-
uses: actions/checkout@08eba0b27e820071cde6df949e0beb9ba4906955
20+
monitor:
21+
runs-on: ubuntu-latest
22+
timeout-minutes: 10
23+
permissions:
24+
issues: write
25+
contents: read
26+
actions: read
27+
security-events: write
28+
steps:
29+
- name: Checkout repository
30+
uses: actions/checkout@11bd71901bbe5b1630ceea73d27597364c9af683
3031

31-
- name: List recent workflow runs
32+
- name: Install jq
33+
run: sudo apt-get update && sudo apt-get install -y jq
34+
35+
- name: List recent workflow runs
3236
run: |
3337
# Calculate date 24 hours ago in ISO 8601 format
3438
since=$(date -u -d '24 hours ago' +%Y-%m-%dT%H:%M:%SZ)
@@ -54,8 +58,8 @@ jobs:
5458
5559
- name: Check for failures in monitored workflows
5660
run: |
57-
# Define monitored workflows (without .yml extension)
58-
workflows=("Auto-fix Code Quality Issues" "CI" "Deploy Docs" "Release Build")
61+
# Define monitored workflows (without .yml extension)
62+
workflows=("Auto-fix Code Quality Issues" "Enhanced CI/CD" "Deploy Docs" "Release Management")
5963
6064
failures=()
6165

0 commit comments

Comments
 (0)