build(deps): bump actions/setup-dotnet from 4.3.1 to 5.4.0 #213
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 Build & Test | |
| on: | |
| push: | |
| branches: | |
| - "feature/*" | |
| - "bug/*" | |
| - "hotfix/*" | |
| pull_request: | |
| branches: | |
| - "main" | |
| types: [opened, synchronize, reopened, closed] | |
| env: | |
| DOTNET_VERSION: "10.0.x" | |
| jobs: | |
| # Build QRCoder.Core | |
| build-qrcoder: | |
| name: Build QRCoder.Core (.NET 10) | |
| runs-on: ubuntu-latest | |
| steps: | |
| - name: Checkout Code | |
| uses: actions/checkout@v7 | |
| with: | |
| fetch-depth: 0 | |
| - name: Setup .NET | |
| uses: actions/setup-dotnet@v5.4.0 | |
| with: | |
| dotnet-version: ${{ env.DOTNET_VERSION }} | |
| - name: Install SkiaSharp Dependencies | |
| run: | | |
| sudo apt-get update | |
| sudo apt-get install -y libfontconfig1 libfreetype6 libx11-6 libxext6 libxrender1 libxtst6 | |
| # Additional dependencies for .NET 10.0 SkiaSharp | |
| sudo apt-get install -y libglib2.0-0 libgtk-3-0 libxss1 libasound2-dev | |
| sudo apt install mesa-utils ttf-mscorefonts-installer dbus libfontconfig1 libxrandr2 libxi-dev | |
| # Install SkiaSharp native dependencies manually | |
| sudo apt-get install -y libgl1-mesa-dev libglu1-mesa-dev libdrm-dev libx11-xcb-dev libxcb1-dev libxkbcommon-dev libwayland-dev | |
| - name: Setup SkiaSharp Environment | |
| run: | | |
| echo "Setting up SkiaSharp environment variables" | |
| echo "LD_LIBRARY_PATH=/usr/lib/x86_64-linux-gnu:/usr/local/lib:$LD_LIBRARY_PATH" >> $GITHUB_ENV | |
| echo "LIBGL_DRIVERS_PATH=/usr/lib/x86_64-linux-gnu/dri" >> $GITHUB_ENV | |
| - name: Cache NuGet Packages | |
| uses: actions/cache@v6 | |
| with: | |
| path: ~/.nuget/packages | |
| key: ${{ runner.os }}-nuget-${{ hashFiles('**/*.csproj') }} | |
| restore-keys: | | |
| ${{ runner.os }}-nuget- | |
| - name: Restore Dependencies | |
| run: | | |
| dotnet restore QRCoder.Core.sln | |
| - name: Build Project | |
| run: | | |
| dotnet build QRCoder.Core.sln --configuration Release --no-restore | |
| - name: Copy SkiaSharp Native Libraries | |
| run: | | |
| echo "Copying SkiaSharp native libraries to output directories" | |
| # Find and copy libSkiaSharp.so to all test output directories | |
| find ~/.nuget/packages -name "libSkiaSharp.so" -type f | while read file; do | |
| echo "Found SkiaSharp library: $file" | |
| # Copy to all framework output directories | |
| for framework in netstandard2.1 net8.0 net10.0; do | |
| target_dir="QRCoder.Core.Tests/bin/Release/$framework" | |
| if [ -d "$target_dir" ]; then | |
| cp "$file" "$target_dir/" | |
| echo "Copied to $target_dir/" | |
| fi | |
| done | |
| done | |
| # Also try to copy from runtimes directory if available | |
| find ~/.nuget/packages -path "*/runtimes/linux-x64/native/*" -name "*.so" -type f | while read file; do | |
| echo "Found native library: $file" | |
| for framework in netstandard2.1 net8.0 net10.0; do | |
| target_dir="QRCoder.Core.Tests/bin/Release/$framework" | |
| if [ -d "$target_dir" ]; then | |
| cp "$file" "$target_dir/" | |
| echo "Copied native library to $target_dir/" | |
| fi | |
| done | |
| done | |
| # List what we have in output directories | |
| for framework in netstandard2.1 net8.0 net10.0; do | |
| target_dir="QRCoder.Core.Tests/bin/Release/$framework" | |
| if [ -d "$target_dir" ]; then | |
| echo "=== Libraries in $target_dir ===" | |
| ls -la "$target_dir/"*.so 2>/dev/null || echo "No .so files found" | |
| fi | |
| done | |
| # Build and Test on Windows (.NET Framework) | |
| build-windows: | |
| name: Build QRCoder.Core (Windows) | |
| runs-on: windows-latest | |
| steps: | |
| - name: Checkout Code | |
| uses: actions/checkout@v7 | |
| with: | |
| fetch-depth: 0 | |
| - name: Setup .NET | |
| uses: actions/setup-dotnet@v5.4.0 | |
| with: | |
| dotnet-version: ${{ env.DOTNET_VERSION }} | |
| - name: Cache NuGet Packages | |
| uses: actions/cache@v6 | |
| with: | |
| path: ~/.nuget/packages | |
| key: ${{ runner.os }}-nuget-${{ hashFiles('**/*.csproj') }} | |
| restore-keys: | | |
| ${{ runner.os }}-nuget- | |
| - name: Restore Dependencies | |
| run: | | |
| echo "Restoring NuGet packages for QRCoder.Core.sln" | |
| dotnet restore QRCoder.Core.sln --no-cache --force --verbosity normal | |
| - name: Build Solution | |
| run: | | |
| echo "Building QRCoder.Core.sln" | |
| dotnet build QRCoder.Core.sln --no-restore --configuration Release --verbosity minimal | |
| - name: Run .NET Framework Tests | |
| run: | | |
| echo "Running tests for .NET Framework 4.8" | |
| dotnet test QRCoder.Core.Tests/ --configuration Release --logger "trx;LogFileName=test-results-net48.trx" --results-directory TestResults --framework net48 --verbosity normal | |
| - name: Upload Windows Test Results | |
| uses: actions/upload-artifact@v7 | |
| if: always() | |
| with: | |
| name: test-results-windows | |
| path: | | |
| TestResults/**/*.trx | |
| retention-days: 7 | |
| # Security & Quality Checks | |
| security: | |
| name: 🔒 Security & Quality | |
| runs-on: ubuntu-latest | |
| needs: [build-qrcoder, build-windows] | |
| steps: | |
| - name: 📥 Checkout Code | |
| uses: actions/checkout@v7 | |
| - name: 🔍 Security Scan (QRCoder.Core) | |
| run: | | |
| echo "🔒 Running security scan on QRCoder.Core" | |
| dotnet list QRCoder.Core.sln package --vulnerable | |
| - name: 📊 Code Quality Analysis | |
| run: | | |
| echo "📊 Analyzing code quality" | |
| echo "✅ Security and quality checks completed" | |
| # Performance Tests | |
| performance: | |
| name: ⚡ Performance Tests | |
| runs-on: ubuntu-latest | |
| needs: [build-qrcoder] | |
| if: github.event_name == 'push' && github.ref == 'refs/heads/main' | |
| steps: | |
| - name: 📥 Checkout Code | |
| uses: actions/checkout@v7 | |
| - name: 🗄️ Setup .NET | |
| uses: actions/setup-dotnet@v5.4.0 | |
| with: | |
| dotnet-version: ${{ env.DOTNET_VERSION }} | |
| - name: 🧪 Run Performance Tests | |
| run: | | |
| echo "⚡ Running performance tests" | |
| # Add performance tests here if QRCoder.Core.Benchmarks exists | |
| if [ -d "QRCoder.Core.Benchmarks" ]; then | |
| dotnet run --project QRCoder.Core.Benchmarks --configuration Release | |
| else | |
| echo "No benchmark project found, skipping performance tests" | |
| fi | |
| echo "Performance tests completed successfully" | |
| # Coverage Reports | |
| coverage-reports: | |
| name: 📊 Coverage Reports | |
| runs-on: ubuntu-latest | |
| needs: [build-qrcoder, build-windows] | |
| if: always() | |
| steps: | |
| - name: 📥 Checkout Code | |
| uses: actions/checkout@v7 | |
| - name: 🗄️ Setup .NET | |
| uses: actions/setup-dotnet@v5.4.0 | |
| with: | |
| dotnet-version: ${{ env.DOTNET_VERSION }} | |
| - name: 🔧 Restore dependencies | |
| run: dotnet restore QRCoder.Core.sln --ignore-failed-sources | |
| - name: 📦 Install ReportGenerator | |
| run: dotnet tool install -g dotnet-reportgenerator-globaltool | |
| - name: 🔧 Restore .NET local tools | |
| run: dotnet tool restore | |
| - name: 📊 Generate Coverage Report | |
| run: | | |
| echo "📊 Generating coverage report" | |
| if [ -d "TestResults" ]; then | |
| reportgenerator -reports:"TestResults/**/coverage.cobertura.xml" -targetdir:"TestResults/CoverageReport" -reporttypes:"Html;XmlSummary;TextSummary" | |
| else | |
| echo "No test results found, skipping coverage report generation" | |
| fi | |
| - name: 📊 Upload coverage reports to Codecov | |
| uses: codecov/codecov-action@v7 | |
| with: | |
| files: TestResults/CoverageReport/Summary.xml | |
| flags: unittests | |
| name: codecov-umbrella | |
| fail_ci_if_error: false | |
| token: ${{ secrets.CODECOV_TOKEN }} | |
| - name: 📤 Upload test results | |
| uses: actions/upload-artifact@v7 | |
| if: always() | |
| with: | |
| name: test-results-coverage | |
| path: TestResults/ | |
| retention-days: 7 | |
| - name: 📤 Upload coverage report | |
| uses: actions/upload-artifact@v7 | |
| if: always() | |
| with: | |
| name: coverage-report | |
| path: TestResults/CoverageReport/ | |
| retention-days: 7 | |
| - name: 📊 Generate Coverage Summary | |
| run: | | |
| echo "## 📊 Coverage Report Summary" >> $GITHUB_STEP_SUMMARY | |
| echo "" >> $GITHUB_STEP_SUMMARY | |
| echo "### 📈 Test Coverage Metrics" >> $GITHUB_STEP_SUMMARY | |
| echo "- **Test Results**: Available in artifacts" >> $GITHUB_STEP_SUMMARY | |
| echo "- **Coverage Report**: Generated and uploaded" >> $GITHUB_STEP_SUMMARY | |
| echo "- **Codecov**: Uploaded to Codecov platform" >> $GITHUB_STEP_SUMMARY | |
| echo "- **Artifacts**: Available for download" >> $GITHUB_STEP_SUMMARY | |
| echo "" >> $GITHUB_STEP_SUMMARY | |
| echo "### 🔗 Links" >> $GITHUB_STEP_SUMMARY | |
| echo "- **Codecov**: [View Coverage Report](https://codecov.io/gh/${{ github.repository }})" >> $GITHUB_STEP_SUMMARY | |
| echo "- **Artifacts**: Download from Actions tab" >> $GITHUB_STEP_SUMMARY | |
| # Create PR to main | |
| create-pr: | |
| name: 🔄 Create PR to main | |
| runs-on: ubuntu-latest | |
| needs: [build-qrcoder, build-windows, security, coverage-reports] | |
| if: | | |
| github.event_name == 'push' && | |
| startsWith(github.ref, 'refs/heads/feature/') || startsWith(github.ref, 'refs/heads/bug/') || startsWith(github.ref, 'refs/heads/hotfix/') | |
| steps: | |
| - name: 📥 Checkout Code | |
| uses: actions/checkout@v7 | |
| with: | |
| token: ${{ secrets.GITHUB_TOKEN }} | |
| fetch-depth: 0 | |
| - name: 🔧 Configure Git | |
| run: | | |
| git config --global user.name "GitHub Actions" | |
| git config --global user.email "actions@github.com" | |
| - name: 🔄 Create PR to main | |
| uses: peter-evans/create-pull-request@v8 | |
| with: | |
| token: ${{ secrets.GITHUB_TOKEN }} | |
| commit-message: "🚀 Auto-merge: ${{ github.event.head_commit.message }}" | |
| title: "🚀 Auto-PR: ${{ github.ref_name }} → main" | |
| body: | | |
| ## 🚀 Pull Request Automática | |
| **Branch:** `${{ github.ref_name }}` | |
| **Commit:** `${{ github.sha }}` | |
| **Autor:** `${{ github.actor }}` | |
| ### 📋 Mudanças | |
| - Build e testes executados com sucesso ✅ | |
| - Security scan aprovado 🔒 | |
| - Performance tests passados ⚡ | |
| ### 🔄 Status | |
| - ✅ QRCoder.Core Build | |
| - ✅ Testes Unitários | |
| - ✅ Security Scan | |
| - ✅ Performance Tests | |
| --- | |
| *Este PR foi criado automaticamente pelo pipeline CI/CD* | |
| branch: auto-pr/${{ github.ref_name }} | |
| delete-branch: true | |
| draft: false | |
| labels: | | |
| auto-pr | |
| ci-passed | |
| ready-for-review |