-
Notifications
You must be signed in to change notification settings - Fork 0
/
azure-pipelines.yml
122 lines (106 loc) · 4.46 KB
/
azure-pipelines.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
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
resources:
repositories:
- repository: XG_Github
type: github
endpoint: TheRealXG
name: therealxg/Calculator
ref: master
pool:
# name: AzureVM
name: Ubuntu 20.10 VM
steps:
- checkout: XG_Github
clean: true
- checkout: git://Hardware Emulation/RTEMS@refs/tags/realview_pbx_a9_qemu_rtems_51
- task: DockerInstaller@0
displayName: 'Install Docker 17.09.0-ce'
- task: Docker@2
displayName: login
inputs:
containerRegistry: dockerhub-realxg
command: login
- script: |
cd $(Build.SourcesDirectory)/Calculator
curl 'https://sonarcloud.io/static/cpp/build-wrapper-linux-x86.zip' --output build-wrapper.zip
unzip -o build-wrapper.zip
curl 'https://binaries.sonarsource.com/Distribution/sonar-scanner-cli/sonar-scanner-cli-4.4.0.2170-linux.zip' --output sonar.zip
unzip -o sonar.zip -d sonar
cd sonar
cd */.
mv * ../
displayName: 'Sonarcloud Build Wrapper and Scanner Setup'
- task: SonarCloudPrepare@1
inputs:
SonarCloud: 'sonar'
organization: 'therealxg'
scannerMode: 'CLI'
configMode: 'manual'
cliProjectKey: 'TheRealXG_Calculator'
cliProjectName: 'Calculator'
cliProjectVersion: '1.1'
cliSources: '.'
extraProperties: |
# Additional properties that will be passed to the scanner,
# Put one key=value per line, example:
# sonar.exclusions=**/*.bin
sonar.cfamily.build-wrapper-output=Calculator/build_wrapper_output_directory
sonar.sourceEncoding=UTF-8
sonar.cfamily.cache.enabled=false
sonar.cfamily.threads=2
sonar.projectBaseDir=$(Build.SourcesDirectory)/Calculator
sonar.tests=test
sonar.cfamily.gcov.reportsPath=gcov/
sonar.cfamily.cppunit.reportsPath=build/artifacts/gcov/
- script: |
docker pull therealxg/azure_pipeline:static_analysis
docker run --user $(id -u):$(id -g) --rm -e SRC_VOL=$(Build.SourcesDirectory)/Calculator -v $(Build.SourcesDirectory)/Calculator:$(Build.SourcesDirectory)/Calculator therealxg/azure_pipeline:static_analysis
displayName: 'Launch Docker Static Analysis Container'
- task: PublishPipelineArtifact@1
displayName: 'Publish Pipeline Artifact - CPPCheck Log'
inputs:
targetPath: '$(Build.SourcesDirectory)/Calculator/cpp_check_log.txt'
artifact: cpp_check_log.txt
condition: succeededOrFailed()
- task: PublishPipelineArtifact@1
displayName: 'Publish Pipeline Artifact - Flawfinder Log'
inputs:
targetPath: '$(Build.SourcesDirectory)/Calculator/flawfinder_log.txt'
artifact: flawfinder_log.txt
condition: succeededOrFailed()
- script: |
docker pull therealxg/azure_pipeline:unity
docker run --user $(id -u):$(id -g) --rm -e SRC_VOL=$(Build.SourcesDirectory)/Calculator -v $(Build.SourcesDirectory)/Calculator:$(Build.SourcesDirectory)/Calculator therealxg/azure_pipeline:unity
displayName: 'Launch Docker Unit Test Container'
- task: PublishPipelineArtifact@1
displayName: 'Publish Pipeline Artifact - Unit Test Results'
inputs:
targetPath: '$(Build.SourcesDirectory)/Calculator/build/artifacts/gcov/report.xml'
artifact: report.xml
condition: succeededOrFailed()
- script: |
docker pull therealxg/azure_pipeline:build_app
docker run --user $(id -u):$(id -g) --rm -e SRC_VOL=$(Build.SourcesDirectory)/Calculator -e RTEMS_PATH=$(Build.SourcesDirectory)/RTEMS -v $(Build.SourcesDirectory)/RTEMS:$(Build.SourcesDirectory)/RTEMS -v $(Build.SourcesDirectory)/Calculator:$(Build.SourcesDirectory)/Calculator therealxg/azure_pipeline:build_app
displayName: 'Launch Docker Build Container'
- task: SonarCloudAnalyze@1
- script: |
docker pull therealxg/azure_pipeline:test_app
docker run --user $(id -u):$(id -g) --rm -e SRC_VOL=$(Build.SourcesDirectory)/Calculator -v $(Build.SourcesDirectory)/Calculator:$(Build.SourcesDirectory)/Calculator therealxg/azure_pipeline:test_app
displayName: 'Launch Docker Test Container'
- task: PublishTestResults@2
displayName: 'Publish Robot Test Results results.xml'
inputs:
testResultsFiles: results.xml
searchFolder: '$(Build.SourcesDirectory)/Calculator'
condition: succeededOrFailed()
- task: PublishPipelineArtifact@1
displayName: 'Publish Pipeline Artifact - Robot Report'
inputs:
targetPath: '$(Build.SourcesDirectory)/Calculator/report.html'
artifact: Report.html
condition: succeededOrFailed()
- task: PublishPipelineArtifact@1
displayName: 'Publish Pipeline Artifact - Robot Log'
inputs:
targetPath: '$(Build.SourcesDirectory)/Calculator/log.html'
artifact: log.html
condition: succeededOrFailed()