Bump Microsoft.Extensions.DependencyInjection.Abstractions from 8.0.0 to 10.0.1 #69
Workflow file for this run
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
| name: π CI/CD Pipeline | |
| on: | |
| push: | |
| branches: [ main, develop ] | |
| pull_request: | |
| branches: [ main, develop ] | |
| env: | |
| DOTNET_VERSION: '8.0.x' | |
| SOLUTION_FILE: 'MetaExtractor.sln' | |
| jobs: | |
| # Build and Test Job | |
| build-and-test: | |
| name: π¨ Build & Test | |
| runs-on: ubuntu-latest | |
| permissions: | |
| contents: read | |
| pull-requests: write | |
| steps: | |
| - name: π₯ Checkout Code | |
| uses: actions/checkout@v5 | |
| with: | |
| fetch-depth: 0 # Fetch all history for GitVersion | |
| - name: π οΈ Setup .NET | |
| uses: actions/setup-dotnet@v5 | |
| with: | |
| dotnet-version: ${{ env.DOTNET_VERSION }} | |
| - name: π¦ Cache NuGet Packages | |
| uses: actions/cache@v4 | |
| with: | |
| path: ~/.nuget/packages | |
| key: ${{ runner.os }}-nuget-${{ hashFiles('**/*.csproj') }} | |
| restore-keys: | | |
| ${{ runner.os }}-nuget- | |
| - name: π Restore Dependencies | |
| run: dotnet restore ${{ env.SOLUTION_FILE }} | |
| - name: π¨ Build Solution (Debug) | |
| run: dotnet build ${{ env.SOLUTION_FILE }} --configuration Debug --no-restore | |
| - name: π¨ Build Solution (Release) | |
| run: dotnet build ${{ env.SOLUTION_FILE }} --configuration Release --no-restore | |
| - name: π§ͺ Run Tests with Coverage | |
| run: | | |
| dotnet test ${{ env.SOLUTION_FILE }} \ | |
| --configuration Release \ | |
| --no-build \ | |
| --verbosity normal \ | |
| --logger trx \ | |
| --collect:"XPlat Code Coverage" \ | |
| --results-directory ./TestResults | |
| env: | |
| CI: true | |
| - name: π Install ReportGenerator | |
| run: dotnet tool install -g dotnet-reportgenerator-globaltool | |
| - name: π Generate Coverage Report | |
| run: | | |
| reportgenerator \ | |
| -reports:"./TestResults/**/coverage.cobertura.xml" \ | |
| -targetdir:"./CoverageReport" \ | |
| -reporttypes:"Html;HtmlSummary;Badges;JsonSummary" \ | |
| -title:"MetaExtractor Test Coverage" \ | |
| -tag:"${{ github.run_number }}" \ | |
| -historydir:"./CoverageHistory" | |
| - name: π€ Upload Test Results | |
| uses: actions/upload-artifact@v4 | |
| if: always() | |
| with: | |
| name: test-results | |
| path: ./TestResults/**/*.trx | |
| - name: π€ Upload Coverage Report | |
| uses: actions/upload-artifact@v4 | |
| with: | |
| name: coverage-report | |
| path: ./CoverageReport/ | |
| - name: π¬ Coverage Comment | |
| if: github.event_name == 'pull_request' | |
| continue-on-error: true | |
| uses: actions/github-script@v7 | |
| with: | |
| script: | | |
| const fs = require('fs'); | |
| try { | |
| const summary = JSON.parse(fs.readFileSync('./CoverageReport/Summary.json', 'utf8')); | |
| const coverage = summary.summary.linecoverage; | |
| const comment = `## π Test Coverage Report | |
| **Line Coverage: ${coverage}%** | |
| | Metric | Value | | |
| |--------|--------| | |
| | Line Coverage | ${coverage}% | | |
| | Branch Coverage | ${summary.summary.branchcoverage}% | | |
| | Method Coverage | ${summary.summary.methodcoverage}% | | |
| View the full [coverage report](https://astrostray.github.io/Avalonia-Face-Metadata-Extractor/coverage/) after merge. | |
| π€ *Generated by CI Pipeline*`; | |
| github.rest.issues.createComment({ | |
| issue_number: context.issue.number, | |
| owner: context.repo.owner, | |
| repo: context.repo.repo, | |
| body: comment | |
| }); | |
| } catch (error) { | |
| console.log('Could not read coverage summary:', error.message); | |
| } | |
| # Security Analysis Job | |
| security-analysis: | |
| name: π Security Analysis | |
| runs-on: ubuntu-latest | |
| permissions: | |
| security-events: write | |
| contents: read | |
| actions: read | |
| steps: | |
| - name: π₯ Checkout Code | |
| uses: actions/checkout@v5 | |
| - name: π Initialize CodeQL | |
| uses: github/codeql-action/init@v3 | |
| with: | |
| languages: csharp | |
| queries: security-and-quality | |
| - name: π οΈ Setup .NET | |
| uses: actions/setup-dotnet@v5 | |
| with: | |
| dotnet-version: ${{ env.DOTNET_VERSION }} | |
| - name: π¨ Autobuild | |
| uses: github/codeql-action/autobuild@v3 | |
| - name: π Perform CodeQL Analysis | |
| uses: github/codeql-action/analyze@v3 | |
| # Deploy Coverage to GitHub Pages | |
| deploy-coverage: | |
| name: π Deploy Coverage to GitHub Pages | |
| runs-on: ubuntu-latest | |
| needs: build-and-test | |
| if: github.ref == 'refs/heads/main' && github.event_name == 'push' | |
| permissions: | |
| contents: read | |
| pages: write | |
| id-token: write | |
| environment: | |
| name: github-pages | |
| url: ${{ steps.deployment.outputs.page_url }} | |
| steps: | |
| - name: π₯ Download Coverage Report | |
| uses: actions/download-artifact@v4 | |
| with: | |
| name: coverage-report | |
| path: ./coverage | |
| - name: π Create Index Page | |
| run: | | |
| cat > ./coverage/index.html << 'EOF' | |
| <!DOCTYPE html> | |
| <html> | |
| <head> | |
| <title>MetaExtractor - Test Coverage</title> | |
| <style> | |
| body { font-family: -apple-system, BlinkMacSystemFont, 'Segoe UI', roboto, sans-serif; margin: 40px; background: #f6f8fa; } | |
| .container { max-width: 800px; margin: 0 auto; background: white; padding: 40px; border-radius: 8px; box-shadow: 0 1px 3px rgba(0,0,0,0.1); } | |
| h1 { color: #24292e; border-bottom: 1px solid #e1e4e8; padding-bottom: 10px; } | |
| .badge { display: inline-block; padding: 4px 8px; border-radius: 4px; color: white; font-weight: bold; margin: 5px; } | |
| .coverage-high { background: #28a745; } | |
| .coverage-medium { background: #ffc107; color: #212529; } | |
| .coverage-low { background: #dc3545; } | |
| a { color: #0366d6; text-decoration: none; } | |
| a:hover { text-decoration: underline; } | |
| .info { background: #f1f8ff; border: 1px solid #c8e1ff; border-radius: 6px; padding: 16px; margin: 20px 0; } | |
| </style> | |
| </head> | |
| <body> | |
| <div class="container"> | |
| <h1>π§ͺ MetaExtractor Test Coverage</h1> | |
| <div class="info"> | |
| <p><strong>π Automated Test Coverage Reports</strong></p> | |
| <p>This page contains automatically generated test coverage reports for the MetaExtractor project. Reports are updated on every push to main branch.</p> | |
| </div> | |
| <p><strong>π Quick Access:</strong></p> | |
| <ul> | |
| <li><a href="./index.htm">π Full HTML Coverage Report</a></li> | |
| <li><a href="./summary.htm">π Coverage Summary</a></li> | |
| </ul> | |
| <p><strong>π§ Project Info:</strong></p> | |
| <ul> | |
| <li><strong>Framework:</strong> .NET 8, AvaloniaUI</li> | |
| <li><strong>Test Framework:</strong> XUnit</li> | |
| <li><strong>Coverage Tool:</strong> Coverlet + ReportGenerator</li> | |
| <li><strong>Last Updated:</strong> $(date)</li> | |
| </ul> | |
| <hr> | |
| <p><em>π€ Generated automatically by GitHub Actions CI/CD Pipeline</em></p> | |
| </div> | |
| </body> | |
| </html> | |
| EOF | |
| - name: ποΈ Setup GitHub Pages | |
| uses: actions/configure-pages@v5 | |
| with: | |
| enablement: true | |
| - name: π€ Upload to GitHub Pages | |
| uses: actions/upload-pages-artifact@v4 | |
| with: | |
| path: ./coverage | |
| - name: π Deploy to GitHub Pages | |
| id: deployment | |
| uses: actions/deploy-pages@v4 | |
| # Notification Job | |
| notify-results: | |
| name: π’ Notify Results | |
| runs-on: ubuntu-latest | |
| needs: [build-and-test, security-analysis] | |
| if: always() | |
| steps: | |
| - name: π Build Results Summary | |
| uses: actions/github-script@v7 | |
| with: | |
| script: | | |
| const buildResult = '${{ needs.build-and-test.result }}'; | |
| const securityResult = '${{ needs.security-analysis.result }}'; | |
| let summary = '## π CI/CD Pipeline Results\n\n'; | |
| summary += `| Job | Status |\n|-----|--------|\n`; | |
| summary += `| π¨ Build & Test | ${buildResult === 'success' ? 'β Passed' : 'β Failed'} |\n`; | |
| summary += `| π Security Analysis | ${securityResult === 'success' ? 'β Passed' : 'β Failed'} |\n\n`; | |
| if (buildResult === 'success' && securityResult === 'success') { | |
| summary += 'π All checks passed! Ready for merge.'; | |
| } else { | |
| summary += 'β οΈ Some checks failed. Please review the logs.'; | |
| } | |
| console.log(summary); |