-
Notifications
You must be signed in to change notification settings - Fork 3
feat: CI/CD pipeline optimization and health monitoring #101
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Merged
Merged
Changes from all commits
Commits
Show all changes
34 commits
Select commit
Hold shift + click to select a range
a3c8451
fix: use make targets for Python versions in container tag calculation
fgogolli 203bdcd
fix: use GitHub App token for semantic-release cross-workflow triggers
fgogolli 434b0e1
feat: improve CI/CD workflow reliability and add production pipeline
fgogolli e2565c5
refactor: improve workflow naming and add comprehensive documentation
fgogolli 7599b4a
docs: update existing documentation for new CI/CD pipeline
fgogolli edb8ca8
refactor: rename dev-publish to dev-pypi for consistent naming
fgogolli 8d3f526
fix: resolve all workflow issues and clean up obsolete files
fgogolli 88e614e
fix: remove unnecessary changelog validation on main branch pushes
fgogolli 0aa93c2
refactor: rename changelog workflow for clarity
fgogolli 217f3b3
fix: add critical path filtering to prevent unnecessary workflow runs
fgogolli 8c5e2c2
fix: improve CI/CD workflow efficiency and validation
fgogolli 5784722
fix: add security scanning to release dependencies
fgogolli bcd9bf4
fix: remove hardcoded Python version from cache-management
fgogolli 61525d5
fix: centralize environment variables in shared-config
fgogolli ba45127
fix: standardize action versions to latest stable
fgogolli f129cac
fix: complete environment variable centralization
fgogolli c7cdb3c
fix: improve workflow security and reliability
fgogolli ba7a3db
fix: complete cache standardization and workflow consistency
fgogolli 10e9b89
fix: add concurrency controls and improve workflow naming
fgogolli 385f7ff
fix: add self-reference to changelog-validation workflow
fgogolli 677573a
fix: add missing self-references to workflow path triggers
fgogolli 365566b
fix: standardize artifact management policies
fgogolli 955adb1
feat: add basic workflow health monitoring
fgogolli eb7e4f7
feat: add basic workflow health monitoring
fgogolli 2c8bae3
feat: add status badges to README
fgogolli ffd306e
docs: update CI/CD optimization tracking with accurate completion status
fgogolli 7666bcb
feat: add dynamic health and advanced metrics badges
fgogolli d1b3eb0
fix: configure dynamic badge gist URLs
fgogolli 7d93e48
fix: resolve workflow validation errors
fgogolli 53272d0
refactor: reorganize README badges for better readability
fgogolli 544e4d1
fix: resolve shellcheck warnings in health-monitoring workflow
fgogolli 8a93c0e
fix: make architecture validation and mypy checks optional with clear…
fgogolli 5242efd
fix: make test report generation optional to prevent PR blocking
fgogolli d231e94
fix: replace custom test aggregation with proven GitHub Action
fgogolli File filter
Filter by extension
Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
There are no files selected for viewing
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| Original file line number | Diff line number | Diff line change |
|---|---|---|
| @@ -0,0 +1,162 @@ | ||
| name: Advanced Metrics Badges | ||
|
|
||
| permissions: | ||
| contents: read | ||
| actions: read | ||
|
|
||
| on: | ||
| push: | ||
| branches: [ main ] | ||
| paths: | ||
| - 'src/**' | ||
| - 'tests/**' | ||
| - 'pyproject.toml' | ||
| workflow_dispatch: | ||
|
|
||
| jobs: | ||
| config: | ||
| name: Configuration | ||
| uses: ./.github/workflows/shared-config.yml | ||
|
|
||
| metrics: | ||
| name: Generate Advanced Metrics | ||
| needs: config | ||
| runs-on: ubuntu-latest | ||
| permissions: | ||
| contents: read | ||
| actions: read | ||
|
|
||
| steps: | ||
| - name: Checkout code | ||
| uses: actions/checkout@v6.0.1 | ||
|
|
||
| - name: Set up Python | ||
| uses: actions/setup-python@v5 | ||
| with: | ||
| python-version: ${{ needs.config.outputs.default-python-version }} | ||
|
|
||
| - name: Cache management | ||
| uses: ./.github/workflows/cache-management.yml | ||
| with: | ||
| python-version: ${{ needs.config.outputs.default-python-version }} | ||
|
|
||
| - name: Install dependencies | ||
| run: | | ||
| python -m pip install --upgrade pip | ||
| pip install coverage pytest cloc | ||
|
|
||
| - name: Run tests with coverage | ||
| run: | | ||
| coverage run -m pytest tests/ --tb=short | ||
| coverage report --format=total > coverage.txt | ||
| coverage xml | ||
|
|
||
| - name: Calculate lines of code | ||
| run: | | ||
| # Install cloc if not available | ||
| sudo apt-get update && sudo apt-get install -y cloc | ||
|
|
||
| # Count lines of code (excluding tests, docs, config) | ||
| cloc src/ --json --out=cloc.json | ||
|
|
||
| # Extract metrics | ||
| total_lines=$(jq -r '.SUM.code // 0' cloc.json) | ||
| comment_lines=$(jq -r '.SUM.comment // 0' cloc.json) | ||
|
|
||
| # Calculate comment percentage | ||
| if [ "$total_lines" -gt 0 ]; then | ||
| comment_percent=$(echo "scale=1; $comment_lines * 100 / $total_lines" | bc) | ||
| else | ||
| comment_percent="0" | ||
| fi | ||
|
|
||
| # Format for badges | ||
| if [ "$total_lines" -ge 1000 ]; then | ||
| loc_display=$(echo "scale=1; $total_lines / 1000" | bc)k | ||
| else | ||
| loc_display="$total_lines" | ||
| fi | ||
|
|
||
| echo "TOTAL_LOC=$loc_display" >> "$GITHUB_ENV" | ||
| echo "COMMENT_PERCENT=$comment_percent" >> "$GITHUB_ENV" | ||
|
|
||
| - name: Run performance test | ||
| run: | | ||
| start_time=$(date +%s.%N) | ||
| python -m pytest tests/ -x --tb=no -q | ||
| end_time=$(date +%s.%N) | ||
|
|
||
| # Calculate duration in seconds | ||
| duration=$(echo "$end_time - $start_time" | bc) | ||
| duration_formatted=$(printf "%.1fs" "$duration") | ||
|
|
||
| echo "TEST_DURATION=$duration_formatted" >> "$GITHUB_ENV" | ||
|
|
||
| - name: Extract coverage percentage | ||
| run: | | ||
| coverage_percent=$(cat coverage.txt) | ||
| echo "COVERAGE_PERCENT=$coverage_percent" >> "$GITHUB_ENV" | ||
|
|
||
| # Set coverage color | ||
| if [ "$coverage_percent" -ge 90 ]; then | ||
| coverage_color="brightgreen" | ||
| elif [ "$coverage_percent" -ge 75 ]; then | ||
| coverage_color="yellow" | ||
| elif [ "$coverage_percent" -ge 60 ]; then | ||
| coverage_color="orange" | ||
| else | ||
| coverage_color="red" | ||
| fi | ||
|
|
||
| echo "COVERAGE_COLOR=$coverage_color" >> "$GITHUB_ENV" | ||
|
|
||
| - name: Create coverage badge | ||
| uses: schneegans/dynamic-badges-action@v1.7.0 | ||
| with: | ||
| auth: ${{ secrets.GITHUB_TOKEN }} | ||
| gistID: ${{ secrets.METRICS_GIST_ID }} | ||
| filename: coverage.json | ||
| label: Coverage | ||
| message: ${{ env.COVERAGE_PERCENT }}% | ||
| color: ${{ env.COVERAGE_COLOR }} | ||
|
|
||
| - name: Create lines of code badge | ||
| uses: schneegans/dynamic-badges-action@v1.7.0 | ||
| with: | ||
| auth: ${{ secrets.GITHUB_TOKEN }} | ||
| gistID: ${{ secrets.METRICS_GIST_ID }} | ||
| filename: lines-of-code.json | ||
| label: Lines of Code | ||
| message: ${{ env.TOTAL_LOC }} | ||
| color: lightgrey | ||
|
|
||
| - name: Create comment percentage badge | ||
| uses: schneegans/dynamic-badges-action@v1.7.0 | ||
| with: | ||
| auth: ${{ secrets.GITHUB_TOKEN }} | ||
| gistID: ${{ secrets.METRICS_GIST_ID }} | ||
| filename: comments.json | ||
| label: Comments | ||
| message: ${{ env.COMMENT_PERCENT }}% | ||
| valColorRange: ${{ env.COMMENT_PERCENT }} | ||
| maxColorRange: 30 | ||
| minColorRange: 0 | ||
|
|
||
| - name: Create test duration badge | ||
| uses: schneegans/dynamic-badges-action@v1.7.0 | ||
| with: | ||
| auth: ${{ secrets.GITHUB_TOKEN }} | ||
| gistID: ${{ secrets.METRICS_GIST_ID }} | ||
| filename: test-duration.json | ||
| label: Test Duration | ||
| message: ${{ env.TEST_DURATION }} | ||
| color: blue | ||
|
|
||
| - name: Upload coverage report | ||
| uses: actions/upload-artifact@v4.4.3 | ||
| with: | ||
| name: coverage-report | ||
| retention-days: 30 | ||
| path: | | ||
| coverage.xml | ||
| cloc.json | ||
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Oops, something went wrong.
Oops, something went wrong.
Add this suggestion to a batch that can be applied as a single commit.
This suggestion is invalid because no changes were made to the code.
Suggestions cannot be applied while the pull request is closed.
Suggestions cannot be applied while viewing a subset of changes.
Only one suggestion per line can be applied in a batch.
Add this suggestion to a batch that can be applied as a single commit.
Applying suggestions on deleted lines is not supported.
You must change the existing code in this line in order to create a valid suggestion.
Outdated suggestions cannot be applied.
This suggestion has been applied or marked resolved.
Suggestions cannot be applied from pending reviews.
Suggestions cannot be applied on multi-line comments.
Suggestions cannot be applied while the pull request is queued to merge.
Suggestion cannot be applied right now. Please check back later.
Uh oh!
There was an error while loading. Please reload this page.