|
1 | 1 | name: SonarCloud |
2 | 2 |
|
3 | 3 | on: |
4 | | - push: |
5 | | - branches: |
6 | | - - master |
7 | | - pull_request: |
8 | | - types: [labeled, opened, synchronize, reopened, unlabeled] |
| 4 | + push: |
| 5 | + branches: |
| 6 | + - master |
| 7 | + pull_request: |
| 8 | + types: [labeled, opened, synchronize, reopened, unlabeled] |
9 | 9 |
|
10 | 10 | jobs: |
11 | | - sonarcloud: |
12 | | - name: SonarCloud |
13 | | - if: ${{ !contains(github.event.pull_request.labels.*.name, 'dependency') }} |
14 | | - runs-on: ubuntu-latest |
| 11 | + sonarcloud: |
| 12 | + name: SonarCloud |
| 13 | + if: ${{ !contains(github.event.pull_request.labels.*.name, 'dependency') }} |
| 14 | + runs-on: ubuntu-latest |
15 | 15 |
|
16 | | - steps: |
17 | | - - uses: actions/checkout@v4 |
18 | | - with: |
19 | | - fetch-depth: 0 |
| 16 | + steps: |
| 17 | + - uses: actions/checkout@v4 |
| 18 | + with: |
| 19 | + fetch-depth: 0 |
20 | 20 |
|
21 | | - - name: Set up AWS credentials |
22 | | - env: |
23 | | - AWS_ACCESS_KEY_ID: "FOOBARKEY" |
24 | | - AWS_SECRET_ACCESS_KEY: "FOOBARSECRET" |
25 | | - run: | |
26 | | - aws configure set aws_access_key_id $AWS_ACCESS_KEY_ID |
27 | | - aws configure set aws_secret_access_key $AWS_SECRET_ACCESS_KEY |
| 21 | + - name: Set up AWS credentials |
| 22 | + env: |
| 23 | + AWS_ACCESS_KEY_ID: "FOOBARKEY" |
| 24 | + AWS_SECRET_ACCESS_KEY: "FOOBARSECRET" |
| 25 | + run: | |
| 26 | + aws configure set aws_access_key_id $AWS_ACCESS_KEY_ID |
| 27 | + aws configure set aws_secret_access_key $AWS_SECRET_ACCESS_KEY |
28 | 28 |
|
29 | | - - name: Initialize Unit Test Failure Tracker |
30 | | - run: echo "false" > test_failed.txt |
| 29 | + - name: Initialize Unit Test Failure Tracker |
| 30 | + run: echo "false" > test_failed.txt |
31 | 31 |
|
32 | | - # - name: Run unittest with filenameprocessor-coverage |
33 | | - # id: filenameprocessor |
34 | | - # continue-on-error: true |
35 | | - # run: | |
36 | | - # pip install poetry==1.8.4 moto==4.2.11 coverage redis botocore==1.35.49 simplejson pandas freezegun 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 fakeredis |
37 | | - # poetry run coverage run --source=filenameprocessor -m unittest discover -s filenameprocessor || echo "filenameprocessor tests failed" >> failed_tests.txt |
38 | | - # poetry run coverage xml -o sonarcloud-coverage-filenameprocessor-coverage.xml |
| 32 | + # - name: Run unittest with filenameprocessor-coverage |
| 33 | + # id: filenameprocessor |
| 34 | + # continue-on-error: true |
| 35 | + # run: | |
| 36 | + # pip install poetry==1.8.4 moto==4.2.11 coverage redis botocore==1.35.49 simplejson pandas freezegun 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 fakeredis |
| 37 | + # poetry run coverage run --source=filenameprocessor -m unittest discover -s filenameprocessor || echo "filenameprocessor tests failed" >> failed_tests.txt |
| 38 | + # poetry run coverage xml -o sonarcloud-coverage-filenameprocessor-coverage.xml |
39 | 39 |
|
40 | | - # - name: Run unittest with recordprocessor-coverage |
41 | | - # id: recordprocessor |
42 | | - # continue-on-error: true |
43 | | - # run: | |
44 | | - # poetry run coverage run --source=recordprocessor -m unittest discover -s recordprocessor || echo "recordprocessor tests failed" >> failed_tests.txt |
45 | | - # poetry run coverage xml -o sonarcloud-coverage-recordprocessor-coverage.xml |
| 40 | + # - name: Run unittest with recordprocessor-coverage |
| 41 | + # id: recordprocessor |
| 42 | + # continue-on-error: true |
| 43 | + # run: | |
| 44 | + # poetry run coverage run --source=recordprocessor -m unittest discover -s recordprocessor || echo "recordprocessor tests failed" >> failed_tests.txt |
| 45 | + # poetry run coverage xml -o sonarcloud-coverage-recordprocessor-coverage.xml |
46 | 46 |
|
47 | | - # - name: Run unittest with recordforwarder-coverage |
48 | | - # id: recordforwarder |
49 | | - # continue-on-error: true |
50 | | - # run: | |
51 | | - # PYTHONPATH=$(pwd)/backend:$(pwd)/backend/tests poetry run coverage run --source=backend -m unittest discover -s backend/tests -p "*batch*.py" || echo "recordforwarder tests failed" >> failed_tests.txt |
52 | | - # poetry run coverage xml -o sonarcloud-coverage-recordforwarder-coverage.xml |
| 47 | + # - name: Run unittest with recordforwarder-coverage |
| 48 | + # id: recordforwarder |
| 49 | + # continue-on-error: true |
| 50 | + # run: | |
| 51 | + # PYTHONPATH=$(pwd)/backend:$(pwd)/backend/tests poetry run coverage run --source=backend -m unittest discover -s backend/tests -p "*batch*.py" || echo "recordforwarder tests failed" >> failed_tests.txt |
| 52 | + # poetry run coverage xml -o sonarcloud-coverage-recordforwarder-coverage.xml |
53 | 53 |
|
54 | | - # - name: Run unittest with coverage-ack-lambda |
55 | | - # id: acklambda |
56 | | - # continue-on-error: true |
57 | | - # run: | |
58 | | - # pip install poetry==1.8.4 coverage moto==4.2.11 freezegun |
59 | | - # poetry run coverage run --source=ack_backend -m unittest discover -s ack_backend || echo "ack-lambda tests failed" >> failed_tests.txt |
60 | | - # poetry run coverage xml -o sonarcloud-coverage-ack-lambda.xml |
| 54 | + # - name: Run unittest with coverage-ack-lambda |
| 55 | + # id: acklambda |
| 56 | + # continue-on-error: true |
| 57 | + # run: | |
| 58 | + # pip install poetry==1.8.4 coverage moto==4.2.11 freezegun |
| 59 | + # poetry run coverage run --source=ack_backend -m unittest discover -s ack_backend || echo "ack-lambda tests failed" >> failed_tests.txt |
| 60 | + # poetry run coverage xml -o sonarcloud-coverage-ack-lambda.xml |
61 | 61 |
|
62 | | - - name: Run unittest with coverage-delta |
63 | | - id: delta |
64 | | - env: |
65 | | - PYTHONPATH: delta_backend/src:delta_backend/tests:./src:./tests |
66 | | - continue-on-error: true |
67 | | - run: | |
68 | | - echo ">>>> SAW: use delta.firehose_log:" |
69 | | - pip install poetry==1.8.4 moto==4.2.11 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 |
70 | | - export PYTHONPATH=src:tests |
71 | | - PYTHONPATH=delta_backend/src:delta_backend/tests:./src:./tests poetry run coverage run --source=delta_backend -m unittest discover -s delta_backend/tests || echo "delta tests failed" >> failed_tests.txt |
72 | | - poetry run coverage xml -o sonarcloud-coverage-delta.xml |
| 62 | + - name: Run unittest with coverage-delta |
| 63 | + id: delta |
| 64 | + env: |
| 65 | + PYTHONPATH: delta_backend/src:delta_backend/tests |
| 66 | + continue-on-error: true |
| 67 | + run: | |
| 68 | + echo ">>>> SAW: use delta.firehose_log:" |
| 69 | + pip install poetry==1.8.4 moto==4.2.11 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 |
| 70 | + poetry run coverage run --source=delta_backend -m unittest discover -s delta_backend/tests || echo "delta tests failed" >> failed_tests.txt |
| 71 | + poetry run coverage run --source=delta_backend -m unittest discover -s delta_backend/tests || echo "delta tests failed" >> failed_tests.txt |
| 72 | + poetry run coverage xml -o sonarcloud-coverage-delta.xml |
73 | 73 |
|
74 | | - # - name: Run unittest with coverage-fhir-api |
75 | | - # id: fhirapi |
76 | | - # continue-on-error: true |
77 | | - # run: | |
78 | | - # pip install poetry==1.8.4 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 |
79 | | - # poetry run coverage run --source=backend -m unittest discover -s backend || echo "fhir-api tests failed" >> failed_tests.txt |
80 | | - # poetry run coverage xml -o sonarcloud-coverage.xml |
| 74 | + # - name: Run unittest with coverage-fhir-api |
| 75 | + # id: fhirapi |
| 76 | + # continue-on-error: true |
| 77 | + # run: | |
| 78 | + # pip install poetry==1.8.4 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 |
| 79 | + # poetry run coverage run --source=backend -m unittest discover -s backend || echo "fhir-api tests failed" >> failed_tests.txt |
| 80 | + # poetry run coverage xml -o sonarcloud-coverage.xml |
81 | 81 |
|
82 | | - # - name: Run unittest with coverage-mesh-processor |
83 | | - # id: meshprocessor |
84 | | - # continue-on-error: true |
85 | | - # run: | |
86 | | - # pip install poetry==1.8.4 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 |
87 | | - # poetry run coverage run --source=mesh_processor -m unittest discover -s mesh_processor || echo "mesh_processor tests failed" >> failed_tests.txt |
88 | | - # poetry run coverage xml -o sonarcloud-mesh_processor-coverage.xml |
| 82 | + # - name: Run unittest with coverage-mesh-processor |
| 83 | + # id: meshprocessor |
| 84 | + # continue-on-error: true |
| 85 | + # run: | |
| 86 | + # pip install poetry==1.8.4 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 |
| 87 | + # poetry run coverage run --source=mesh_processor -m unittest discover -s mesh_processor || echo "mesh_processor tests failed" >> failed_tests.txt |
| 88 | + # poetry run coverage xml -o sonarcloud-mesh_processor-coverage.xml |
89 | 89 |
|
90 | | - - name: Run Test Failure Summary |
91 | | - id: check_failure |
92 | | - run: | |
93 | | - if [ -s failed_tests.txt ]; then |
94 | | - echo "The following tests failed:" |
95 | | - cat failed_tests.txt |
| 90 | + - name: Run Test Failure Summary |
| 91 | + id: check_failure |
| 92 | + run: | |
| 93 | + if [ -s failed_tests.txt ]; then |
| 94 | + echo "The following tests failed:" |
| 95 | + cat failed_tests.txt |
96 | 96 |
|
97 | | - while IFS= read -r line; do |
98 | | - echo "##[error]Test Failures: $line" |
99 | | - done < failed_tests.txt |
100 | | - |
101 | | - exit 1 |
102 | | - else |
103 | | - echo "All tests passed." |
104 | | - fi |
| 97 | + while IFS= read -r line; do |
| 98 | + echo "##[error]Test Failures: $line" |
| 99 | + done < failed_tests.txt |
| 100 | + |
| 101 | + exit 1 |
| 102 | + else |
| 103 | + echo "All tests passed." |
| 104 | + fi |
105 | 105 |
|
106 | | - - name: SonarCloud Scan |
107 | | - uses: SonarSource/sonarqube-scan-action@master |
108 | | - env: |
109 | | - GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }} # Needed to get PR information, if any |
110 | | - SONAR_TOKEN: ${{ secrets.SONAR_TOKEN }} |
| 106 | + - name: SonarCloud Scan |
| 107 | + uses: SonarSource/sonarqube-scan-action@master |
| 108 | + env: |
| 109 | + GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }} # Needed to get PR information, if any |
| 110 | + SONAR_TOKEN: ${{ secrets.SONAR_TOKEN }} |
0 commit comments