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- pwd
33- mkdir -p /home/runner/work/immunisation-fhir-api/immunisation-fhir-api/backend/coverage_html_report
34- coverage run -m unittest discover
35- coverage report
36- coverage xml -o /home/runner/work/immunisation-fhir-api/immunisation-fhir-api/backend/coverage_html_report/test_coverage.xml
37- working-directory : " /home/runner/work/immunisation-fhir-api/immunisation-fhir-api/backend"
38- continue-on-error : true
30+ # - name: Run unit tests and generate coverage report for immunisation-fhir-api
31+ # run: |
32+ # pwd
33+ # mkdir -p /home/runner/work/immunisation-fhir-api/immunisation-fhir-api/backend/coverage_html_report
34+ # coverage run -m unittest discover
35+ # coverage report
36+ # coverage xml -o /home/runner/work/immunisation-fhir-api/immunisation-fhir-api/backend/coverage_html_report/test_coverage.xml
37+ # working-directory: "/home/runner/work/immunisation-fhir-api/immunisation-fhir-api/backend"
38+ # continue-on-error: true
3939
40- - name : List coverage report file
41- run : |
42- ls -R /home/runner/work/immunisation-fhir-api/immunisation-fhir-api/backend/coverage_html_report
40+ # - name: List coverage report file
41+ # run: |
42+ # ls -R /home/runner/work/immunisation-fhir-api/immunisation-fhir-api/backend/coverage_html_report
4343
44- - name : Aggregate coverage report
45- run : |
46- mkdir -p /home/runner/work/immunisation-fhir-api/immunisation-fhir-api/coverage_html_report
47- rm -rf /home/runner/work/immunisation-fhir-api/immunisation-fhir-api/coverage_html_report/*
48- 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
44+ # - name: Aggregate coverage report
45+ # run: |
46+ # mkdir -p /home/runner/work/immunisation-fhir-api/immunisation-fhir-api/coverage_html_report
47+ # rm -rf /home/runner/work/immunisation-fhir-api/immunisation-fhir-api/coverage_html_report/*
48+ # 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
4949
50- # - name: Commit and push coverage reports
51- # if: success()
52- # run: |
53- # git config --global user.name "github-actions[bot]"
54- # git config --global user.email "github-actions[bot]@users.noreply.github.com"
55- # git fetch origin ${{ github.head_ref }}
56- # git checkout ${{ github.head_ref }}
57- # git pull origin ${{ github.head_ref }}
58- # git add /home/runner/work/immunisation-fhir-api/immunisation-fhir-api/test_coverage.xml
59- # git commit -m "Add coverage index as XML format."
60- # git push origin ${{ github.head_ref }}
50+ # # - name: Commit and push coverage reports
51+ # # if: success()
52+ # # run: |
53+ # # git config --global user.name "github-actions[bot]"
54+ # # git config --global user.email "github-actions[bot]@users.noreply.github.com"
55+ # # git fetch origin ${{ github.head_ref }}
56+ # # git checkout ${{ github.head_ref }}
57+ # # git pull origin ${{ github.head_ref }}
58+ # # git add /home/runner/work/immunisation-fhir-api/immunisation-fhir-api/test_coverage.xml
59+ # # git commit -m "Add coverage index as XML format."
60+ # # git push origin ${{ github.head_ref }}
6161
62- # - name: Upload coverage to SonarCloud
63- # env:
64- # SONAR_TOKEN: ${{ secrets.SONAR_TOKEN }}
65- # uses: SonarSource/sonarcloud-github-action@v2
66- # with:
67- # args: >
68- # -Dsonar.projectKey=NHSDigital_immunisation-fhir-api
69- # -Dsonar.organization=nhsdigital
70- # -Dsonar.python.coverage.reportPaths=test_coverage.xml
62+ # # - name: Upload coverage to SonarCloud
63+ # # env:
64+ # # SONAR_TOKEN: ${{ secrets.SONAR_TOKEN }}
65+ # # uses: SonarSource/sonarcloud-github-action@v2
66+ # # with:
67+ # # args: >
68+ # # -Dsonar.projectKey=NHSDigital_immunisation-fhir-api
69+ # # -Dsonar.organization=nhsdigital
70+ # # -Dsonar.python.coverage.reportPaths=test_coverage.xml
0 commit comments