feat: Add sonar for single module v2 workflow
This commit is contained in:
@@ -32,7 +32,10 @@ jobs:
|
||||
api-single-module-workflow:
|
||||
runs-on: custom
|
||||
steps:
|
||||
- uses: actions/checkout@v2
|
||||
- uses: actions/checkout@v3
|
||||
with:
|
||||
fetch-depth: 0
|
||||
|
||||
- name: Set up JDK 17
|
||||
uses: actions/setup-java@v1
|
||||
with:
|
||||
@@ -41,18 +44,23 @@ jobs:
|
||||
- name: Grant execute permission for gradlew
|
||||
run: chmod +x gradlew
|
||||
|
||||
- name: Test application with Gradle
|
||||
if: ${{ inputs.IS_TEST_ENABLED }}
|
||||
run: ./gradlew test
|
||||
- name: Build and analyze (exclude test)
|
||||
if: ${{ !inputs.IS_TEST_ENABLED }}
|
||||
env:
|
||||
GITHUB_TOKEN: ${{ secrets.GH_TOKEN_CAN_READ_PACKAGES || secrets.GH_DEPBOT_TOKEN_CAN_READ_PACKAGES }}
|
||||
GITHUB_USERNAME: ${{ secrets.GH_USER_CAN_READ_PACKAGES || secrets.GH_DEPBOT_USER_CAN_READ_PACKAGES }}
|
||||
SONAR_TOKEN: ${{ secrets.SONARQUBE_TOKEN }}
|
||||
SONAR_HOST_URL: ${{ secrets.SONARQUBE_HOST_URL }}
|
||||
run: ./gradlew build bootJar sonar --info -x test
|
||||
|
||||
- name: Build application with Gradle
|
||||
run: ./gradlew bootJar
|
||||
- name: Build and analyze (include test)
|
||||
if: ${{ inputs.IS_TEST_ENABLED }}
|
||||
env:
|
||||
GITHUB_TOKEN: ${{ secrets.GH_TOKEN_CAN_READ_PACKAGES || secrets.GH_DEPBOT_TOKEN_CAN_READ_PACKAGES }}
|
||||
GITHUB_USERNAME: ${{ secrets.GH_USER_CAN_READ_PACKAGES || secrets.GH_DEPBOT_USER_CAN_READ_PACKAGES }}
|
||||
SONAR_TOKEN: ${{ secrets.SONARQUBE_TOKEN }}
|
||||
SONAR_HOST_URL: ${{ secrets.SONARQUBE_HOST_URL }}
|
||||
run: ./gradlew build bootJar test sonar --info
|
||||
|
||||
- name: Copy docker directory
|
||||
if: ${{ inputs.IS_COPY_DOCKER_DIRECTORY }}
|
||||
|
||||
Reference in New Issue
Block a user