Skip to content

AMB-2327-Fix-pipeline-issues #423

AMB-2327-Fix-pipeline-issues

AMB-2327-Fix-pipeline-issues #423

Workflow file for this run

name: SonarCloud
on:
push:
branches:
- master
pull_request:
types: [labeled, opened, synchronize, reopened, unlabeled]
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 filenameprocessor-coverage
run: |
pip install poetry==2.0.0 moto==4.2.11 coverage redis botocore==1.35.49 simplejson pandas freezegun
poetry run coverage run --source=filenameprocessor -m unittest discover -s filenameprocessor
poetry run coverage xml -o sonarcloud-coverage-filenameprocessor-coverage.xml
continue-on-error: true
- name: Run unittest with recordprocessor-coverage
continue-on-error: true
run: |
poetry run coverage run --source=recordprocessor -m unittest discover -s recordprocessor
poetry run coverage xml -o sonarcloud-coverage-recordprocessor-coverage.xml
- name: Run unittest with recordforwarder-coverage
continue-on-error: true
run: |
poetry run coverage run --source=recordforwarder -m unittest discover -s recordforwarder
poetry run coverage xml -o sonarcloud-coverage-recordforwarder-coverage.xml
- name: Run unittest with coverage-ack-lambda
continue-on-error: true
run: |
pip install poetry coverage moto==4.2.11 freezegun
poetry run coverage run --source=ack_backend -m unittest discover -s ack_backend
poetry run coverage xml -o sonarcloud-coverage-ack-lambda.xml
- name: Run unittest with coverage-delta
continue-on-error: true
run: |
pip install poetry mypy-boto3-dynamodb==1.35.54 boto3==1.26.165 coverage botocore==1.29.165 jmespath==1.0.1 python-dateutil==2.9.0 urllib3==1.26.20 s3transfer==0.6.2 typing-extensions==4.12.2
poetry run coverage run --source=delta_backend -m unittest discover -s delta_backend
poetry run coverage xml -o sonarcloud-coverage-delta.xml
- name: Run unittest with coverage-fhir-api
continue-on-error: true
run: |
pip install poetry moto==4.2.11 coverage redis botocore==1.35.49 simplejson responses structlog fhir.resources jsonpath_ng pydantic==1.10.13 requests aws-lambda-typing cffi pyjwt boto3-stubs-lite[dynamodb]~=1.26.90 python-stdnum==1.20
poetry run coverage run --source=backend -m unittest discover -s backend
poetry run coverage xml -o sonarcloud-coverage.xml
- name: SonarCloud Scan
uses: SonarSource/sonarcloud-github-action@master
env:
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }} # Needed to get PR information, if any
SONAR_TOKEN: ${{ secrets.SONAR_TOKEN }}