Skip to content

Commit

Permalink
New sonarcloud PR workflow
Browse files Browse the repository at this point in the history
  • Loading branch information
cbosdo committed Oct 11, 2023
1 parent 84c9111 commit e5251a6
Showing 1 changed file with 54 additions and 0 deletions.
54 changes: 54 additions & 0 deletions .github/workflows/sonarcloud.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,54 @@
name: Sonarcloud analysis

on:
push:
branches:
- master
paths:
- 'java/**.java'
- 'java/**.xml'
- '**.py'
- 'web/html/src/**.ts'
- 'web/html/src/**.tsx'
pull_request:
paths:
- 'java/**.java'
- 'java/**.xml'
- '**.py'
- 'web/html/src/**.ts'
- 'web/html/src/**.tsx'

jobs:
sonarcloud:
runs-on: ubuntu-latest
container: registry.opensuse.org/systemsmanagement/uyuni/master/docker/containers/uyuni-master-pgsql:latest
steps:
- name: Checkout repository
uses: actions/checkout@v4

- name: Cache dependencies
id: cache-dependencies
uses: actions/cache@v3
with:
path: java/lib
key: ${{ runner.os }}-java-lib-${{ hashFiles('java/buildconf/ivy/*.*') }}

- name: Resolve dependencies
if: steps.cache-dependencies.outputs.cache-hit != 'true'
run: |
ant -f java/manager-build.xml ivy
- name: Compile Java
run: ant -f java/manager-build.xml compile

- name: SonarCloud Scan
uses: sonarsource/sonarcloud-github-action@master
env:
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }}
SONAR_TOKEN: ${{ secrets.SONARQUBE_AUTH_UYUNI }}
args: >
-Dsonar.junit.reportPaths=""
-Dsonar.coverage.jacoco.xmlReportPaths=""
-Dsonar.pullrequest.key=${{ github.event.number }}
-Dsonar.pullrequest.branch=${{ github.event.pull_request.head.ref }}
-Dsonar.pullrequest.base=${{ github.base_ref }}

0 comments on commit e5251a6

Please sign in to comment.