From 64609baa3960a67f54a14bdf7cff6d57428d4fa4 Mon Sep 17 00:00:00 2001 From: Pavel-Shcherbo <44784481+Pavel-Shcherbo@users.noreply.github.com> Date: Mon, 19 Feb 2024 01:23:01 +0300 Subject: [PATCH] Update build.yml --- .github/workflows/build.yml | 27 +++++---------------------- 1 file changed, 5 insertions(+), 22 deletions(-) diff --git a/.github/workflows/build.yml b/.github/workflows/build.yml index af73338..2796c76 100644 --- a/.github/workflows/build.yml +++ b/.github/workflows/build.yml @@ -1,4 +1,4 @@ -name: SonarCloud +name: Build on: push: branches: @@ -6,32 +6,15 @@ on: pull_request: types: [opened, synchronize, reopened] jobs: - build: - name: Build and analyze + sonarcloud: + name: SonarCloud runs-on: ubuntu-latest steps: - uses: actions/checkout@v3 with: fetch-depth: 0 # Shallow clones should be disabled for a better relevancy of analysis - - name: Set up JDK 17 - uses: actions/setup-java@v3 - with: - java-version: 17 - distribution: 'zulu' # Alternative distribution options are available. - - name: Cache SonarCloud packages - uses: actions/cache@v3 - with: - path: ~/.sonar/cache - key: ${{ runner.os }}-sonar - restore-keys: ${{ runner.os }}-sonar - - 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 and analyze + - name: SonarCloud Scan + uses: SonarSource/sonarcloud-github-action@master env: GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }} # Needed to get PR information, if any SONAR_TOKEN: ${{ secrets.SONAR_TOKEN }} - run: mvn -B verify org.sonarsource.scanner.maven:sonar-maven-plugin:sonar -Dsonar.projectKey=Pavel-Shcherbo_JavaLabs