File tree Expand file tree Collapse file tree
Expand file tree Collapse file tree Load Diff This file was deleted.
Original file line number Diff line number Diff line change 3333 push :
3434 branches : [ master ]
3535
36-
3736jobs :
3837
3938 build-and-analyze :
Original file line number Diff line number Diff line change 3232 types : [ opened, reopened, synchronize ]
3333
3434jobs :
35- build :
35+ build-and-analyze :
3636
3737 name : Build on JDK 17
3838 runs-on : ubuntu-20.04
@@ -47,10 +47,22 @@ jobs:
4747 java-version : ' 17'
4848 distribution : ' temurin'
4949 cache : ' maven'
50-
50+
51+ # Cache Sonar packages which as used to run analysis and collect metrics
52+ - name : Cache SonarCloud packages
53+ uses : actions/cache@v3
54+ with :
55+ path : ~/.sonar/cache
56+ key : ${{ runner.os }}-sonar
57+ restore-keys : ${{ runner.os }}-sonar
58+
5159 # Some tests need screen access
5260 - name : Install xvfb
5361 run : sudo apt-get install -y xvfb
54-
55- - name : Build with Maven
56- run : xvfb-run ./mvnw clean verify
62+
63+ - name : Build with Maven and run SonarQube analysis
64+ run : xvfb-run ./mvnw clean verify org.sonarsource.scanner.maven:sonar-maven-plugin:sonar
65+ env :
66+ # These two env variables are needed for sonar analysis
67+ GITHUB_TOKEN : ${{ secrets.GITHUB_TOKEN }}
68+ SONAR_TOKEN : ${{ secrets.SONAR_TOKEN }}
You can’t perform that action at this time.
0 commit comments