Skip to content

Commit

Permalink
added
Browse files Browse the repository at this point in the history
  • Loading branch information
ASubaran committed Oct 30, 2024
1 parent ad8a158 commit 1bea986
Show file tree
Hide file tree
Showing 2 changed files with 27 additions and 21 deletions.
22 changes: 1 addition & 21 deletions .github/workflows/coverage.yml
Original file line number Diff line number Diff line change
Expand Up @@ -80,24 +80,4 @@ jobs:
git pull origin ${{ github.head_ref }}
git add /home/runner/work/immunisation-batch/immunisation-batch/coverage_html_report/*.xml
git commit -m "Add coverage index as XML"
git push origin ${{ github.head_ref }}
- name: Install Sonar Scanner
run: |
wget -O sonar-scanner.zip https://binaries.sonarsource.com/Distribution/sonar-scanner-cli/sonar-scanner-cli-4.6.2.2472-linux.zip
unzip sonar-scanner.zip
mv sonar-scanner-4.6.2.2472-linux sonar-scanner
export PATH="/home/runner/work/immunisation-batch/immunisation-batch/coverage_html_report"
- name: Run SonarQube Scan
env:
SONAR_TOKEN: ${{ secrets.SONAR_TOKEN }}
PATH: "/home/runner/work/immunisation-batch/immunisation-batch/coverage_html_report"
run: |
ls -R /home/runner/work/immunisation-batch/immunisation-batch/coverage_html_report
sonar-scanner \
-Dsonar.projectKey=NHSDigital_immunisation-batch \
-Dsonar.host.url=https://sonarcloud.io \
-Dsonar.login=$SONAR_TOKEN \
-Dsonar.python.coverage.reportPaths=filenameprocessor_coverage.xml
git push origin ${{ github.head_ref }}
26 changes: 26 additions & 0 deletions .github/workflows/sonarcube.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,26 @@
name: sonarcloud
on: pull_request
jobs:
sonar_scan:
runs-on: ubuntu-latest
steps:
- name: Checkout code
uses: actions/checkout@v2

- name: Install Sonar Scanner
run: |
wget -O sonar-scanner.zip https://binaries.sonarsource.com/Distribution/sonar-scanner-cli/sonar-scanner-cli-4.6.2.2472-linux.zip
unzip sonar-scanner.zip
mv sonar-scanner-4.6.2.2472-linux sonar-scanner
export PATH="${PATH}:${GITHUB_WORKSPACE}/sonar-scanner/bin"
- name: Run SonarQube Scan
env:
SONAR_TOKEN: ${{ secrets.SONAR_TOKEN }}
PATH: "${{ github.workspace }}/sonar-scanner/bin:${{ env.PATH }}"
run: |
sonar-scanner \
-Dsonar.projectKey=NHSDigital_immunisation-batch \
-Dsonar.host.url=https://sonarcloud.io \
-Dsonar.login=$SONAR_TOKEN \
-Dsonar.python.coverage.reportPaths=filenameprocessor_coverage.xml

0 comments on commit 1bea986

Please sign in to comment.