Skip to content

Commit

Permalink
Merge branch 'brenoepics:main' into main
Browse files Browse the repository at this point in the history
  • Loading branch information
brenoepic authored Feb 7, 2024
2 parents e2c1b36 + 967b9f6 commit 170b0aa
Show file tree
Hide file tree
Showing 2 changed files with 43 additions and 3 deletions.
43 changes: 43 additions & 0 deletions .github/workflows/sonarcloud-pr.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,43 @@
name: SonarCloud

on:
pull_request_target:
types: [ labeled ]

jobs:

sonarcloud:
runs-on: ubuntu-latest
if: ${{ github.event.label.name == 'sonarcloud' }}
steps:
- uses: actions/checkout@v3
with:
fetch-depth: 0
- name: Set up JDK 17
uses: actions/setup-java@v3
with:
java-version: 17
distribution: 'zulu'
- 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
run: mvn -B clean verify org.sonarsource.scanner.maven:sonar-maven-plugin:sonar -Dsonar.projectKey=brenoepics_at4j -P coverage
env:
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }}
SONAR_TOKEN: ${{ secrets.SONAR_TOKEN }}
- name: SonarCloud Summary Action
uses: thecanadianroot/sonarcloud-summary-action@v1
with:
github-repository: ${{ github.repository }}
github-token: ${{ secrets.GITHUB_TOKEN }}
pull-request: ${{ github.event.pull_request.number }}
3 changes: 0 additions & 3 deletions .github/workflows/sonarcloud.yml
Original file line number Diff line number Diff line change
Expand Up @@ -9,14 +9,11 @@ on:
paths:
- 'src/**'
- 'pom.xml'
pull_request:
types: [opened, synchronize, reopened]

jobs:
build:
name: Build and analyze
runs-on: ubuntu-latest
if: ${{ secrets.AZURE_KEY && secrets.AZURE_REGION && secrets.GITHUB_TOKEN && secrets.SONAR_TOKEN }}
steps:
- uses: actions/checkout@v3
with:
Expand Down

0 comments on commit 170b0aa

Please sign in to comment.