-
Notifications
You must be signed in to change notification settings - Fork 165
/
test-unit-jobs-template.yml
57 lines (53 loc) · 2.26 KB
/
test-unit-jobs-template.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
jobs:
- ${{ each unit in parameters.testUnits }}:
- ${{ each value in unit.modules }}:
- job: ${{unit.name}}_${{value}}
dependsOn: [ 'setup' ]
displayName: Test ${{value}} on ${{unit.name}}
pool:
vmImage: ${{unit.vmImage}}
variables:
JAVA_TOOL_OPTIONS: ${{unit.javaToolOptions}}
skipJaCoCo: $[eq(${{unit.skipJaCoCo}}, true)]
steps:
- task: Cache@2
displayName: Cache maven artifacts
inputs:
key: maven | $(Build.BuildId) | artifacts
path: $(MAVEN_CACHE_FOLDER)
- template: cache-target-tasks-template.yml
parameters:
modules:
- org.hl7.fhir.${{ value }}
# Runs 'mvn install'
- task: Maven@4
inputs:
mavenPomFile: 'pom.xml'
options: '-Dmaven.repo.local=$(MAVEN_CACHE_FOLDER) -pl org.hl7.fhir.${{value}} -Djacoco.skip=${{unit.skipJaCoCo}} -P JACOCO'
mavenOptions: '-Xmx768m -Dmaven.resolver.transport=wagon'
javaHomeOption: 'JDKVersion'
jdkVersionOption: '${{unit.jdkVersion}}'
jdkArchitectureOption: 'x64'
publishJUnitResults: true
testResultsFiles: '**/surefire-reports/TEST-*.xml'
goals: 'verify jacoco:report'
- task: CopyFiles@2
condition: eq(variables.skipJaCoCo, false)
inputs:
sourceFolder: '$(System.DefaultWorkingDirectory)/'
contents: '**/target/*-reports/*.txt'
targetFolder: '$(Build.ArtifactStagingDirectory)'
- task: PublishPipelineArtifact@1
displayName: 'Publish Full Test Output'
condition: eq(variables.skipJaCoCo, false)
inputs:
targetPath: '$(Build.ArtifactStagingDirectory)/'
artifactName: '${{value}}_full_logs_$(Build.BuildId)_$(Build.BuildNumber)_$(System.JobId).zip'
- task: PublishBuildArtifacts@1
displayName: 'Publish generated build files'
condition: eq(variables.skipJaCoCo, false)
continueOnError: true
inputs:
pathToPublish: '$(System.DefaultWorkingDirectory)/org.hl7.fhir.${{ value }}/target/'
parallel: true
artifactName: 'org.hl7.fhir.${{ value }}_target'