62 lines
2.4 KiB
YAML
62 lines
2.4 KiB
YAML
jobs:
|
|
- ${{ each image in parameters.images }}:
|
|
- job:
|
|
dependsOn: [ 'setup' ]
|
|
displayName: ${{image.displayName}}
|
|
|
|
pool:
|
|
vmImage: ${{image.vmImage}}
|
|
|
|
variables:
|
|
currentImage: ${{image.vmImage}}
|
|
currentName: ${{image.displayName}}
|
|
codecov: $(CODECOV_TOKEN)
|
|
VERSION:
|
|
JAVA_TOOL_OPTIONS: ${{image.javaToolOptions}}
|
|
skipJaCoCo: $[not(eq(variables['currentName'], 'ubuntu-latest-java-11'))]
|
|
|
|
steps:
|
|
- task: Cache@2
|
|
inputs:
|
|
key: maven | $(Build.BuildId)
|
|
path: $(MAVEN_CACHE_FOLDER)
|
|
# Runs 'mvn install'
|
|
- task: Maven@3
|
|
inputs:
|
|
mavenPomFile: 'pom.xml'
|
|
options: '-Dmaven.repo.local=$(MAVEN_CACHE_FOLDER) -Djacoco.skip=$(skipJaCoCo)'
|
|
mavenOptions: '-Xmx768m -Dmaven.resolver.transport=wagon'
|
|
javaHomeOption: 'JDKVersion'
|
|
jdkVersionOption: '${{image.jdkVersion}}'
|
|
jdkArchitectureOption: 'x64'
|
|
publishJUnitResults: true
|
|
testResultsFiles: '**/surefire-reports/TEST-*.xml'
|
|
goals: 'install'
|
|
|
|
- task: Maven@3
|
|
inputs:
|
|
mavenPomFile: 'pom.xml'
|
|
mavenOptions: '-Xmx768m -Dmaven.resolver.transport=wagon'
|
|
javaHomeOption: 'JDKVersion'
|
|
jdkVersionOption: '${{image.jdkVersion}}'
|
|
jdkArchitectureOption: 'x64'
|
|
options: '-pl org.hl7.fhir.validation.cli -Dmaven.repo.local=$(MAVEN_CACHE_FOLDER)'
|
|
publishJUnitResults: false
|
|
testResultsFiles: '**/surefire-reports/TEST-*.xml'
|
|
goals: 'exec:exec'
|
|
|
|
# Upload test results to codecov
|
|
- script: bash <(curl https://codecov.io/bash) -t $(codecov)
|
|
displayName: 'codecov Bash Uploader'
|
|
condition: eq(variables.skipJaCoCo, false)
|
|
|
|
# Publishes the test results to build artifacts.
|
|
- task: PublishCodeCoverageResults@1
|
|
displayName: 'Publish JaCoCo test results'
|
|
condition: eq(variables.skipJaCoCo, false)
|
|
inputs:
|
|
codeCoverageTool: 'JaCoCo'
|
|
summaryFileLocation: '$(System.DefaultWorkingDirectory)/org.hl7.fhir.report/target/site/jacoco-aggregate/jacoco.xml'
|
|
reportDirectory: '$(System.DefaultWorkingDirectory)/org.hl7.fhir.report/target/site/jacoco-aggregate/'
|
|
|