diff --git a/.github/workflows/build.yml b/.github/workflows/build.yml index 54285ee..bfc6f8b 100644 --- a/.github/workflows/build.yml +++ b/.github/workflows/build.yml @@ -23,19 +23,27 @@ jobs: distribution: 'temurin' java-version: '21' - - name: Cache Maven packages + - name: Cache SonarCloud packages uses: actions/cache@v3 with: - path: ~/.m2/repository - key: ${{ runner.os }}-maven-${{ hashFiles('**/pom.xml') }} - restore-keys: | - ${{ runner.os }}-maven- + path: ~/.sonar/cache + key: ${{ runner.os }}-sonar + restore-keys: ${{ runner.os }}-sonar - - name: Install Maven dependencies - run: mvn install -DskipTests + - name: Cache Maven packages + uses: actions/cache@v3 + with: + path: ~/.m2 + key: ${{ runner.os }}-m2-${{ hashFiles('**/pom.xml') }} + restore-keys: ${{ runner.os }}-m2 - - name: Build with Maven - run: mvn compile + - name: Build and analyze + env: + GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }} + SONAR_TOKEN: ${{ secrets.SONAR_TOKEN }} + run: mvn -B verify org.sonarsource.scanner.maven:sonar-maven-plugin:sonar -Dsonar.projectKey=tomaytotomato_location4j - name: Run tests run: mvn test + + diff --git a/pom.xml b/pom.xml index 6070d0e..5664096 100644 --- a/pom.xml +++ b/pom.xml @@ -19,6 +19,8 @@ 2.17.2 3.3.1 0.8.12 + tomaytotomato + https://sonarcloud.io