Skip to content

Commit

Permalink
Merge pull request #2 from pagopa/implementing
Browse files Browse the repository at this point in the history
feat: Implementing
  • Loading branch information
cesarecaccuri authored Jul 19, 2023
2 parents ac66796 + 9f37a5f commit 3d94155
Show file tree
Hide file tree
Showing 106 changed files with 6,682 additions and 668 deletions.
91 changes: 91 additions & 0 deletions .devops/code-review-pipelines.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,91 @@
# Maven
# Build your Java project and run tests with Apache Maven.
# Add steps that analyze code, save build artifacts, deploy, and more:
# https://docs.microsoft.com/azure/devops/pipelines/languages/java

# Automatically triggered on PR
# https://docs.microsoft.com/en-us/azure/devops/pipelines/yaml-schema?view=azure-devops&tabs=schema%2Cparameter-schema#pr-trigger
trigger: none

pool:
vmImage: 'ubuntu-22.04'

variables:
MAVEN_CACHE_FOLDER: $(Pipeline.Workspace)/.m2/repository
MAVEN_OPTS: '-Dmaven.repo.local=$(MAVEN_CACHE_FOLDER)'
GRAALVM_VERSION: '22.3.1'

stages:
- stage: Test
jobs:
- job: unit_test
steps:
- checkout: self
persistCredentials: true

- task: Cache@2
inputs:
key: 'maven | "$(Agent.OS)" | pom.xml'
restoreKeys: |
maven | "$(Agent.OS)"
maven
path: $(MAVEN_CACHE_FOLDER)
displayName: Cache Maven local repo

- script: |
echo "Install GraalVM $(GRAALVM_VERSION) - JAVA 17"
cd /tmp
curl -o GraalVM.tar.gz -L https://github.com/graalvm/graalvm-ce-builds/releases/download/vm-$(GRAALVM_VERSION)/graalvm-ce-java17-linux-amd64-$(GRAALVM_VERSION).tar.gz
tar -xzf GraalVM.tar.gz
GRAALVM_HOME=/tmp/graalvm-ce-java17-$(GRAALVM_VERSION)
sudo apt-get install build-essential libz-dev zlib1g-dev
${GRAALVM_HOME}/bin/gu install native-image
#set for next step
echo "##vso[task.setvariable variable=GRAALVM_HOME]${GRAALVM_HOME}"
echo "##vso[task.setvariable variable=JAVA_HOME]${GRAALVM_HOME}"
echo "##vso[task.setvariable variable=PATH]${GRAALVM_HOME}/bin;$(PATH)"
#set fot this step
export GRAALVM_HOME=${GRAALVM_HOME}
export JAVA_HOME=${GRAALVM_HOME}
export PATH=${GRAALVM_HOME}/bin:$PATH
java -version
displayName: Install GraalVM $(GRAALVM_VERSION) - JAVA 17
- task: SonarCloudPrepare@1
displayName: 'Prepare SonarCloud analysis configuration'
inputs:
SonarCloud: '$(SONARCLOUD_SERVICE_CONN)'
organization: '$(SONARCLOUD_ORG)'
scannerMode: Other
extraProperties: |
sonar.projectKey=$(SONARCLOUD_PROJECT_KEY)
sonar.projectName=$(SONARCLOUD_PROJECT_NAME)
sonar.exclusions=src/main/java/it/gov/pagopa/fdr/**/*Entity.java,src/main/java/it/gov/pagopa/fdr/util/App*.java,src/main/java/it/gov/pagopa/fdr/**/model/*.java,src/main/java/it/gov/pagopa/fdr/**/projection/*.java
- task: Maven@3
displayName: 'Run Junit Test'
inputs:
mavenPomFile: 'pom.xml'
goals: 'clean verify'
publishJUnitResults: true
testResultsFiles: '**/surefire-reports/TEST-*.xml'
codeCoverageToolOption: 'JaCoCo'
javaHomeOption: '/tmp/graalvm-ce-java17-$(GRAALVM_VERSION)'
jdkDirectory: '/tmp/graalvm-ce-java17-$(GRAALVM_VERSION)'
mavenVersionOption: 'Default'
mavenOptions: '-Xmx3072m $(MAVEN_OPTS)'
mavenAuthenticateFeed: false
effectivePomSkip: false
sonarQubeRunAnalysis: true
isJacocoCoverageReportXML: true
sqMavenPluginVersionChoice: 'latest'

- task: SonarCloudPublish@1
displayName: 'Publish SonarCloud results on build summary'
inputs:
pollingTimeoutSec: '300'
Loading

0 comments on commit 3d94155

Please sign in to comment.