Skip to content

Upgrade the SDK to .NET 8. (#36) #22

Upgrade the SDK to .NET 8. (#36)

Upgrade the SDK to .NET 8. (#36) #22

Workflow file for this run

name: CI
on:
push:
branches:
- master
pull_request:
types: [opened, synchronize, reopened]
jobs:
build:
name: Build and analyze
runs-on: windows-latest
env:
Solution_Name: PocketClient.sln
Package_Name: PocketClient_Desktop
Configuration: Debug
Platform: x64
steps:
- name: Set up JDK 11
uses: actions/setup-java@v4
with:
distribution: 'adopt'
java-version: '17'
- uses: actions/checkout@v2
with:
fetch-depth: 0 # Shallow clones should be disabled for a better relevancy of analysis
- name: Install .NET Core
uses: actions/setup-dotnet@v3
with:
dotnet-version: 8.0.x
# Add MSBuild to the PATH: https://github.com/microsoft/setup-msbuild
- name: Setup MSBuild.exe
uses: microsoft/setup-msbuild@v1.3
- name: Setup dotnet format
run: dotnet tool install -g dotnet-format --version "8.*" --add-source https://pkgs.dev.azure.com/dnceng/public/_packaging/dotnet8/nuget/v3/index.json
- name: Cache SonarCloud packages
uses: actions/cache@v1
with:
path: ~\sonar\cache
key: ${{ runner.os }}-sonar
restore-keys: ${{ runner.os }}-sonar
- name: Restore the application
run: msbuild $env:Solution_Name /t:Restore /p:Configuration=$env:Configuration
- name: Code format check
run: dotnet format --verify-no-changes --exclude 'PocketClient.Core/Data/Migrations/*.cs' --folder --verbosity n
- name: Cache SonarCloud scanner
id: cache-sonar-scanner
uses: actions/cache@v1
with:
path: .\.sonar\scanner
key: ${{ runner.os }}-sonar-scanner
restore-keys: ${{ runner.os }}-sonar-scanner
- name: Install SonarCloud scanner
if: steps.cache-sonar-scanner.outputs.cache-hit != 'true'
shell: powershell
run: |
New-Item -Path .\.sonar\scanner -ItemType Directory
dotnet tool update dotnet-sonarscanner --tool-path .\.sonar\scanner
- name: Build and analyze
env:
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }} # Needed to get PR information, if any
SONAR_TOKEN: ${{ secrets.SONAR_TOKEN }}
shell: powershell
run: |
.\.sonar\scanner\dotnet-sonarscanner begin /k:"nodew_PocketDesktop" /o:"nodew" /d:sonar.login="${{ secrets.SONAR_TOKEN }}" /d:sonar.host.url="https://sonarcloud.io"
msbuild $env:Solution_Name /t:${env:Package_Name}:Publish /p:Configuration=$env:Configuration /p:Platform=$env:Platform /p:GenerateAppxPackageOnBuild=false
.\.sonar\scanner\dotnet-sonarscanner end /d:sonar.login="${{ secrets.SONAR_TOKEN }}"