Files
HtmlSanitizer/appveyor.yml
Michael Ganss e003e9fa9e Fix sonarcloud call
Use environment variables and property function in .csproj
2019-03-31 20:17:01 +02:00

40 lines
1.8 KiB
YAML

version: 4.0.{build}
skip_tags: true
image: Visual Studio 2017
environment:
access_token:
secure: Eq6BjtZ80BXKLwFMg76IjuQAvbLjbojIF/X/ARouGVhxPneJtgDfCXMPNgJ7KBKq
sonar_token:
secure: W7pHKhuTW6Lh8WlXJNTOIaOzeuxLi+H6Nqmnm4pr28jM6jyIpOZ+1r10lIQi0eCA
nuget:
disable_publish_on_pr: true
build_script:
- dotnet restore
- dotnet pack --include-symbols --include-source -c Release src\HtmlSanitizer
test_script:
- ps: |
if (-not $env:APPVEYOR_PULL_REQUEST_NUMBER) {
dotnet tool install --global dotnet-sonarscanner
dotnet sonarscanner begin /k:"mganss_HtmlSanitizer" /v:$env:APPVEYOR_BUILD_VERSION /o:"mganss-github" /d:sonar.host.url="https://sonarcloud.io" /d:sonar.login="$env:sonar_token" /d:sonar.cs.opencover.reportsPaths="$($env:APPVEYOR_BUILD_FOLDER)\coverage.xml" /d:sonar.coverage.exclusions="**/Program.cs"
dotnet build
}
- dotnet test /p:CollectCoverage=true /p:CoverletOutputFormat=opencover /p:CoverletOutput="..\..\coverage.xml" test\HtmlSanitizer.Tests\HtmlSanitizer.Tests.csproj -f netcoreapp2.0
- ps: |
if (-not $env:APPVEYOR_PULL_REQUEST_NUMBER) {
dotnet sonarscanner end /d:sonar.login="$env:sonar_token"
}
- "SET PATH=C:\\Python34;C:\\Python34\\Scripts;%PATH%"
- pip install codecov
- codecov -f "coverage.xml"
artifacts:
- path: 'src\**\*.nupkg'
on_success:
- ps: |
if (-not $env:APPVEYOR_PULL_REQUEST_NUMBER) {
git config --global credential.helper store
Add-Content "$HOME\.git-credentials" "https://$($env:access_token):x-oauth-basic@github.com`n"
git config --global user.email "michael@ganss.org"
git config --global user.name "Michael Ganss"
git tag v$env:APPVEYOR_BUILD_VERSION
git push origin --tags --porcelain
}