From 3dd57d3b47542849d4fb9893260f8d462577c656 Mon Sep 17 00:00:00 2001 From: Anas WS Date: Wed, 10 Apr 2024 18:18:30 +0530 Subject: [PATCH 1/3] feat: sonar integration --- .github/workflows/sonar.yml | 26 ++++++++++++++++++++++++++ 1 file changed, 26 insertions(+) create mode 100644 .github/workflows/sonar.yml diff --git a/.github/workflows/sonar.yml b/.github/workflows/sonar.yml new file mode 100644 index 0000000..bffdb84 --- /dev/null +++ b/.github/workflows/sonar.yml @@ -0,0 +1,26 @@ +name: SonarQube Analysis +on: + workflow_run: + workflows: [React Template CI] + types: [completed] + +jobs: + sonar-analysis: + name: SonarQube Analysis + runs-on: ubuntu-latest + + steps: + - name: Checkout code + uses: actions/checkout@v2 + + - name: Download code coverage artifact + uses: actions/download-artifact@v2 + with: + name: coverage + path: coverage/lcov.info + + - name: SonarQube Scan + uses: sonarsource/sonarqube-scan-action@master + env: + SONAR_TOKEN: ${{ secrets.SONAR_TOKEN }} + SONAR_HOST_URL: ${{ secrets.SONAR_HOST_URL }} From dd63a7a5255163804be61e537eb987c1ba3b4b4e Mon Sep 17 00:00:00 2001 From: Anas WS Date: Wed, 10 Apr 2024 18:21:52 +0530 Subject: [PATCH 2/3] refactored sonar.yml --- .github/workflows/sonar.yml | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) diff --git a/.github/workflows/sonar.yml b/.github/workflows/sonar.yml index bffdb84..c651c18 100644 --- a/.github/workflows/sonar.yml +++ b/.github/workflows/sonar.yml @@ -2,7 +2,8 @@ name: SonarQube Analysis on: workflow_run: workflows: [React Template CI] - types: [completed] + types: + - completed jobs: sonar-analysis: From 105b9d8b2c92505e555e295c01b980b0d6e71c05 Mon Sep 17 00:00:00 2001 From: Anas WS Date: Wed, 10 Apr 2024 18:41:33 +0530 Subject: [PATCH 3/3] fix: test sonar.yml --- .github/workflows/sonar.yml | 25 ++++++++++++++----------- 1 file changed, 14 insertions(+), 11 deletions(-) diff --git a/.github/workflows/sonar.yml b/.github/workflows/sonar.yml index c651c18..2c305b9 100644 --- a/.github/workflows/sonar.yml +++ b/.github/workflows/sonar.yml @@ -3,7 +3,7 @@ on: workflow_run: workflows: [React Template CI] types: - - completed + - requested jobs: sonar-analysis: @@ -14,14 +14,17 @@ jobs: - name: Checkout code uses: actions/checkout@v2 - - name: Download code coverage artifact - uses: actions/download-artifact@v2 - with: - name: coverage - path: coverage/lcov.info + -name: Echo to test + run: echo "Hello World" - - name: SonarQube Scan - uses: sonarsource/sonarqube-scan-action@master - env: - SONAR_TOKEN: ${{ secrets.SONAR_TOKEN }} - SONAR_HOST_URL: ${{ secrets.SONAR_HOST_URL }} + # - name: Download code coverage artifact + # uses: actions/download-artifact@v2 + # with: + # name: coverage + # path: coverage/lcov.info + + # - name: SonarQube Scan + # uses: sonarsource/sonarqube-scan-action@master + # env: + # SONAR_TOKEN: ${{ secrets.SONAR_TOKEN }} + # SONAR_HOST_URL: ${{ secrets.SONAR_HOST_URL }}