-
Notifications
You must be signed in to change notification settings - Fork 47
/
appveyor.yml
73 lines (63 loc) · 3.09 KB
/
appveyor.yml
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
image: ubuntu
platform: Any CPU
environment:
version: ${APPVEYOR_BUILD_VERSION}
install:
# Download codacy test report
- sh: curl -L https://github.com/codacy/codacy-coverage-reporter/releases/download/4.0.5/codacy-coverage-reporter-4.0.5-assembly.jar > ./codacy-test-reporter.jar
- sh: chmod +x ./codacy-test-reporter.jar
# Download codeclimate test report
- sh: curl -L https://codeclimate.com/downloads/test-reporter/test-reporter-latest-linux-amd64 > ./codeclimate-test-reporter
- sh: chmod +x ./codeclimate-test-reporter
# Download sonarqube scanner / report
- sh: dotnet tool install --global dotnet-sonarscanner
# Install tools for generate
- sh: dotnet tool install --global coverlet.console
- sh: dotnet add JsonMasking.Tests/JsonMasking.Tests.csproj package coverlet.msbuild
- sh: dotnet restore
configuration:
- Release
dotnet_csproj:
patch: true
file: '**\*.csproj'
version: '${version}'
package_version: '${version}'
assembly_version: '${version}'
file_version: '${version}'
informational_version: '${version}'
before_build:
- sh: dotnet build-server shutdown
# Setup sonarqube
- sh: dotnet sonarscanner begin /o:thiagobarradas-github /k:ThiagoBarradas_jsonmasking /v:${version} /d:sonar.host.url=https://sonarcloud.io /d:sonar.login=${SONARQUBE_TOKEN} /d:sonar.cs.opencover.reportsPaths="opencover.xml"
build:
project: JsonMasking.sln
test_script:
# Run test and generate result with opencover, cobertura and lcov format
- sh: dotnet test /p:CollectCoverage=true /p:CoverletOutputFormat=opencover /p:CoverletOutput=coverage /p:Exclude=[xunit.*]* JsonMasking.sln
- sh: mv ./JsonMasking.Tests/coverage.opencover.xml opencover.xml
- sh: dotnet test /p:CollectCoverage=true /p:CoverletOutputFormat=cobertura /p:CoverletOutput=coverage /p:Exclude=[xunit.*]* JsonMasking.sln
- sh: mv ./JsonMasking.Tests/coverage.cobertura.xml cobertura.xml
- sh: dotnet test /p:CollectCoverage=true /p:CoverletOutputFormat=lcov /p:CoverletOutput=coverage /p:Exclude=[xunit.*]* JsonMasking.sln
- sh: mkdir coverage
- sh: mv ./JsonMasking.Tests/coverage.info coverage/lcov.info
after_test:
# Send test result to codecov
- sh: bash <(curl -s https://codecov.io/bash) -f opencover.xml -t ${CODECOV_TOKEN}
# Send test result to codeclimate
- sh: ./codeclimate-test-reporter before-build
- sh: ./codeclimate-test-reporter after-build -t lcov -r ${CC_TEST_REPORTER_ID} -p /home/appveyor/projects/newtonsoft-extensions-jsonmasking/ --exit-code $?
# Send test result to codacy
- sh: java -jar ./codacy-test-reporter.jar report -l CSharp -t ${CODACY_PROJECT_TOKEN} -r cobertura.xml
# Send test result to sonarqube
- sh: dotnet sonarscanner end /d:sonar.login=${SONARQUBE_TOKEN}
# Pack to nuget
- dotnet pack --configuration Release /p:Version=${version}
artifacts:
- path: JsonMasking/bin/Release/netstandard2.0/JsonMasking.dll
name: JsonMasking.dll
- path: JsonMasking/bin/Release/JsonMasking.${version}.nupkg
name: JsonMasking.${version}.nupkg
#deploy:
# provider: NuGet
# api_key:
# secure: csyDlyeSjDmdYAQ/PK0GYNZ4ofK/yC6vd5ZLPnG2TgujmrAW7fUiQxjDVOWD4XAX