Skip to content

Commit ddacefe

Browse files
committed
Use Java 17 for the SonarQube scan
1 parent 6ee28a9 commit ddacefe

File tree

1 file changed

+26
-11
lines changed

1 file changed

+26
-11
lines changed

.github/workflows/build.yml

Lines changed: 26 additions & 11 deletions
Original file line numberDiff line numberDiff line change
@@ -1,4 +1,5 @@
11
name: Build and Tests
2+
23
on:
34
push:
45
branches:
@@ -9,7 +10,8 @@ on:
910
tags:
1011
- '[0-9]+.[0-9]+.[0-9]+'
1112
pull_request:
12-
types: [opened, synchronize, reopened]
13+
types: [ opened, synchronize, reopened ]
14+
1315
jobs:
1416
build:
1517
name: Build
@@ -18,28 +20,41 @@ jobs:
1820
pull-requests: read # allows SonarCloud to decorate PRs with analysis results
1921
steps:
2022
- name: Checkout
21-
uses: actions/checkout@v3
23+
uses: actions/checkout@v4
2224
with:
2325
fetch-depth: 0 # Shallow clones should be disabled for a better relevancy of analysis
26+
2427
- name: Set up JDK 11
2528
uses: actions/setup-java@v3
2629
with:
30+
distribution: 'temurin'
2731
java-version: 11
28-
distribution: 'zulu' # Alternative distribution options are available.
29-
- name: Cache SonarCloud packages
30-
uses: actions/cache@v3
31-
with:
32-
path: ~/.sonar/cache
33-
key: ${{ runner.os }}-sonar
34-
restore-keys: ${{ runner.os }}-sonar
32+
3533
- name: Cache Maven packages
3634
uses: actions/cache@v3
3735
with:
3836
path: ~/.m2
3937
key: ${{ runner.os }}-m2-${{ hashFiles('**/pom.xml') }}
4038
restore-keys: ${{ runner.os }}-m2
41-
- name: Build and analyze
39+
40+
- name: Verify
41+
run: mvn -e -B verify
42+
43+
- name: Set up JDK 17
44+
uses: actions/setup-java@v3
45+
with:
46+
distribution: 'temurin'
47+
java-version: 17
48+
49+
- name: Cache SonarQube packages
50+
uses: actions/cache@v3
51+
with:
52+
path: ~/.sonar/cache
53+
key: ${{ runner.os }}-sonar
54+
restore-keys: ${{ runner.os }}-sonar
55+
56+
- name: SonarQube Scan
4257
env:
4358
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }}
4459
SONAR_TOKEN: ${{ secrets.SONAR_TOKEN }}
45-
run: mvn -e -B verify org.sonarsource.scanner.maven:sonar-maven-plugin:sonar -Dsonar.projectKey=green-code-initiative_ecoCode-python -Dsonar.exclusions=**/*.groovy,**/*.dummy
60+
run: mvn -e -B org.sonarsource.scanner.maven:sonar-maven-plugin:sonar -Dsonar.projectKey=green-code-initiative_ecoCode-python

0 commit comments

Comments
 (0)