Skip to content

Commit 9101316

Browse files
committed
optim github action buildt
1 parent 092f247 commit 9101316

1 file changed

Lines changed: 5 additions & 9 deletions

File tree

.github/workflows/build.yml

Lines changed: 5 additions & 9 deletions
Original file line numberDiff line numberDiff line change
@@ -10,7 +10,6 @@ on:
1010
- "[0-9]+.[0-9]+.[0-9]+"
1111
pull_request:
1212
types: [opened, synchronize, reopened]
13-
workflow_dispatch:
1413

1514
jobs:
1615
build:
@@ -29,29 +28,26 @@ jobs:
2928
with:
3029
distribution: "temurin"
3130
java-version: 17
32-
cache: maven # enable maven cache shared by all github actions build
31+
cache: maven
3332

34-
# to be able to use "sonar:sonar" instead of "org.sonarsource.scanner.maven:sonar-maven-plugin:sonar"
35-
# inside this build but also when the test project analysis is launched with sonar:sonar
3633
- name: Configure Maven for Sonar
3734
run: |
3835
mkdir -p ~/.m2
3936
echo "<settings><pluginGroups><pluginGroup>org.sonarsource.scanner.maven</pluginGroup></pluginGroups></settings>" > ~/.m2/settings.xml
4037
41-
# enable sonarqube downloads cache shared by all github actions build
38+
- name: Verify
39+
run: ./mvnw -e -B verify
40+
4241
- name: Cache SonarQube packages
4342
uses: actions/cache@v4
4443
with:
4544
path: ~/.sonar/cache
4645
key: ${{ runner.os }}-sonar
4746
restore-keys: ${{ runner.os }}-sonar
4847

49-
- name: Verify
50-
run: ./mvnw -e -B verify
51-
5248
- name: SonarQube Scan
5349
if: github.event_name != 'pull_request' || github.event.pull_request.head.repo.full_name == github.repository
5450
env:
5551
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }}
5652
SONAR_TOKEN: ${{ secrets.SONAR_TOKEN }}
57-
run: ./mvnw -e -B sonar:sonar -Dsonar.projectKey=green-code-initiative_creedengo-java
53+
run: ./mvnw -e -B sonar:sonar -Dsonar.projectKey=green-code-initiative_creedengo-java -Dsonar.organization=green-code-initiative

0 commit comments

Comments
 (0)