|
1 | 1 | version: '{branch}-{build}' |
2 | | -image: Visual Studio 2017 |
| 2 | + |
| 3 | +environment: |
| 4 | + matrix: |
| 5 | + - APPVEYOR_BUILD_WORKER_IMAGE: Visual Studio 2022 |
| 6 | + JAVA_HOME: C:\Program Files\Java\jdk17 |
| 7 | + - APPVEYOR_BUILD_WORKER_IMAGE: Ubuntu |
| 8 | + JAVA_HOME: /usr/lib/jvm/jdk15 |
| 9 | + |
| 10 | +# A note/reminder for readers: Script items prefixed "cmd:" are executed on Windows-only environments. |
| 11 | +# Items with no prefix are run on all environments (Windows & Linux) |
3 | 12 |
|
4 | 13 | init: |
5 | 14 | - cmd: git config --global core.autocrlf true |
6 | 15 |
|
7 | 16 | install: |
8 | | - - cmd: git submodule update --init --recursive |
9 | 17 | - cmd: dotnet tool install --global dotnet-sonarscanner |
10 | 18 |
|
11 | 19 | before_build: |
12 | | - - cmd: dotnet --version |
13 | | - - cmd: dotnet restore --verbosity m |
14 | | - - cmd: dotnet-sonarscanner begin /k:"CSF.Validation" /v:AppVeyor_build_%APPVEYOR_BUILD_NUMBER% /o:craigfowler-github /d:sonar.host.url="https://sonarcloud.io" /d:sonar.login=%SONARCLOUD_SECRET_KEY% /d:sonar.cs.nunit.reportsPaths=%APPVEYOR_BUILD_FOLDER%\CSF.Validation.Tests\TestResults\TestResults.xml /d:sonar.cs.opencover.reportsPaths=%APPVEYOR_BUILD_FOLDER%\CSF.Validation.Tests\TestResults\coverage.opencover.xml |
| 20 | + - dotnet --version |
| 21 | + - dotnet restore --verbosity m |
| 22 | + - cmd: > |
| 23 | + IF NOT DEFINED APPVEYOR_PULL_REQUEST_HEAD_REPO_BRANCH (SET BranchName=%APPVEYOR_REPO_BRANCH%) |
| 24 | + ELSE (SET BranchName=%APPVEYOR_PULL_REQUEST_HEAD_REPO_BRANCH%) |
| 25 | + - cmd: > |
| 26 | + dotnet-sonarscanner begin |
| 27 | + /k:"CSF.Validation" |
| 28 | + /v:AppVeyor_build_%APPVEYOR_BUILD_NUMBER% |
| 29 | + /o:craigfowler-github |
| 30 | + /d:sonar.host.url="https://sonarcloud.io" |
| 31 | + /d:sonar.login=%SONARCLOUD_SECRET_KEY% |
| 32 | + /d:sonar.cs.nunit.reportsPaths=%APPVEYOR_BUILD_FOLDER%\CSF.Validation.Tests\TestResults\TestResults.xml |
| 33 | + /d:sonar.cs.opencover.reportsPaths=%APPVEYOR_BUILD_FOLDER%\CSF.Validation.Tests\TestResults\coverage.opencover.xml |
| 34 | + /d:sonar.branch.name=%BranchName% |
| 35 | + /s:%APPVEYOR_BUILD_FOLDER%\.sonarqube-analysisproperties.xml |
15 | 36 |
|
16 | 37 | build_script: |
17 | | - - cmd: dotnet build |
| 38 | + - dotnet build |
18 | 39 |
|
19 | 40 | test_script: |
20 | | - - cmd: dotnet test /p:CollectCoverage=true /p:CoverletOutputFormat=\"json,opencover\" /p:CoverletOutput=\"TestResults/\" --test-adapter-path:. --logger:\"nunit\" |
| 41 | + - > |
| 42 | + dotnet test |
| 43 | + /p:CollectCoverage=true |
| 44 | + /p:CoverletOutputFormat=\"json,opencover\" |
| 45 | + /p:CoverletOutput=\"TestResults/\" |
| 46 | + --test-adapter-path:. |
| 47 | + --logger:\"nunit\" |
21 | 48 |
|
22 | 49 | after_test: |
23 | | - - cmd: dotnet-sonarscanner end /d:"sonar.login=%SONARCLOUD_SECRET_KEY%" |
| 50 | + - cmd: > |
| 51 | + dotnet-sonarscanner end |
| 52 | + /d:"sonar.login=%SONARCLOUD_SECRET_KEY%" |
| 53 | + - ps: if ($isWindows) { Tools\appveyor-publish-docs.ps1 } |
| 54 | + - cmd: Tools\appveyor-create-packages.cmd |
0 commit comments