Skip to content

AMB-2232- Sonarcloud #20

AMB-2232- Sonarcloud

AMB-2232- Sonarcloud #20

Workflow file for this run

name: SonarCloud
on:
pull_request:
jobs:
sonarcloud:
name: SonarCloud
if: ${{ !contains(github.event.pull_request.labels.*.name, 'dependency') }}
runs-on: ubuntu-latest
steps:
- uses: actions/checkout@v4
with:
fetch-depth: 0
- name: Set up AWS credentials
env:
AWS_ACCESS_KEY_ID: "FOOBARKEY"
AWS_SECRET_ACCESS_KEY: "FOOBARSECRET"
run: |
aws configure set aws_access_key_id $AWS_ACCESS_KEY_ID
aws configure set aws_secret_access_key $AWS_SECRET_ACCESS_KEY
- name: Run unittest with coverage
run: |
pwd
pip install poetry moto==4.2.11 coverage redis botocore==1.35.49 simplejson
poetry run coverage run --source=filenameprocessor -m unittest discover -s filenameprocessor
poetry run coverage xml -o sonarcloud-coverage.xml
# working-directory: "/home/runner/work/immunisation-fhir-api/immunisation-fhir-api/backend"
- name: Aggregate coverage report
run: |
ls -R /home/runner/work/immunisation-batch/immunisation-batch
- name: SonarCloud Scan
uses: SonarSource/sonarcloud-github-action@master
env:
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }}
SONAR_TOKEN: ${{ secrets.SONAR_TOKEN }}