Repository navigation
Establish public client contracts and build foundation #3
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: SonarQube | |
| on: | |
| push: | |
| branches: | |
| - main | |
| pull_request: | |
| types: [opened, synchronize, reopened] | |
| jobs: | |
| build: | |
| name: Build and analyze | |
| runs-on: windows-latest | |
| steps: | |
| - name: Set up JDK 21 | |
| uses: actions/setup-java@c1e323688fd81a25caa38c78aa6df2d33d3e20d9 # v4.8.0 | |
| with: | |
| java-version: 21 | |
| distribution: "zulu" # Alternative distribution options are available. | |
| - uses: actions/checkout@34e114876b0b11c390a56381ad16ebd13914f8d5 # v4.3.1 | |
| with: | |
| fetch-depth: 0 # Shallow clones should be disabled for a better relevancy of analysis | |
| - name: Set up .NET SDK | |
| uses: actions/setup-dotnet@2016bd2012dba4e32de620c46fe006a3ac9f0602 # v5.0.1 | |
| with: | |
| dotnet-version: 10.0.401 | |
| - name: Cache SonarQube Cloud packages | |
| uses: actions/cache@0057852bfaa89a56745cba8c7296529d2fc39830 # v4.3.0 | |
| with: | |
| path: ~\sonar\cache | |
| key: ${{ runner.os }}-sonar | |
| restore-keys: ${{ runner.os }}-sonar | |
| - name: Cache SonarQube Cloud scanner | |
| id: cache-sonar-scanner | |
| uses: actions/cache@0057852bfaa89a56745cba8c7296529d2fc39830 # v4.3.0 | |
| with: | |
| path: ${{ runner.temp }}\scanner | |
| key: ${{ runner.os }}-sonar-scanner | |
| restore-keys: ${{ runner.os }}-sonar-scanner | |
| - name: Install SonarQube Cloud scanner | |
| shell: powershell | |
| run: | | |
| $scannerPath = Join-Path $env:RUNNER_TEMP 'scanner' | |
| $scannerExecutable = Join-Path $scannerPath 'dotnet-sonarscanner.exe' | |
| New-Item -Path $scannerPath -ItemType Directory -Force | Out-Null | |
| if (-not (Test-Path $scannerExecutable)) { | |
| dotnet tool update dotnet-sonarscanner --tool-path $scannerPath | |
| } | |
| - name: Build and analyze | |
| env: | |
| SONAR_TOKEN: ${{ secrets.SONAR_TOKEN }} | |
| shell: powershell | |
| run: | | |
| ${{ runner.temp }}\scanner\dotnet-sonarscanner begin /k:"CheatEngineNet_CheatEngine.Client" /o:"cheatenginenet" /d:sonar.token="${{ secrets.SONAR_TOKEN }}" | |
| dotnet build | |
| ${{ runner.temp }}\scanner\dotnet-sonarscanner end /d:sonar.token="${{ secrets.SONAR_TOKEN }}" |