Skip to content

Commit

Permalink
fix sonar report build
Browse files Browse the repository at this point in the history
  • Loading branch information
itsankit-google committed Sep 23, 2024
1 parent 7ad81db commit 4f97fdb
Show file tree
Hide file tree
Showing 2 changed files with 5 additions and 15 deletions.
15 changes: 3 additions & 12 deletions .github/workflows/build-sonar-report.yml
Original file line number Diff line number Diff line change
Expand Up @@ -31,11 +31,6 @@ jobs:
# Pinned 1.0.0 version
- uses: marocchino/action-workflow_run-status@54b6e87d6cb552fc5f36dbe9a722a6048725917a

- uses: actions/checkout@v4
with:
ref: ${{ github.event.workflow_run.head_sha }}
submodules: recursive

- name: Cache SonarCloud packages
uses: actions/cache@v3
with:
Expand All @@ -48,17 +43,12 @@ jobs:
with:
github-token: ${{ secrets.GITHUB_TOKEN }}
run-id: ${{ github.event.workflow_run.id }}
path: artifacts/

- name: Copy coverage report
run: |
mkdir -p cdap-coverage/target/
cp -r artifacts/reports-${{ github.event.workflow_run.id }}/cdap-coverage/target/ cdap-coverage/target/
ls -R cdap-coverage
path: cdap/

- name: Sonar Report on PR
# For whatever reason we get PR 69 for develop branch with both head and base as develop.
if: ${{ github.event.workflow_run.pull_requests[0].head.ref != github.event.workflow_run.pull_requests[0].base.ref }}
working-directory: cdap
env:
SONAR_TOKEN: ${{ secrets.SONAR_TOKEN }}
JAVA_HOME: /usr/lib/jvm/java-17-openjdk-amd64
Expand All @@ -75,6 +65,7 @@ jobs:
- name: Sonar report
if: ${{ github.event.workflow_run.pull_requests[0].head.ref == github.event.workflow_run.pull_requests[0].base.ref }}
working-directory: cdap
env:
SONAR_TOKEN: ${{ secrets.SONAR_TOKEN }}
JAVA_HOME: /usr/lib/jvm/java-17-openjdk-amd64
Expand Down
5 changes: 2 additions & 3 deletions .github/workflows/build-sonar.yml
Original file line number Diff line number Diff line change
Expand Up @@ -62,6 +62,5 @@ jobs:
with:
name: reports-${{ github.run_id }}
path: |
**/target/rat.txt
**/target/site/jacoco-aggregate/jacoco.xml
**/target/surefire-reports/*
**/cdap/**
**/cdap/cdap-coverage/**

0 comments on commit 4f97fdb

Please sign in to comment.