Skip to content

Commit 42d969c

Browse files
NPA-3897: Expanded GH action to run all
1 parent 2d09bfd commit 42d969c

File tree

2 files changed

+109
-25
lines changed

2 files changed

+109
-25
lines changed

.github/workflows/openapi-validate.yml

Lines changed: 80 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -29,4 +29,83 @@ jobs:
2929
3030
- name: Run Python script for all files
3131
run: |
32-
make schema-consent
32+
make schema-consent
33+
34+
GET_RelatedPerson:
35+
name: GET Related Person test
36+
runs-on: ubuntu-latest
37+
steps:
38+
- name: Checkout repository
39+
uses: actions/checkout@v4
40+
41+
- name: Set up Python
42+
uses: actions/setup-python@v5
43+
with:
44+
python-version: 3.9
45+
46+
- name: Install Poetry
47+
shell: bash
48+
run: |
49+
pipx install poetry==1.8.5
50+
51+
- name: Install Script Packages with Poetry
52+
shell: bash
53+
run: |
54+
poetry install --all-extras
55+
56+
- name: Run Python script for all files
57+
run: |
58+
make schema-related-person
59+
60+
POST_Questionnaire:
61+
name: POST questionnaire test
62+
runs-on: ubuntu-latest
63+
steps:
64+
- name: Checkout repository
65+
uses: actions/checkout@v4
66+
67+
- name: Set up Python
68+
uses: actions/setup-python@v5
69+
with:
70+
python-version: 3.9
71+
72+
- name: Install Poetry
73+
shell: bash
74+
run: |
75+
pipx install poetry==1.8.5
76+
77+
- name: Install Script Packages with Poetry
78+
shell: bash
79+
run: |
80+
poetry install --all-extras
81+
82+
- name: Run Python script for all files
83+
run: |
84+
make schema-questionnaire
85+
86+
87+
Errors:
88+
name: Error schema test
89+
runs-on: ubuntu-latest
90+
steps:
91+
- name: Checkout repository
92+
uses: actions/checkout@v4
93+
94+
- name: Set up Python
95+
uses: actions/setup-python@v5
96+
with:
97+
python-version: 3.9
98+
99+
- name: Install Poetry
100+
shell: bash
101+
run: |
102+
pipx install poetry==1.8.5
103+
104+
- name: Install Script Packages with Poetry
105+
shell: bash
106+
run: |
107+
poetry install --all-extras
108+
109+
- name: Run Python script for all files
110+
run: |
111+
make schema-errors

Makefile

Lines changed: 29 additions & 24 deletions
Original file line numberDiff line numberDiff line change
@@ -85,36 +85,41 @@ test-prod:
8585
--junitxml=test-report.xml \
8686

8787
# Run schema validation check
88+
GREEN := \033[32m
89+
RESET := \033[0m
8890

89-
schema-consent:
9091

92+
93+
schema-all:
94+
make schema-consent \
95+
schema-related-person \
96+
schema-questionnaire \
97+
schema-errors
98+
99+
schema-consent:
91100
@for file in specification/examples/responses/GET_Consent/*.yaml; do \
92-
if [ "$$file" = "specification/examples/responses/GET_Consent/filtered-relationships-status-active-include-details.yaml" ]; then \
93-
continue; \
94-
fi; \
95-
if [ "$$file" = "specification/examples/responses/GET_Consent/multiple-relationships-include-patient.yaml" ]; then \
96-
continue; \
97-
fi; \
98-
if [ "$$file" = "specification/examples/responses/GET_Consent/multiple-relationships-include-performer-patient.yaml" ]; then \
99-
continue; \
100-
fi; \
101-
if [ "$$file" = "specification/examples/responses/GET_Consent/multiple-relationships-include-performer.yaml" ]; then \
102-
continue; \
103-
fi; \
104-
if [ "$$file" = "specification/examples/responses/GET_Consent/single-consenting-adult-relationship-include-performer-patient.yaml" ]; then \
105-
continue; \
106-
fi; \
107-
if [ "$$file" = "specification/examples/responses/GET_Consent/single-mother-child-relationship-include-performer-patient.yaml" ]; then \
108-
continue; \
109-
fi; \
110101
echo "Processing $$file"; \
111102
poetry run python scripts/validate_schema.py consent "$$(realpath $$file)"; \
103+
echo -e "$(GREEN)Success!$(RESET)"; \
112104
done
113105

106+
schema-related-person:
107+
@for file in specification/examples/responses/GET_RelatedPerson/*.yaml; do \
108+
echo "Processing $$file"; \
109+
poetry run python scripts/validate_schema.py relatedperson "$$(realpath $$file)"; \
110+
echo -e "$(GREEN)Success!$(RESET)"; \
111+
done
114112

115-
# cd scripts
113+
schema-questionnaire:
114+
@for file in specification/examples/responses/POST_Questionnaireresponse/*.yaml; do \
115+
echo "Processing $$file"; \
116+
poetry run python scripts/validate_schema.py operationoutcome "$$(realpath $$file)"; \
117+
echo -e "$(GREEN)Success!$(RESET)"; \
118+
done
116119

117-
# $(foreach file, $(FILES), poetry run python scripts/validate_schema.py consent $(file)";)
118-
#
119-
# @for file in ../specification/examples/responses/GET_Consent/*.yaml; do echo $$file; done
120-
# @for file in ../specification/examples/responses/GET_Consent/*.yaml; do poetry run python scripts/validate_schema.py consent $$file; done
120+
schema-errors:
121+
@for file in specification/examples/responses/errors/*.yaml; do \
122+
echo "Processing $$file"; \
123+
poetry run python scripts/validate_schema.py operationoutcome "$$(realpath $$file)"; \
124+
echo -e "$(GREEN)Success!$(RESET)"; \
125+
done

0 commit comments

Comments
 (0)