forked from SonarOpenCommunity/sonar-cxx
-
Notifications
You must be signed in to change notification settings - Fork 0
/
appveyor.yml
84 lines (81 loc) · 4.38 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
74
75
76
77
78
79
80
81
82
83
84
version: '{build}'
environment:
sonarcloudtoken:
secure: bgbOr1N/vifD4OUSNVw5iiKl5D0a//xmIBVfEo+zqpDmSTCDWtmFV7Zsa2E5yMJ3
githubtoken:
secure: D941HSXMeDkUayK4Kj1mx3dwbTG9XTJLAwiOZj+36ikNzg7u98RsmuGCnYnyP8SL
install:
- ps: |
Add-Type -AssemblyName System.IO.Compression.FileSystem
if ((Test-Path -Path "C:\maven" )) {
Remove-Item -Recurse -Force "C:\maven"
}
(new-object System.Net.WebClient).DownloadFile(
'http://www.us.apache.org/dist/maven/maven-3/3.2.5/binaries/apache-maven-3.2.5-bin.zip',
'C:\maven-bin.zip'
)
[System.IO.Compression.ZipFile]::ExtractToDirectory("C:\maven-bin.zip", "C:\maven")
if (!(Test-Path -Path "C:\sonar-scanner" )) {
(new-object System.Net.WebClient).DownloadFile(
'https://sonarsource.bintray.com/Distribution/sonar-scanner-cli/sonar-scanner-cli-3.0.3.778.zip',
'C:\sonar-scanner-dist.zip'
)
[System.IO.Compression.ZipFile]::ExtractToDirectory("C:\sonar-scanner-dist.zip", "C:\sonar-scanner")
}
if (!(Test-Path -Path "C:\sonarqube" )) {
(new-object System.Net.WebClient).DownloadFile(
'https://sonarsource.bintray.com/Distribution/sonarqube/sonarqube-6.7.2.zip',
'C:\sonarqube-6.7.2.zip'
)
[System.IO.Compression.ZipFile]::ExtractToDirectory("C:\sonarqube-6.7.2.zip", "C:\sonarqube")
}
- ps: |
If ($env:Platform -Match "x86") {
$env:PCRE_PLATFORM="Win32"
$env:JAVA_HOME="c:/Program Files (x86)/Java/jdk1.8.0"
$env:MSBuildDir="C:/Program Files (x86)/MSBuild/14.0/Bin/msbuild.exe"
$env:VCVARS_PLATFORM="x86"
$env:LANG_PLATFORM=""
} Else {
$env:PCRE_PLATFORM="x64"
$env:JAVA_HOME="c:/Program Files/Java/jdk1.8.0"
$env:MSBuildDir="C:/Program Files/MSBuild/14.0/Bin/msbuild.exe"
$env:VCVARS_PLATFORM="amd64"
$env:LANG_PLATFORM="-x64"
}
- cmd: SET
- cmd: SET PATH=C:\maven\apache-maven-3.2.5\bin;%JAVA_HOME%\bin;C:\sonar-scanner\sonar-scanner-3.0.3.778\bin;%PATH%
- cmd: SET M2_HOME=C:\maven\apache-maven-3.2.5
- cmd: SET MAVEN_HOME=C:\maven\apache-maven-3.2.5
- cmd: SET SONARHOME=C:\sonarqube\sonarqube-6.7.2
- cmd: SET TestDataFolder=C:\projects\sonar-cxx\integration-tests\testdata
- cmd: SET
build_script:
- dir
- echo on
- echo %APPVEYOR_PULL_REQUEST_NUMBER%
# SONAR-7154 : workaround
- mkdir C:\WINDOWS\system32\config\systemprofile\AppData\Local\Temp
- cd C:\WINDOWS\system32\config\systemprofile\AppData\Local\
- dir
- cd C:\projects\sonar-cxx
- dir
- C:\Python27\Scripts\pip.exe install requests
- C:\Python27\Scripts\pip.exe install behave
- C:\Python27\Scripts\pip.exe install colorama
- mvn org.jacoco:jacoco-maven-plugin:prepare-agent clean install -B -e -V -Pcoverage-per-test
- IF "%APPVEYOR_PULL_REQUEST_NUMBER%"=="" (mvn sonar:sonar -B -e -V -Dsonar.organization=sonaropencommunity -Dsonar.host.url=https://sonarcloud.io -Dsonar.login=%sonarcloudtoken%)
- REM IF NOT "%APPVEYOR_PULL_REQUEST_NUMBER%"=="" (mvn sonar:sonar -B -e -X -V -Dsonar.verbose=true -Dsonar.analysis.buildNumber=%APPVEYOR_BUILD_NUMBER% -Dsonar.analysis.pipeline=%APPVEYOR_BUILD_NUMBER% -Dsonar.analysis.sha1=%APPVEYOR_REPO_COMMIT% -Dsonar.analysis.repository=%APPVEYOR_REPO_NAME% -Dsonar.analysis.mode=issues -Dsonar.github.pullRequest=%APPVEYOR_PULL_REQUEST_NUMBER% -Dsonar.github.repository=%APPVEYOR_REPO_NAME% -Dsonar.github.oauth=%githubtoken% -Dsonar.host.url=https://sonarcloud.io -Dsonar.login=%sonarcloudtoken%)
- C:\Python27\Scripts\behave.exe --no-capture --tags=SqApi67
cache:
- C:\Users\appveyor\.m2
artifacts:
- path: 'sonar-cxx-plugin\target\*.jar'
- path: 'sonar-c-plugin\target\*.jar'
- path: 'sslr-cxx-toolkit\target\*.jar'
on_failure:
- ps: Get-ChildItem cxx-squid\target\surefire-reports\*.txt | % { Push-AppveyorArtifact $_.FullName -FileName $_.Name }
- ps: Get-ChildItem cxx-checks\target\surefire-reports\*.txt | % { Push-AppveyorArtifact $_.FullName -FileName $_.Name }
- ps: Get-ChildItem sonar-cxx-plugin\target\surefire-reports\*.txt | % { Push-AppveyorArtifact $_.FullName -FileName $_.Name }
- ps: Get-ChildItem *.log | % { Push-AppveyorArtifact $_.FullName -FileName $_.Name }
- ps: Get-ChildItem C:\sonarqube\sonarqube-6.7.2\logs\* | % { Push-AppveyorArtifact $_.FullName -FileName $_.Name }