diff --git a/.github/workflows/deploy.yml b/.github/workflows/deploy.yml index 389b000..354bff1 100644 --- a/.github/workflows/deploy.yml +++ b/.github/workflows/deploy.yml @@ -39,7 +39,6 @@ jobs: run: | cd app mvn clean verify - # ========================================================= # SONARCLOUD # ========================================================= @@ -48,9 +47,11 @@ jobs: runs-on: ubuntu-latest needs: test if: github.ref == 'refs/heads/main' + environment: production steps: - - uses: actions/checkout@v4 + - name: Checkout repository + uses: actions/checkout@v4 with: fetch-depth: 0 @@ -60,7 +61,7 @@ jobs: java-version: 17 distribution: zulu - - name: Cache SonarCloud packages + - name: Cache SonarQube packages uses: actions/cache@v4 with: path: ~/.sonar/cache @@ -74,12 +75,14 @@ jobs: key: ${{ runner.os }}-m2-${{ hashFiles('**/pom.xml') }} restore-keys: ${{ runner.os }}-m2 - - name: Build and analyze + - name: Build, test and analyze env: SONAR_TOKEN: ${{ secrets.SONAR_TOKEN }} run: | - cd app - mvn -B verify org.sonarsource.scanner.maven:sonar-maven-plugin:sonar -Dsonar.projectKey=SOAT-Tech-Challenge-2025_lambda-identification-auth + mvn -B clean verify \ + org.sonarsource.scanner.maven:sonar-maven-plugin:sonar \ + -Dsonar.projectKey=soat-tech-challenge-2025_lambda-identification-auth \ + -Dsonar.coverage.jacoco.xmlReportPaths=target/site/jacoco/jacoco.xml,target/site/jacoco-it/jacoco.xml # ========================================================= # DEPLOY LAMBDA (ORIGINAL, só com depends) ⚠️