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 }} +