-
Notifications
You must be signed in to change notification settings - Fork 0
85 lines (78 loc) · 2.81 KB
/
XML_validations.yml
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
name: XML Validation Workflow
on:
push:
branches:
- main
jobs:
checkForMSXMLFiles:
runs-on: ubuntu-latest
outputs:
has_ms_files: ${{ steps.check.outputs.has_ms_files }}
steps:
- name: 🛎️ Checkout code
uses: actions/checkout@v4.1.7
- name: 📁 Check for MS XML files
id: check
run: |
if ls output/ms/*.xml 1> /dev/null 2>&1; then
echo "has_ms_files=true" >> $GITHUB_OUTPUT
else
echo "has_ms_files=false" >> $GITHUB_OUTPUT
echo "No MS XML files found."
fi
wellformedXMLS_MSbasic:
runs-on: ubuntu-latest
needs: checkForMSXMLFiles
if: needs.checkForMSXMLFiles.outputs.has_ms_files == 'true'
steps:
- name: 🛎️ Checkout code
uses: actions/checkout@v4.1.7
- name: ☕ Install dependencies
run: sudo apt-get update && sudo apt-get install -y libxml2-utils
- name: 🤖 Validate MS XML files
run: xmllint --catalogs --noout --schema ./xsd-kmehr/ehealth-kmehr/XSD/kmehr_elements-1_37.xsd ./output/ms/*.xml
wellformedXMLS_PCDHbasic:
runs-on: ubuntu-latest
steps:
- name: 🛎️ Checkout code
uses: actions/checkout@v4.1.7
- name: ☕ Install dependencies
run: sudo apt-get update && sudo apt-get install -y libxml2-utils
- name: 🤖 Validate PCDH XML files
run: |
if [ "$(ls -A output/pcdh/*.xml)" ]; then
xmllint --catalogs --noout --schema ./soa-farmaflux/maindoc/single-message-oa-1.0.xsd ./output/pcdh/*.xml
else
echo "No XML files found in output/pcdh directory. Skipping validation."
fi
compliantTOPCDHRemovalRules:
runs-on: ubuntu-latest
steps:
- name: 🛎️ Checkout code
uses: actions/checkout@v4.1.7
- name: ☕ Install dependencies
run: sudo apt-get update && sudo apt-get install -y libxml2-utils
- name: 🤖 Validate PCDH Removal XML files
run: |
if [ "$(ls -A output/pcdh-removal/*.xml)" ]; then
xmllint --catalogs --noout --schema ./soa-farmaflux/maindoc/single-message-oa-1.0.xsd ./output/pcdh-removal/*.xml
else
echo "No XML files found in output/pcdh-removal directory. Skipping validation."
fi
compliantToMSRules_MSadvancedValidation:
runs-on: ubuntu-latest
needs: [wellformedXMLS_MSbasic]
steps:
- name: 🛎️ Checkout code
uses: actions/checkout@v4.1.7
- uses: actions/setup-node@v4.1.0
name: 📦 Setup Node.js environment
- name: ☕ Install dependencies
run: |
sudo apt-get update
sudo apt-get install -y xmlstarlet
npm install
chmod u+x compliantToMSRules.sh
- name: 🤖 Validate
run: |
./compliantToMSRules.sh