docs: Add documentation and localization for Sprint 3 #35
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: .NET Build and Test | |
| on: | |
| push: | |
| branches: [ "main", "develop", "claude/**" ] | |
| pull_request: | |
| branches: [ "main", "develop" ] | |
| workflow_dispatch: | |
| jobs: | |
| build-and-test: | |
| name: Build and Test | |
| runs-on: windows-latest | |
| steps: | |
| - name: Checkout code | |
| uses: actions/checkout@v4 | |
| with: | |
| fetch-depth: 0 | |
| - name: Setup .NET | |
| uses: actions/setup-dotnet@v4 | |
| with: | |
| dotnet-version: '10.0.x' | |
| - name: Display .NET version | |
| run: dotnet --version | |
| - name: Set development build version | |
| shell: pwsh | |
| run: | | |
| $buildNumber = "${{ github.run_number }}" | |
| $version = "0.0.$buildNumber" | |
| echo "BUILD_VERSION=$version" >> $env:GITHUB_ENV | |
| echo "Building version: $version" | |
| - name: Restore dependencies | |
| run: dotnet restore PrettyScreenSHOT.csproj | |
| - name: Build solution | |
| run: dotnet build PrettyScreenSHOT.csproj --configuration Release --no-restore /p:Version=${{ env.BUILD_VERSION }} /p:AssemblyVersion=${{ env.BUILD_VERSION }} /p:FileVersion=${{ env.BUILD_VERSION }} /p:InformationalVersion=${{ env.BUILD_VERSION }}-build.${{ github.run_number }} | |
| - name: Restore test dependencies | |
| run: dotnet restore Tests/PrettyScreenSHOT.Tests.csproj | |
| - name: Build tests | |
| run: dotnet build Tests/PrettyScreenSHOT.Tests.csproj --configuration Release --no-restore /p:Version=${{ env.BUILD_VERSION }} | |
| - name: Run unit tests | |
| run: dotnet test Tests/PrettyScreenSHOT.Tests.csproj --configuration Release --no-build --verbosity normal --logger "trx;LogFileName=test-results.trx" --collect:"XPlat Code Coverage" | |
| - name: Display build version info | |
| shell: pwsh | |
| run: | | |
| echo "✅ Build completed successfully" | |
| echo "📦 Version: ${{ env.BUILD_VERSION }}" | |
| echo "🔢 Build number: ${{ github.run_number }}" | |
| echo "🌿 Branch: ${{ github.ref_name }}" | |
| - name: Upload test results | |
| if: always() | |
| uses: actions/upload-artifact@v4 | |
| with: | |
| name: test-results | |
| path: '**/test-results.trx' | |
| - name: Upload code coverage | |
| if: always() | |
| uses: actions/upload-artifact@v4 | |
| with: | |
| name: code-coverage | |
| path: '**/coverage.cobertura.xml' | |
| - name: Publish build artifacts | |
| uses: actions/upload-artifact@v4 | |
| with: | |
| name: build-artifacts | |
| path: | | |
| bin/Release/net10.0-windows/ | |
| !bin/Release/net10.0-windows/**/*.pdb | |
| code-quality: | |
| name: Code Quality Analysis | |
| runs-on: windows-latest | |
| needs: build-and-test | |
| steps: | |
| - name: Checkout code | |
| uses: actions/checkout@v4 | |
| - name: Setup .NET | |
| uses: actions/setup-dotnet@v4 | |
| with: | |
| dotnet-version: '10.0.x' | |
| - name: Restore dependencies | |
| run: dotnet restore PrettyScreenSHOT.csproj | |
| - name: Build for analysis | |
| run: dotnet build PrettyScreenSHOT.csproj --configuration Release --no-restore /p:TreatWarningsAsErrors=false | |
| - name: Run code analysis | |
| run: dotnet build PrettyScreenSHOT.csproj --configuration Release --no-restore /p:RunAnalyzers=true /p:AnalysisLevel=latest | |
| continue-on-error: true | |
| test-coverage-report: | |
| name: Test Coverage Report | |
| runs-on: windows-latest | |
| needs: build-and-test | |
| if: github.event_name == 'pull_request' | |
| steps: | |
| - name: Checkout code | |
| uses: actions/checkout@v4 | |
| - name: Download coverage artifacts | |
| uses: actions/download-artifact@v4 | |
| with: | |
| name: code-coverage | |
| path: coverage | |
| - name: Code Coverage Summary | |
| uses: irongut/CodeCoverageSummary@v1.3.0 | |
| with: | |
| filename: coverage/**/coverage.cobertura.xml | |
| badge: true | |
| format: markdown | |
| output: both | |
| continue-on-error: true | |
| - name: Add Coverage PR Comment | |
| uses: marocchino/sticky-pull-request-comment@v2 | |
| if: github.event_name == 'pull_request' | |
| with: | |
| recreate: true | |
| path: code-coverage-results.md | |
| continue-on-error: true | |
| security-scan: | |
| name: Security Scan | |
| runs-on: windows-latest | |
| needs: build-and-test | |
| steps: | |
| - name: Checkout code | |
| uses: actions/checkout@v4 | |
| - name: Setup .NET | |
| uses: actions/setup-dotnet@v4 | |
| with: | |
| dotnet-version: '10.0.x' | |
| - name: Restore dependencies | |
| run: dotnet restore PrettyScreenSHOT.csproj | |
| - name: Run security audit | |
| run: dotnet list package --vulnerable --include-transitive | |
| continue-on-error: true | |
| build-status: | |
| name: Build Status Summary | |
| runs-on: windows-latest | |
| needs: [build-and-test, code-quality, security-scan] | |
| if: always() | |
| steps: | |
| - name: Check build status | |
| run: | | |
| echo "Build and Test: ${{ needs.build-and-test.result }}" | |
| echo "Code Quality: ${{ needs.code-quality.result }}" | |
| echo "Security Scan: ${{ needs.security-scan.result }}" | |
| - name: Report success | |
| if: needs.build-and-test.result == 'success' | |
| run: echo "✅ All checks passed!" | |
| - name: Report failure | |
| if: needs.build-and-test.result != 'success' | |
| run: | | |
| echo "❌ Build or tests failed!" | |
| exit 1 |