Build Service on branch test triggered by quanpham-axonivy #1148
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
name: Service CI Build | |
run-name: Build Service on branch ${{github.ref_name}} triggered by ${{github.actor}} | |
on: | |
push: | |
paths: | |
- 'marketplace-service/**' | |
workflow_dispatch: | |
jobs: | |
build: | |
name: Executes Tests | |
runs-on: self-hosted | |
steps: | |
- uses: actions/checkout@v4 | |
- name: Set up JDK 17 | |
uses: actions/setup-java@v3 | |
with: | |
java-version: '17' | |
distribution: 'temurin' | |
cache: maven | |
- name: Tests with Maven | |
run: mvn clean install --file ./marketplace-service/pom.xml | |
analysis: | |
name: Sonarqube analysis | |
needs: build | |
runs-on: self-hosted | |
env: | |
SONAR_HOST_URL: ${{ secrets.SONAR_HOST_URL }} | |
SONAR_TOKEN: ${{ secrets.SONAR_TOKEN }} | |
SONAR_PROJECT_KEY : ${{ secrets.SONAR_PROJECT_KEY }} | |
steps: | |
- name: Remove unused sonar images | |
run: docker image prune -af | |
- name: Set up JDK 17 | |
uses: actions/setup-java@v3 | |
with: | |
java-version: '17' | |
distribution: 'temurin' | |
- name: Run SonarQube Scanner | |
run: | | |
mvn -B verify sonar:sonar --file ./marketplace-service/pom.xml \ | |
-Dsonar.host.url=${{ env.SONAR_HOST_URL }} \ | |
-Dsonar.projectKey=${{ env.SONAR_PROJECT_KEY }} \ | |
-Dsonar.projectName="AxonIvy Market Service" \ | |
-Dsonar.token=${{ env.SONAR_TOKEN }} \ | |
- name: SonarQube Quality Gate check | |
id: sonarqube-quality-gate-check | |
uses: sonarsource/sonarqube-quality-gate-action@master | |
timeout-minutes: 5 | |
with: | |
scanMetadataReportFile: ./marketplace-service/target/sonar/report-task.txt | |
args: -Dsonar.projectKey=${{ env.SONAR_PROJECT_KEY }} |