66 - master
77 pull_request :
88 types : [labeled, opened, synchronize, reopened, unlabeled]
9- env :
10- SCRIPT_FOLDER : ./.github/scripts
11- RUN_TEST : source ../.github/scripts/run_test.sh
129
1310jobs :
1411 sonarcloud :
1512 name : SonarCloud
1613 runs-on : ubuntu-latest
1714 strategy :
1815 matrix :
19- python-version : ['3.11']
16+ python-version : ['3.11', '3.10' ]
2017
2118 steps :
2219 - uses : actions/checkout@v4
2825
2926 - uses : actions/setup-python@v5
3027 with :
31- python-version : ${{ matrix.python-version }}
28+ python-version : |
29+ 3.10
30+ 3.11
3231 cache : ' poetry'
3332
33+ - name : Cache global Poetry virtualenvs
34+
35+ uses : actions/cache@v4
36+ with :
37+ path : ~/.cache/pypoetry/virtualenvs
38+ key : ${{ runner.os }}-poetry-global-venv-py${{ matrix.python-version || 'all' }}-${{ hashFiles('**/poetry.lock') }}
39+ restore-keys : |
40+ ${{ runner.os }}-poetry-global-venv-py${{ matrix.python-version || 'all' }}-
41+
42+
3443 - name : Set up AWS credentials
3544 env :
3645 AWS_ACCESS_KEY_ID : " FOOBARKEY"
@@ -39,17 +48,47 @@ jobs:
3948 aws configure set aws_access_key_id $AWS_ACCESS_KEY_ID
4049 aws configure set aws_secret_access_key $AWS_SECRET_ACCESS_KEY
4150
42- - name : Chmod .github directory
43- run : |
44- chmod +x $SCRIPT_FOLDER/*.sh
51+ # - name: Run unittest with filenameprocessor-coverage
52+ # working-directory: filenameprocessor
53+ # id: filenameprocessor
54+ # continue-on-error: true
55+ # run: |
56+ # poetry env use 3.10
57+ # poetry install
58+ # poetry run coverage run -m unittest discover || echo "filenameprocessor tests failed" >> ../failed_tests.txt
59+ # poetry run coverage xml -o ../sonarcloud-coverage-filenameprocessor-coverage.xml
4560
46- - name : Cache global Poetry virtualenvs
47- uses : actions/cache@v4
48- with :
49- path : ~/.cache/pypoetry/virtualenvs
50- key : ${{ runner.os }}-poetry-global-venv-py${{ matrix.python-version }}-${{ hashFiles('**/poetry.lock') }}
51- restore-keys : |
52- ${{ runner.os }}-poetry-global-venv-py${{ matrix.python-version }}-
61+ # - name: Run unittest with recordprocessor-coverage
62+ # working-directory: recordprocessor
63+ # id: recordprocessor
64+ # continue-on-error: true
65+ # run: |
66+ # poetry env use 3.10
67+ # poetry install
68+ # poetry run coverage run -m unittest discover || echo "recordprocessor tests failed" >> ../failed_tests.txt
69+ # poetry run coverage xml -o ../sonarcloud-coverage-recordprocessor-coverage.xml
70+
71+ # # This step is redundant - all of these tests will be run in the backend step below
72+ # - name: Run unittest with recordforwarder-coverage
73+ # working-directory: backend
74+ # id: recordforwarder
75+ # continue-on-error: true
76+ # run: |
77+ # poetry env use 3.11
78+ # poetry install
79+ # poetry run coverage run -m unittest discover -s "./tests" -p "*batch*.py" || echo "recordforwarder tests failed" >> ../failed_tests.txt
80+ # poetry run coverage xml -o ../sonarcloud-coverage-recordforwarder-coverage.xml
81+
82+ - name : Run unittest with coverage-ack-lambda
83+ if : matrix.python-version == '3.10'
84+ working-directory : ack_backend
85+ id : acklambda
86+ continue-on-error : true
87+ run : |
88+ poetry env use 3.10
89+ poetry install
90+ poetry run coverage run -m unittest discover || echo "ack-lambda tests failed" >> ../failed_tests.txt
91+ poetry run coverage xml -o ../sonarcloud-coverage-ack-lambda.xml
5392
5493 - name : Run unittest with coverage-delta
5594 if : matrix.python-version == '3.11'
5998 PYTHONPATH : delta_backend/src:delta_backend/tests
6099 continue-on-error : true
61100 run : |
62- $RUN_TEST 3.11 delta_backend delta.xml
101+ poetry env use 3.11
102+ poetry install
103+ poetry run coverage run -m unittest discover || echo "delta tests failed" >> ../failed_tests.txt
104+ poetry run coverage xml -o ../sonarcloud-coverage-delta.xml
105+
106+ # - name: Run unittest with coverage-fhir-api
107+ # working-directory: backend
108+ # id: fhirapi
109+ # continue-on-error: true
110+ # run: |
111+ # poetry env use 3.11
112+ # poetry install
113+ # poetry run coverage run -m unittest discover || echo "fhir-api tests failed" >> ../failed_tests.txt
114+ # poetry run coverage xml -o ../sonarcloud-coverage.xml
115+
116+ # - name: Run unittest with coverage-mesh-processor
117+ # working-directory: mesh_processor
118+ # id: meshprocessor
119+ # continue-on-error: true
120+ # run: |
121+ # poetry env use 3.10
122+ # poetry install
123+ # poetry run coverage run -m unittest discover || echo "mesh_processor tests failed" >> ../failed_tests.txt
124+ # poetry run coverage xml -o ../sonarcloud-mesh_processor-coverage.xml
63125
64126 - name : Run Test Failure Summary
65127 id : check_failure
76138 else
77139 echo "All tests passed."
78140 fi
141+
142+ - name : SonarCloud Scan
143+ uses : SonarSource/sonarqube-scan-action@master
144+ env :
145+ GITHUB_TOKEN : ${{ secrets.GITHUB_TOKEN }} # Needed to get PR information, if any
146+ SONAR_TOKEN : ${{ secrets.SONAR_TOKEN }}
0 commit comments