1- name : Coverage report
1+ # name: Coverage report
22
3- on :
4- pull_request :
3+ # on:
4+ # pull_request:
55
6- jobs :
7- coverage :
8- runs-on : ubuntu-latest
9- steps :
10- - name : Checkout code
11- uses : actions/checkout@v2
6+ # jobs:
7+ # coverage:
8+ # runs-on: ubuntu-latest
9+ # steps:
10+ # - name: Checkout code
11+ # uses: actions/checkout@v2
1212
13- - name : Set up Python
14- uses : actions/setup-python@v3
15- with :
16- python-version : ' 3.10'
13+ # - name: Set up Python
14+ # uses: actions/setup-python@v3
15+ # with:
16+ # python-version: '3.10'
1717
18- - name : Set up AWS credentials
19- env :
20- AWS_ACCESS_KEY_ID : " FOOBARKEY"
21- AWS_SECRET_ACCESS_KEY : " FOOBARSECRET"
22- run : |
23- aws configure set aws_access_key_id $AWS_ACCESS_KEY_ID
24- aws configure set aws_secret_access_key $AWS_SECRET_ACCESS_KEY
18+ # - name: Set up AWS credentials
19+ # env:
20+ # AWS_ACCESS_KEY_ID: "FOOBARKEY"
21+ # AWS_SECRET_ACCESS_KEY: "FOOBARSECRET"
22+ # run: |
23+ # aws configure set aws_access_key_id $AWS_ACCESS_KEY_ID
24+ # aws configure set aws_secret_access_key $AWS_SECRET_ACCESS_KEY
2525
26- - name : Install dependencies
27- run : |
28- 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
26+ # - name: Install dependencies
27+ # run: |
28+ # 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
2929
30- - name : Run unit tests and generate coverage report for immunisation-fhir-api
31- run : |
32- mkdir -p /home/runner/work/immunisation-fhir-api/immunisation-fhir-api/backend/coverage_html_report
33- coverage run -m unittest discover
34- coverage report
35- coverage xml -o /home/runner/work/immunisation-fhir-api/immunisation-fhir-api/backend/coverage_html_report/test_coverage.xml
36- working-directory : " /home/runner/work/immunisation-fhir-api/immunisation-fhir-api/backend"
37- continue-on-error : true
30+ # - name: Run unit tests and generate coverage report for immunisation-fhir-api
31+ # run: |
32+ # mkdir -p /home/runner/work/immunisation-fhir-api/immunisation-fhir-api/backend/coverage_html_report
33+ # coverage run -m unittest discover
34+ # coverage report
35+ # coverage xml -o /home/runner/work/immunisation-fhir-api/immunisation-fhir-api/backend/coverage_html_report/test_coverage.xml
36+ # working-directory: "/home/runner/work/immunisation-fhir-api/immunisation-fhir-api/backend"
37+ # continue-on-error: true
3838
39- - name : List coverage report file
40- run : |
41- ls -R /home/runner/work/immunisation-fhir-api/immunisation-fhir-api/backend/coverage_html_report
39+ # - name: List coverage report file
40+ # run: |
41+ # ls -R /home/runner/work/immunisation-fhir-api/immunisation-fhir-api/backend/coverage_html_report
4242
43- - name : Aggregate coverage report
44- run : |
45- mkdir -p /home/runner/work/immunisation-fhir-api/immunisation-fhir-api/coverage_html_report
46- rm -rf /home/runner/work/immunisation-fhir-api/immunisation-fhir-api/coverage_html_report/*
47- mv /home/runner/work/immunisation-fhir-api/immunisation-fhir-api/backend/coverage_html_report/test_coverage.xml /home/runner/work/immunisation-fhir-api/immunisation-fhir-api/test_coverage.xml
43+ # - name: Aggregate coverage report
44+ # run: |
45+ # mkdir -p /home/runner/work/immunisation-fhir-api/immunisation-fhir-api/coverage_html_report
46+ # rm -rf /home/runner/work/immunisation-fhir-api/immunisation-fhir-api/coverage_html_report/*
47+ # mv /home/runner/work/immunisation-fhir-api/immunisation-fhir-api/backend/coverage_html_report/test_coverage.xml /home/runner/work/immunisation-fhir-api/immunisation-fhir-api/test_coverage.xml
4848
49- - name : Commit and push coverage reports
50- if : success()
51- run : |
52- git config --global user.name "github-actions[bot]"
53- git config --global user.email "github-actions[bot]@users.noreply.github.com"
54- git fetch origin ${{ github.head_ref }}
55- git checkout ${{ github.head_ref }}
56- git pull origin ${{ github.head_ref }}
57- git add /home/runner/work/immunisation-fhir-api/immunisation-fhir-api/test_coverage.xml
58- git commit -m "Add coverage index as XML format."
59- git push origin ${{ github.head_ref }}
49+ # - name: Commit and push coverage reports
50+ # if: success()
51+ # run: |
52+ # git config --global user.name "github-actions[bot]"
53+ # git config --global user.email "github-actions[bot]@users.noreply.github.com"
54+ # git fetch origin ${{ github.head_ref }}
55+ # git checkout ${{ github.head_ref }}
56+ # git pull origin ${{ github.head_ref }}
57+ # git add /home/runner/work/immunisation-fhir-api/immunisation-fhir-api/test_coverage.xml
58+ # git commit -m "Add coverage index as XML format."
59+ # git push origin ${{ github.head_ref }}
6060
61- - name : Upload coverage to SonarCloud
62- env :
63- SONAR_TOKEN : ${{ secrets.SONAR_TOKEN }}
64- uses : SonarSource/sonarcloud-github-action@v2
65- with :
66- args : >
67- -Dsonar.projectKey=NHSDigital_immunisation-fhir-api
68- -Dsonar.organization=nhsdigital
69- -Dsonar.python.coverage.reportPaths=test_coverage.xml
61+ # - name: Upload coverage to SonarCloud
62+ # env:
63+ # SONAR_TOKEN: ${{ secrets.SONAR_TOKEN }}
64+ # uses: SonarSource/sonarcloud-github-action@v2
65+ # with:
66+ # args: >
67+ # -Dsonar.projectKey=NHSDigital_immunisation-fhir-api
68+ # -Dsonar.organization=nhsdigital
69+ # -Dsonar.python.coverage.reportPaths=test_coverage.xml
0 commit comments