2022-08-24 12:55:00 -04:00
|
|
|
# HAPI FHIR Build Pipeline
|
|
|
|
|
|
|
|
parameters:
|
|
|
|
param: [ ]
|
|
|
|
|
|
|
|
jobs:
|
|
|
|
- job: setup
|
|
|
|
displayName: setup-and-cache-build
|
|
|
|
timeoutInMinutes: 60
|
2024-01-14 14:15:08 -05:00
|
|
|
container: maven:3.9-eclipse-temurin-21-jammy
|
2022-08-24 12:55:00 -04:00
|
|
|
pool:
|
|
|
|
vmImage: ubuntu-latest
|
|
|
|
steps:
|
2022-09-21 20:08:49 -04:00
|
|
|
- checkout: self
|
|
|
|
fetchDepth: 1
|
2022-08-24 12:55:00 -04:00
|
|
|
- task: Cache@2
|
|
|
|
inputs:
|
2022-08-29 18:55:12 -04:00
|
|
|
key: 'maven | "$(Agent.OS)" | "$(Build.SourceVersion)" | ./pom.xml'
|
2022-08-24 12:55:00 -04:00
|
|
|
path: $(MAVEN_CACHE_FOLDER)
|
|
|
|
- task: Bash@3
|
|
|
|
inputs:
|
|
|
|
targetType: 'inline'
|
|
|
|
script: mkdir -p $(MAVEN_CACHE_FOLDER); pwd; ls -al $(MAVEN_CACHE_FOLDER)
|
|
|
|
- task: Maven@3
|
|
|
|
env:
|
2024-01-14 14:15:08 -05:00
|
|
|
JAVA_HOME_11_X64: /opt/java/openjdk
|
2022-08-24 12:55:00 -04:00
|
|
|
inputs:
|
|
|
|
goals: 'install'
|
|
|
|
# These are Maven CLI options (and show up in the build logs) - "-nsu"=Don't update snapshots. We can remove this when Maven OSS is more healthy
|
2022-11-08 22:18:36 -05:00
|
|
|
options: '-P CI,FASTINSTALL -Dmaven.test.skip -e -B -Dmaven.repo.local=$(MAVEN_CACHE_FOLDER) -Dmaven.javadoc.skip=true -Dmaven.wagon.http.pool=false -Dhttp.keepAlive=false -Dstyle.color=always -Djansi.force=true'
|
2022-08-24 12:55:00 -04:00
|
|
|
# These are JVM options (and don't show up in the build logs)
|
|
|
|
mavenOptions: '-Xmx1024m $(MAVEN_OPTS) -Dorg.slf4j.simpleLogger.showDateTime=true -Dorg.slf4j.simpleLogger.dateTimeFormat=HH:mm:ss,SSS -Duser.timezone=America/Toronto'
|
|
|
|
jdkVersionOption: 1.11
|
|
|
|
- ${{ each p in parameters.modules }}:
|
|
|
|
- job: ${{ p.name }}
|
|
|
|
timeoutInMinutes: 60
|
|
|
|
displayName: ${{ p.name }}
|
|
|
|
dependsOn: [ 'setup' ]
|
2024-01-14 14:15:08 -05:00
|
|
|
container: maven:3.9-eclipse-temurin-21-jammy
|
2022-08-24 12:55:00 -04:00
|
|
|
pool:
|
|
|
|
vmImage: ubuntu-latest
|
|
|
|
steps:
|
2022-09-21 20:08:49 -04:00
|
|
|
- checkout: self
|
|
|
|
fetchDepth: 1
|
2022-08-24 12:55:00 -04:00
|
|
|
- script: echo testing module ${{ p.module }}
|
2022-08-31 22:46:17 -04:00
|
|
|
- script: echo $(SourceBranchName)
|
2022-12-06 18:32:42 -05:00
|
|
|
- task: DockerInstaller@0.209.0
|
2022-08-24 12:55:00 -04:00
|
|
|
displayName: Docker Installer
|
|
|
|
inputs:
|
|
|
|
dockerVersion: 17.09.0-ce
|
|
|
|
releaseType: stable
|
|
|
|
- task: Cache@2
|
|
|
|
inputs:
|
2022-08-29 18:55:12 -04:00
|
|
|
key: 'maven | "$(Agent.OS)" | "$(Build.SourceVersion)" | ./pom.xml'
|
2022-08-24 12:55:00 -04:00
|
|
|
path: $(MAVEN_CACHE_FOLDER)
|
|
|
|
- task: Maven@3
|
|
|
|
env:
|
2024-01-14 14:15:08 -05:00
|
|
|
JAVA_HOME_11_X64: /opt/java/openjdk
|
2022-08-24 12:55:00 -04:00
|
|
|
inputs:
|
|
|
|
mavenPomFile: '$(System.DefaultWorkingDirectory)/pom.xml'
|
2023-05-03 15:51:43 -04:00
|
|
|
goals: 'clean verify jacoco:report -pl ${{ p.module }}'
|
2022-08-24 12:55:00 -04:00
|
|
|
# These are Maven CLI options (and show up in the build logs) - "-nsu"=Don't update snapshots. We can remove this when Maven OSS is more healthy
|
2023-12-11 18:24:40 -05:00
|
|
|
options: '-P JACOCO,CI -e -B -Dmaven.repo.local=$(MAVEN_CACHE_FOLDER) -Dmaven.wagon.http.pool=false -Dhttp.keepAlive=false -Dstyle.color=always -Djansi.force=true'
|
2022-08-24 12:55:00 -04:00
|
|
|
# These are JVM options (and don't show up in the build logs)
|
|
|
|
mavenOptions: '-Xmx1024m $(MAVEN_OPTS) -Dorg.slf4j.simpleLogger.showDateTime=true -Dorg.slf4j.simpleLogger.dateTimeFormat=HH:mm:ss,SSS -Duser.timezone=America/Toronto'
|
|
|
|
jdkVersionOption: 1.11
|
|
|
|
# Copy testing log files and publish to pipeline run on Azure.
|
|
|
|
- task: CopyFiles@2
|
|
|
|
condition: always()
|
|
|
|
inputs:
|
|
|
|
sourceFolder: '$(System.DefaultWorkingDirectory)/'
|
|
|
|
contents: '**/target/*-reports/*.txt'
|
|
|
|
targetFolder: '$(Build.ArtifactStagingDirectory)'
|
|
|
|
- task: PublishPipelineArtifact@1
|
|
|
|
displayName: 'Publish Full Test Output'
|
|
|
|
condition: always()
|
|
|
|
inputs:
|
|
|
|
targetPath: '$(Build.ArtifactStagingDirectory)/'
|
|
|
|
artifactName: '${{p.name}}_full_logs_$(Build.BuildId)_$(Build.BuildNumber)_$(System.JobId).zip'
|
|
|
|
# Publish target directory
|
|
|
|
- task: PublishBuildArtifacts@1
|
|
|
|
displayName: 'Publish generated build files'
|
|
|
|
continueOnError: true
|
|
|
|
inputs:
|
|
|
|
pathToPublish: '$(System.DefaultWorkingDirectory)/${{ p.module }}/target/'
|
|
|
|
parallel: true
|
|
|
|
artifactName: '${{ p.name }}_target'
|
|
|
|
- job:
|
|
|
|
pool:
|
|
|
|
vmImage: ubuntu-latest
|
|
|
|
timeoutInMinutes: 60
|
|
|
|
displayName: generate_test_reports
|
2024-01-14 14:15:08 -05:00
|
|
|
container: maven:3.9-eclipse-temurin-21-jammy
|
2022-08-24 12:55:00 -04:00
|
|
|
dependsOn:
|
|
|
|
- ${{ each p in parameters.modules }}:
|
|
|
|
- ${{ p.name }}
|
|
|
|
steps:
|
2022-09-21 20:08:49 -04:00
|
|
|
- checkout: self
|
|
|
|
fetchDepth: 1
|
2022-08-24 12:55:00 -04:00
|
|
|
- ${{ each p in parameters.modules }}:
|
|
|
|
- task: Bash@3
|
|
|
|
inputs:
|
|
|
|
targetType: 'inline'
|
|
|
|
script: mkdir -p $(System.DefaultWorkingDirectory)/${{ p.module }}/target/
|
|
|
|
- task: DownloadBuildArtifacts@0
|
|
|
|
displayName: 'Download jacoco test coverage result exec file for ${{ p.name }}'
|
|
|
|
continueOnError: true
|
|
|
|
inputs:
|
|
|
|
buildType: 'current'
|
|
|
|
downloadType: 'single'
|
|
|
|
artifactName: '${{ p.name }}_target'
|
|
|
|
downloadPath: '$(System.DefaultWorkingDirectory)/'
|
|
|
|
# Copy contents from downloaded artifact directory to final target directory.
|
|
|
|
- task: CopyFiles@2
|
|
|
|
condition: always()
|
|
|
|
inputs:
|
|
|
|
sourceFolder: '$(System.DefaultWorkingDirectory)/${{ p.name }}_target/'
|
|
|
|
contents: '**'
|
|
|
|
targetFolder: '$(System.DefaultWorkingDirectory)/${{ p.module }}/target/'
|
|
|
|
- task: Maven@3
|
|
|
|
env:
|
2024-01-14 14:15:08 -05:00
|
|
|
JAVA_HOME_11_X64: /opt/java/openjdk
|
2022-08-24 12:55:00 -04:00
|
|
|
inputs:
|
|
|
|
mavenPomFile: '$(System.DefaultWorkingDirectory)/pom.xml'
|
|
|
|
goals: 'jacoco:report-aggregate'
|
|
|
|
# These are Maven CLI options (and show up in the build logs) - "-nsu"=Don't update snapshots. We can remove this when Maven OSS is more healthy
|
2022-11-02 15:34:27 -04:00
|
|
|
options: '-P JACOCO'
|
2022-08-24 12:55:00 -04:00
|
|
|
# These are JVM options (and don't show up in the build logs)
|
|
|
|
mavenOptions: '-Xmx1024m $(MAVEN_OPTS) -Dorg.slf4j.simpleLogger.showDateTime=true -Dorg.slf4j.simpleLogger.dateTimeFormat=HH:mm:ss,SSS -Duser.timezone=America/Toronto'
|
|
|
|
jdkVersionOption: 1.11
|
|
|
|
- bash: |
|
|
|
|
curl -Os https://uploader.codecov.io/latest/linux/codecov
|
|
|
|
chmod +x codecov
|
|
|
|
./codecov -t $(CODECOV_TOKEN) -R hapi-fhir-jacoco/target/site/jacoco-aggregate/
|
|
|
|
displayName: 'codecov'
|
|
|
|
- task: PublishTestResults@2
|
|
|
|
inputs:
|
|
|
|
testResultsFormat: 'JUnit'
|
|
|
|
testResultsFiles: '**/TEST-*.xml'
|
|
|
|
- task: PublishCodeCoverageResults@1
|
|
|
|
inputs:
|
|
|
|
codeCoverageTool: 'JaCoCo'
|
|
|
|
summaryFileLocation: $(System.DefaultWorkingDirectory)/hapi-fhir-jacoco/target/site/jacoco-aggregate/jacoco.xml
|
|
|
|
reportDirectory: $(System.DefaultWorkingDirectory)/hapi-fhir-jacoco/target/site/jacoco-report/
|
|
|
|
failIfCoverageEmpty: true
|