Skip to content

Commit d0bf0f1

Browse files
committed
added
1 parent 2f8263f commit d0bf0f1

File tree

2 files changed

+106
-46
lines changed

2 files changed

+106
-46
lines changed

.github/workflows/coverage.yml

Lines changed: 60 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,60 @@
1+
name: Coverage report
2+
3+
on:
4+
pull_request:
5+
types: [opened]
6+
7+
jobs:
8+
coverage:
9+
runs-on: ubuntu-latest
10+
steps:
11+
- name: Checkout code
12+
uses: actions/checkout@v2
13+
14+
- name: Set up Python
15+
uses: actions/setup-python@v3
16+
with:
17+
python-version: '3.10'
18+
19+
- name: Set up AWS credentials
20+
env:
21+
AWS_ACCESS_KEY_ID: "FOOBARKEY"
22+
AWS_SECRET_ACCESS_KEY: "FOOBARSECRET"
23+
run: |
24+
aws configure set aws_access_key_id $AWS_ACCESS_KEY_ID
25+
aws configure set aws_secret_access_key $AWS_SECRET_ACCESS_KEY
26+
27+
- name: Install dependencies
28+
run: |
29+
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
30+
31+
- name: Run unit tests and generate coverage report for filenameprocessor
32+
run: |
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
39+
40+
- name: List coverage report file
41+
run: |
42+
ls -R /home/runner/work/immunisation-fhir-api/immunisation-fhir-api/backend/coverage_html_report
43+
44+
- name: Aggregate coverage reports
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/coverage_html_report/test_coverage.xml
49+
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/coverage_html_report/*.xml
59+
git commit -m "Add coverage index as XML format."
60+
git push origin ${{ github.head_ref }}

.github/workflows/pr-lint.yaml

Lines changed: 46 additions & 46 deletions
Original file line numberDiff line numberDiff line change
@@ -26,56 +26,56 @@ jobs:
2626
This branch is work on a ticket in the NHS Digital AMB JIRA Project. Here's a handy link to the ticket:
2727
# [${{ env.TICKET_NAME }}](https://nhsd-jira.digital.nhs.uk/browse/${{ env.TICKET_NAME}})
2828
29-
coverage:
30-
runs-on: ubuntu-latest
31-
steps:
32-
- name: Checkout code
33-
uses: actions/checkout@v2
29+
# coverage:
30+
# runs-on: ubuntu-latest
31+
# steps:
32+
# - name: Checkout code
33+
# uses: actions/checkout@v2
3434

35-
- name: Set up Python
36-
uses: actions/setup-python@v3
37-
with:
38-
python-version: '3.10'
35+
# - name: Set up Python
36+
# uses: actions/setup-python@v3
37+
# with:
38+
# python-version: '3.10'
3939

40-
- name: Set up AWS credentials
41-
env:
42-
AWS_ACCESS_KEY_ID: "FOOBARKEY"
43-
AWS_SECRET_ACCESS_KEY: "FOOBARSECRET"
44-
run: |
45-
aws configure set aws_access_key_id $AWS_ACCESS_KEY_ID
46-
aws configure set aws_secret_access_key $AWS_SECRET_ACCESS_KEY
40+
# - name: Set up AWS credentials
41+
# env:
42+
# AWS_ACCESS_KEY_ID: "FOOBARKEY"
43+
# AWS_SECRET_ACCESS_KEY: "FOOBARSECRET"
44+
# run: |
45+
# aws configure set aws_access_key_id $AWS_ACCESS_KEY_ID
46+
# aws configure set aws_secret_access_key $AWS_SECRET_ACCESS_KEY
4747

48-
- name: Install dependencies
49-
run: |
50-
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
48+
# - name: Install dependencies
49+
# run: |
50+
# 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
5151

52-
- name: Run unit tests and generate coverage report for filenameprocessor
53-
run: |
54-
mkdir -p /home/runner/work/immunisation-fhir-api/immunisation-fhir-api/backend/coverage_html_report
55-
coverage run -m unittest discover
56-
coverage report
57-
coverage xml -o /home/runner/work/immunisation-fhir-api/immunisation-fhir-api/backend/coverage_html_report/test_coverage.xml
58-
working-directory: "/home/runner/work/immunisation-fhir-api/immunisation-fhir-api/backend"
59-
continue-on-error: true
52+
# - name: Run unit tests and generate coverage report for filenameprocessor
53+
# run: |
54+
# mkdir -p /home/runner/work/immunisation-fhir-api/immunisation-fhir-api/backend/coverage_html_report
55+
# coverage run -m unittest discover
56+
# coverage report
57+
# coverage xml -o /home/runner/work/immunisation-fhir-api/immunisation-fhir-api/backend/coverage_html_report/test_coverage.xml
58+
# working-directory: "/home/runner/work/immunisation-fhir-api/immunisation-fhir-api/backend"
59+
# continue-on-error: true
6060

61-
- name: List coverage report file
62-
run: |
63-
ls -R /home/runner/work/immunisation-fhir-api/immunisation-fhir-api/backend/coverage_html_report
61+
# - name: List coverage report file
62+
# run: |
63+
# ls -R /home/runner/work/immunisation-fhir-api/immunisation-fhir-api/backend/coverage_html_report
6464

65-
- name: Aggregate coverage reports
66-
run: |
67-
mkdir -p /home/runner/work/immunisation-fhir-api/immunisation-fhir-api/coverage_html_report
68-
rm -rf /home/runner/work/immunisation-fhir-api/immunisation-fhir-api/coverage_html_report/*
69-
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/coverage_html_report/test_coverage.xml
65+
# - name: Aggregate coverage reports
66+
# run: |
67+
# mkdir -p /home/runner/work/immunisation-fhir-api/immunisation-fhir-api/coverage_html_report
68+
# rm -rf /home/runner/work/immunisation-fhir-api/immunisation-fhir-api/coverage_html_report/*
69+
# 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/coverage_html_report/test_coverage.xml
7070

71-
- name: Commit and push coverage reports
72-
if: success()
73-
run: |
74-
git config --global user.name "github-actions[bot]"
75-
git config --global user.email "github-actions[bot]@users.noreply.github.com"
76-
git fetch origin ${{ github.head_ref }}
77-
git checkout ${{ github.head_ref }}
78-
git pull origin ${{ github.head_ref }}
79-
git add /home/runner/work/immunisation-fhir-api/immunisation-fhir-api/coverage_html_report/*.xml
80-
git commit -m "Add coverage index as XML format."
81-
git push origin ${{ github.head_ref }}
71+
# - name: Commit and push coverage reports
72+
# if: success()
73+
# run: |
74+
# git config --global user.name "github-actions[bot]"
75+
# git config --global user.email "github-actions[bot]@users.noreply.github.com"
76+
# git fetch origin ${{ github.head_ref }}
77+
# git checkout ${{ github.head_ref }}
78+
# git pull origin ${{ github.head_ref }}
79+
# git add /home/runner/work/immunisation-fhir-api/immunisation-fhir-api/coverage_html_report/*.xml
80+
# git commit -m "Add coverage index as XML format."
81+
# git push origin ${{ github.head_ref }}

0 commit comments

Comments
 (0)