Skip to content

Switch to net8 runtime #852

Switch to net8 runtime

Switch to net8 runtime #852

Workflow file for this run

name: continous integration
on:
push:
branches:
- main
create:
tags:
- '*'
pull_request:
pull_request_target:
jobs:
build:
name: build
runs-on: windows-latest
steps:
- uses: actions/checkout@v3
- run: |
git fetch --prune --unshallow
- name: Set up JDK
uses: actions/setup-java@v1
with:
java-version: 11
- name: Setup .NET Core
uses: actions/setup-dotnet@v3
with:
dotnet-version: 8.0.x
- name: Setup SonarScanner
run: choco install "sonarscanner-msbuild-net46" -y
- name: Patch version info
run: .\PatchVersion.ps1
shell: pwsh
env:
GITHUB_PR_REF: ${{ github.head_ref }}
- name: Restore packages
run: dotnet restore --configfile nuget.config --verbosity normal
- name: Publish Release
run: dotnet publish --configuration Release --no-restore
- name: Prepare SonarScanner
env:
SONAR_TOKEN: ${{ secrets.SONAR_TOKEN }}
run: |
$prNo=${{ github.event.number }}
if ($prNo -gt 0) {
$branch="${{ github.HEAD_REF }}"
Write-Host analyzing Pull Request $prNo on branch $branch
$branchCommand="/d:sonar.pullrequest.key=$prNo"
} else {
$branch=$env:GITHUB_REF -replace "(\w+/)*",""
Write-Host analyzing branch $branch
$branchCommand="/d:sonar.branch.name=$branch"
}
Write-Host CMDs=$branchCommand
SonarScanner.MSBuild.exe begin /d:"sonar.host.url=https://sonarcloud.io" /o:lg2de /k:lg2de_SimpleAccounting $branchCommand /d:sonar.login=$env:SONAR_TOKEN /d:sonar.cs.opencover.reportsPaths="tests\**\coverage.opencover.xml"
shell: pwsh
- name: Build Debug and Test
run: dotnet test --configuration Debug --no-restore /p:CollectCoverage=true /p:CoverletOutputFormat=opencover
- name: Complete SonarScanner
run: SonarScanner.MSBuild.exe end /d:sonar.login=${{ secrets.SONAR_TOKEN }}
- name: Upload product artifact
uses: actions/upload-artifact@v1
with:
name: SimpleAccounting
path: src\SimpleAccounting\bin\Release\net6.0-windows\publish
- name: Upload test artifact
uses: actions/upload-artifact@v1
with:
name: CoverReport
path: CoverReport