Skip to content

Commit

Permalink
Update Azure CI to latest vmImage (#56)
Browse files Browse the repository at this point in the history
* Update Azure CI to latest vmImage

Signed-off-by: see-quick <maros.orsak159@gmail.com>

* explicit path to jdk

Signed-off-by: see-quick <maros.orsak159@gmail.com>

* use preinstalled java

Signed-off-by: see-quick <maros.orsak159@gmail.com>

* correct path

Signed-off-by: see-quick <maros.orsak159@gmail.com>

* update to Java 11

Signed-off-by: see-quick <maros.orsak159@gmail.com>

* update to 17

Signed-off-by: see-quick <maros.orsak159@gmail.com>

* build on both java versions

Signed-off-by: see-quick <maros.orsak159@gmail.com>

* update pom.xml

Signed-off-by: see-quick <maros.orsak159@gmail.com>

* update pom.xml (fail on warn false, + change default compiler to Java 11

Signed-off-by: see-quick <maros.orsak159@gmail.com>

---------

Signed-off-by: see-quick <maros.orsak159@gmail.com>
  • Loading branch information
see-quick authored Apr 5, 2023
1 parent d446fda commit 48462a9
Show file tree
Hide file tree
Showing 3 changed files with 24 additions and 30 deletions.
16 changes: 12 additions & 4 deletions .azure/build-pipeline.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -18,20 +18,28 @@ jobs:
displayName: 'Build'
# Set timeout for jobs
timeoutInMinutes: 60
strategy:
matrix:
'java-11':
jdk_version: '11'
'java-17':
jdk_version: '17'
# Base system
pool:
vmImage: 'Ubuntu-18.04'
vmImage: 'Ubuntu-22.04'
# Pipeline steps
steps:
- task: Cache@2
inputs:
key: 'mvn-m2-cache | $(System.JobName)'
path: "$(HOME)/.m2/repository"
key: 'maven-cache | $(System.JobName) | **/pom.xml'
restoreKeys: |
maven-cache | $(System.JobName)
maven-cache
path: $(HOME)/.m2/repository
displayName: Maven cache
- template: 'templates/steps/setup_docker.yaml'
- template: 'templates/steps/setup_java.yaml'
parameters:
JDK_PATH: $(jdk_path)
JDK_VERSION: $(jdk_version)

- bash: mvn clean verify
Expand Down
30 changes: 8 additions & 22 deletions .azure/templates/steps/setup_java.yaml
Original file line number Diff line number Diff line change
@@ -1,25 +1,11 @@
# Step to setup JAVA on the agent
# We use openjdk-8
# Step to configure JAVA on the agent
parameters:
- name: JDK_PATH
default: '/usr/lib/jvm/java-8-openjdk-amd64'
- name: JDK_VERSION
default: '8'
default: '17'
steps:

- bash: sudo apt-get update
displayName: 'Update package list'

- bash: sudo apt-get install openjdk-8-jdk
displayName: 'Install openjdk8'

- bash: |
echo "##vso[task.setvariable variable=JAVA_VERSION_BUILD]1.8"
echo "##vso[task.setvariable variable=JAVA_VERSION]1.8.0"
displayName: 'Setup JAVA_VERSION=1.8'
- bash: |
echo "##vso[task.setvariable variable=JAVA_HOME]$(JDK_PATH)"
echo "##vso[task.setvariable variable=JAVA_HOME__X64]$(JDK_PATH)"
echo "##vso[task.setvariable variable=PATH]$(jdk_path)/bin:$(PATH)"
displayName: 'Setup JAVA_HOME'
- task: JavaToolInstaller@0
inputs:
versionSpec: $(JDK_VERSION)
jdkArchitectureOption: 'x64'
jdkSourceOption: 'PreInstalled'
displayName: 'Configure Java'
8 changes: 4 additions & 4 deletions pom.xml
Original file line number Diff line number Diff line change
Expand Up @@ -85,8 +85,8 @@

<properties>
<!-- JAVA CODE VERSION -->
<maven.compiler.target>1.8</maven.compiler.target>
<maven.compiler.source>1.8</maven.compiler.source>
<maven.compiler.target>11</maven.compiler.target>
<maven.compiler.source>11</maven.compiler.source>

<!-- DEPENDENCY CODE VERSIONS -->
<test-containers.version>1.17.4</test-containers.version>
Expand Down Expand Up @@ -238,6 +238,7 @@
</includes>
</resource>
</resources>

</configuration>
</execution>
</executions>
Expand Down Expand Up @@ -306,8 +307,7 @@
<sourcepath>${project.build.sourceDirectory}:${project.build.directory}/generated-sources/annotations</sourcepath>
<show>public</show>
<failOnError>true</failOnError>
<failOnWarnings>true</failOnWarnings>
<source>8</source>
<failOnWarnings>false</failOnWarnings>
</configuration>
</execution>
</executions>
Expand Down

0 comments on commit 48462a9

Please sign in to comment.