Skip to content

Commit 67b32f8

Browse files
authored
Merge pull request #36 from d-oit/release/v0.2.1
Fix GitHub Actions workflows
2 parents 45f6676 + 88a956f commit 67b32f8

File tree

3,864 files changed

+288
-43647
lines changed

Some content is hidden

Large Commits have some content hidden by default. Use the searchbox below for content that may be hidden.

3,864 files changed

+288
-43647
lines changed
Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,3 +1,3 @@
11
{
2-
".": "0.1.9"
2+
".": "0.2.1"
33
}

.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: 39 additions & 55 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
@@ -127,53 +125,40 @@ jobs:
127125
run: |
128126
echo "🔧 Checking formatting..."
129127
if ! cargo fmt --all -- --check; then
130-
echo "Formatting issues found, applying fixes..."
131-
cargo fmt --all
132-
echo "format_fixed=true" >> $GITHUB_OUTPUT
128+
echo "Formatting issues found, applying fixes..."
129+
cargo fmt --all
130+
echo "format_fixed=true" >> $GITHUB_OUTPUT
133131
else
134-
echo "✅ Formatting is correct"
135-
echo "format_fixed=false" >> $GITHUB_OUTPUT
132+
echo "✅ Formatting is correct"
133+
echo "format_fixed=false" >> $GITHUB_OUTPUT
136134
fi
137135
138136
- name: Check and auto-fix clippy issues
139137
id: clippy-check
140138
run: |
141139
echo "🔧 Running clippy..."
142140
if ! cargo clippy --all-targets --all-features -- -D warnings; then
143-
echo "Clippy issues found, attempting fixes..."
144-
cargo clippy --all-targets --all-features --fix --allow-dirty
145-
echo "clippy_fixed=true" >> $GITHUB_OUTPUT
141+
echo "Clippy issues found, attempting fixes..."
142+
cargo clippy --all-targets --all-features --fix --allow-dirty
143+
echo "clippy_fixed=true" >> $GITHUB_OUTPUT
146144
else
147-
echo "✅ Clippy checks passed"
148-
echo "clippy_fixed=false" >> $GITHUB_OUTPUT
145+
echo "✅ Clippy checks passed"
146+
echo "clippy_fixed=false" >> $GITHUB_OUTPUT
149147
fi
150148
151149
- name: Check workspace integrity
152150
run: cargo check --workspace --all-targets
153151

154152
- name: Commit fixes if applied
155-
if: steps.format-check.outputs.format_fixed == 'true' || steps.clippy-check.outputs.clippy_fixed == 'true'
153+
if: steps.format-check.outputs.format_fixed == 'true' || steps.clippy-check.outputs.clippy_fixed == 'true'
156154
run: |
157155
git config --local user.email "41898282+github-actions[bot]@users.noreply.github.com"
158156
git config --local user.name "github-actions[bot]"
159-
160-
if ! git diff --quiet; then
161-
git add .
162-
163-
COMMIT_MSG="auto-fix: apply code quality fixes"
164-
if [[ "${{ steps.format-check.outputs.format_fixed }}" == "true" ]]; then
165-
COMMIT_MSG="$COMMIT_MSG
166-
- Apply cargo fmt formatting"
167-
fi
168-
if [[ "${{ steps.clippy-check.outputs.clippy_fixed }}" == "true" ]]; then
169-
COMMIT_MSG="$COMMIT_MSG
170-
- Apply clippy suggestions"
171-
fi
172-
173-
git commit -m "$COMMIT_MSG"
174-
git push
175-
echo "✅ Code quality fixes applied and pushed!"
176-
fi
157+
if [[ $(git status --porcelain) ]]; then
158+
git add .
159+
git commit -m "chore: auto-fix formatting and clippy issues"
160+
git push
161+
fi
177162
178163
# Security scanning (comprehensive)
179164
security-scan:
@@ -220,7 +205,7 @@ jobs:
220205
221206
- name: Secrets detection
222207
uses: gitleaks/gitleaks-action@ff98106e4c7b2bc287b24eaf42907196329070c7
223-
env:
208+
env:
224209
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }}
225210

226211
- name: Upload security reports
@@ -247,19 +232,19 @@ jobs:
247232
uses: actions/cache@0057852bfaa89a56745cba8c7296529d2fc39830
248233
with:
249234
path: |
250-
~/.cargo/registry
251-
~/.cargo/git
235+
~/.cargo/registry
236+
~/.cargo/git
252237
key: ${{ runner.os }}-cargo-registry-${{ hashFiles('**/Cargo.lock') }}
253238
restore-keys: |
254-
${{ runner.os }}-cargo-registry-
239+
${{ runner.os }}-cargo-registry-
255240
256241
- name: Cache target
257242
uses: actions/cache@0057852bfaa89a56745cba8c7296529d2fc39830
258243
with:
259244
path: target
260245
key: ${{ runner.os }}-target-${{ hashFiles('**/Cargo.lock') }}
261246
restore-keys: |
262-
${{ runner.os }}-target-
247+
${{ runner.os }}-target-
263248
264249
- name: Build workspace
265250
run: cargo build --workspace --all-targets --all-features
@@ -282,14 +267,13 @@ jobs:
282267
rust: beta
283268

284269
steps:
285-
-
286-
uses: actions/checkout@08eba0b27e820071cde6df949e0beb9ba4906955
270+
- uses: actions/checkout@08eba0b27e820071cde6df949e0beb9ba4906955
287271
with:
288272
fetch-depth: 0
289273
- name: Install Rust
290-
uses: dtolnay/rust-toolchain@5d458579430fc14a04a08a1e7d3694f545e91ce6
291-
with:
292-
toolchain: ${{ matrix.rust }}
274+
uses: dtolnay/rust-toolchain@5d458579430fc14a04a08a1e7d3694f545e91ce6
275+
with:
276+
toolchain: ${{ matrix.rust }}
293277

294278
- name: Install cargo-nextest
295279
uses: taiki-e/install-action@fa0639a7132933c4081764bded317e92c04e5c07
@@ -570,8 +554,8 @@ jobs:
570554
- name: Check documentation
571555
run: |
572556
if [ ! -d "target/doc" ]; then
573-
echo "❌ Documentation build failed"
574-
exit 1
557+
echo "❌ Documentation build failed"
558+
exit 1
575559
fi
576560
echo "✅ Documentation built successfully"
577561
@@ -602,16 +586,16 @@ jobs:
602586
uses: actions/github-script@f28e40c7f34bde8b3046d885e986cb6290c5673b
603587
with:
604588
script: |
605-
github.rest.issues.createComment({
606-
issue_number: context.issue.number,
607-
owner: context.repo.owner,
608-
repo: context.repo.repo,
609-
body: '🚨 **Code Review Issues Detected**\n\n' +
610-
'Clippy found warnings or errors that need to be addressed:\n\n' +
611-
'```bash\ncargo clippy --all-targets --all-features -- -D warnings\n```\n\n' +
612-
'Please fix these issues before merging. You can run:\n' +
613-
'```bash\ncargo clippy --fix --allow-dirty\n```'
614-
})
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+
})
615599
616600
# Final CI status aggregation
617601
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)