From 9cbe21246b3c8341b8ffe462d6b2212268ac3120 Mon Sep 17 00:00:00 2001 From: Rutu2211 <85061273+Rutu2211@users.noreply.github.com> Date: Fri, 21 Feb 2025 08:04:04 +0530 Subject: [PATCH] Update main.yml --- .github/workflows/main.yml | 32 ++++++++++++++++---------------- 1 file changed, 16 insertions(+), 16 deletions(-) diff --git a/.github/workflows/main.yml b/.github/workflows/main.yml index b7d20fff..0d37db38 100644 --- a/.github/workflows/main.yml +++ b/.github/workflows/main.yml @@ -1,20 +1,20 @@ -name: Run SonarQube with Maven - -on: push - +name: Code build and review +on: push jobs: - build: - runs-on: ubuntu-latest - steps: - - uses: actions/checkout@v3 - - name: Set up JDK 17 - uses: actions/setup-java@v3 - with: - java-version: '17' - distribution: 'adopt' - cache: maven - - name: Build with Maven cloud - run: mvn -B verify sonar:sonar -Dsonar.projectKey=sonardemo-project-reachability_project1 -Dsonar.organization=sonardemo-project-reachability -Dsonar.host.url=https://sonarcloud.io -Dsonar.token=$SONAR_TOKEN + buildjob: + runs-on: ubuntu-latest + steps: + - name: Clone the current repository on the runner + uses: actions/checkout@v4 + - name: Setup Java 17 and maven + uses: actions/setup-java@v4 + with: + distribution: 'temurin' + java-version: '17' + cache: 'maven' + - name: Build the code + run: mvn -B verify sonar:sonar -Dsonar.projectKey=rutu-demo-githubactions_project-sonar-demo -Dsonar.organization=rutu-demo-githubactions -Dsonar.host.url=https://sonarcloud.io -Dsonar.token=$SONAR_TOKEN env: GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }} SONAR_TOKEN: ${{ secrets.SONAR_TOKEN }} +