PR Build Refactor 2 (#1137)

* Only resolve dependencies and plugins in the first stage

* Switch back to maven install task

but hopefully with cached maven repo

* try switching codecov to informational

* Use proper skipStaging config

---------

Co-authored-by: dotasek <david.otasek@smilecdr.com>
This commit is contained in:
dotasek 2023-02-24 22:11:43 -05:00 committed by GitHub
parent 76c01a98aa
commit d2dc479a23
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23
4 changed files with 37 additions and 31 deletions

8
codecov.yml Normal file
View File

@ -0,0 +1,8 @@
coverage:
status:
project:
default:
informational: true
patch:
default:
informational: true

View File

@ -90,7 +90,7 @@
<groupId>org.sonatype.plugins</groupId> <groupId>org.sonatype.plugins</groupId>
<artifactId>nexus-staging-maven-plugin</artifactId> <artifactId>nexus-staging-maven-plugin</artifactId>
<configuration> <configuration>
<skip>true</skip> <skipStaging>true</skipStaging>
</configuration> </configuration>
</plugin> </plugin>
<plugin> <plugin>

View File

@ -19,18 +19,30 @@ jobs:
inputs: inputs:
key: maven | $(Build.BuildId) key: maven | $(Build.BuildId)
path: $(MAVEN_CACHE_FOLDER) path: $(MAVEN_CACHE_FOLDER)
# Runs 'mvn test' # Runs 'mvn install'
- task: Maven@3 - task: Maven@3
inputs: inputs:
mavenPomFile: 'pom.xml' mavenPomFile: 'pom.xml'
options: '-pl "!org.hl7.fhir.validation.cli" -Dmaven.repo.local=$(MAVEN_CACHE_FOLDER)' options: '-Dmaven.repo.local=$(MAVEN_CACHE_FOLDER)'
mavenOptions: '-Xmx3072m' mavenOptions: '-Xmx3072m'
javaHomeOption: 'JDKVersion' javaHomeOption: 'JDKVersion'
jdkVersionOption: '${{image.jdkVersion}}' jdkVersionOption: '${{image.jdkVersion}}'
jdkArchitectureOption: 'x64' jdkArchitectureOption: 'x64'
publishJUnitResults: true publishJUnitResults: true
testResultsFiles: '**/surefire-reports/TEST-*.xml' testResultsFiles: '**/surefire-reports/TEST-*.xml'
goals: 'test' goals: 'install'
- task: Maven@3
inputs:
mavenPomFile: 'pom.xml'
mavenOptions: '-Xmx3072m'
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 # Upload test results to codecov
- script: bash <(curl https://codecov.io/bash) -t $(codecov) - script: bash <(curl https://codecov.io/bash) -t $(codecov)
@ -46,27 +58,3 @@ jobs:
summaryFileLocation: '$(System.DefaultWorkingDirectory)/org.hl7.fhir.report/target/site/jacoco-aggregate/jacoco.xml' summaryFileLocation: '$(System.DefaultWorkingDirectory)/org.hl7.fhir.report/target/site/jacoco-aggregate/jacoco.xml'
reportDirectory: '$(System.DefaultWorkingDirectory)/org.hl7.fhir.report/target/site/jacoco-aggregate/' reportDirectory: '$(System.DefaultWorkingDirectory)/org.hl7.fhir.report/target/site/jacoco-aggregate/'
# Builds the CLI jar
- task: Maven@3
inputs:
mavenPomFile: 'pom.xml'
mavenOptions: '-Xmx3072m'
javaHomeOption: 'JDKVersion'
jdkVersionOption: '${{image.jdkVersion}}'
jdkArchitectureOption: 'x64'
options: '-pl org.hl7.fhir.validation.cli -Dmaven.repo.local=$(MAVEN_CACHE_FOLDER)'
publishJUnitResults: false
goals: 'install'
# Executes the CLI jar
- task: Maven@3
inputs:
mavenPomFile: 'pom.xml'
mavenOptions: '-Xmx3072m'
javaHomeOption: 'JDKVersion'
jdkVersionOption: '${{image.jdkVersion}}'
jdkArchitectureOption: 'x64'
options: '-pl org.hl7.fhir.validation.cli -Dmaven.repo.local=$(MAVEN_CACHE_FOLDER)'
publishJUnitResults: false
goals: 'exec:exec'

View File

@ -11,7 +11,7 @@ pr:
# Azure doesn't always have the same Java versions on each system, so they are enumerated for each system independently. # Azure doesn't always have the same Java versions on each system, so they are enumerated for each system independently.
jobs: jobs:
- job: setup - job: setup
displayName: setup-and-cache-build displayName: cache-maven-dependencies
pool: pool:
vmImage: ubuntu-latest vmImage: ubuntu-latest
steps: steps:
@ -28,13 +28,23 @@ jobs:
- task: Maven@3 - task: Maven@3
inputs: inputs:
mavenPomFile: 'pom.xml' mavenPomFile: 'pom.xml'
options: '-Dmaven.repo.local=$(MAVEN_CACHE_FOLDER)'
mavenOptions: '-Xmx3072m' mavenOptions: '-Xmx3072m'
options: '-pl "!org.hl7.fhir.validation.cli" -DskipTests -Dmaven.repo.local=$(MAVEN_CACHE_FOLDER)'
javaHomeOption: 'JDKVersion' javaHomeOption: 'JDKVersion'
jdkVersionOption: '1.11' jdkVersionOption: '1.11'
jdkArchitectureOption: 'x64' jdkArchitectureOption: 'x64'
publishJUnitResults: false publishJUnitResults: false
goals: 'install' goals: 'dependency:resolve'
- task: Maven@3
inputs:
mavenPomFile: 'pom.xml'
options: '-Dmaven.repo.local=$(MAVEN_CACHE_FOLDER)'
mavenOptions: '-Xmx3072m'
javaHomeOption: 'JDKVersion'
jdkVersionOption: '1.11'
jdkArchitectureOption: 'x64'
publishJUnitResults: false
goals: 'dependency:resolve-plugins'
- template: pull-request-pipeline-parameterized.yml - template: pull-request-pipeline-parameterized.yml
parameters: parameters:
images: images: