-
Notifications
You must be signed in to change notification settings - Fork 21
74 lines (73 loc) · 2.47 KB
/
schema.yaml
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
name: Validate schemata
on:
workflow_dispatch:
pull_request:
branches:
- main
paths:
- '.github/workflows/schema.yaml'
- '.github/download-pack-index.py'
- 'schema/**'
- 'test/pack_schema_version_history.py'
jobs:
pack:
name: Validate pack schema
runs-on: ubuntu-20.04
steps:
- uses: actions/checkout@v4
with:
ref: ${{ github.event.pull_request.head.sha }}
fetch-depth: 0
- id: files
uses: tj-actions/changed-files@v35
- name: Install packages
run: |
sudo apt-get update
sudo apt-get install --no-install-recommends -y libxml2-utils
sudo pip install progress python-dateutil
- name: Fetch Keil index
run: wget https://www.keil.com/pack/index.pidx
- name: Cache Keil index pdsc files
uses: actions/cache@v3
id: cache
with:
path: .Web
key: keilindex-${{ hashFiles('index.pidx') }}
- name: Fill cache
if: ${{ steps.cache.outputs.cache-hit != 'true' }}
run: python3 .github/download-pack-index.py -f
- name: Run xmllint against XMLSchema.xsd
run: |
wget https://www.w3.org/2012/04/XMLSchema.xsd
xmllint --noout --schema XMLSchema.xsd schema/PACK.xsd
- name: Run xmllint against Keil index
run: |
rc=0
for f in $(find .Web -name *.pdsc); do
if ! xmllint --noout --schema schema/PACK.xsd $f; then
echo "::error file=schema/PACK.xsd::Schema validation failed for $(basename $f)"
rc=1
fi
done
exit $rc
- name: Check schema version history
run: |
echo "${{ github.event.pull_request.base.sha }}" > .git/ORIG_HEAD
python test/pack_schema_version_history.py ${{ steps.files.outputs.all_changed_files }}
index:
name: Validate index schema
runs-on: ubuntu-20.04
steps:
- uses: actions/checkout@v4
- name: Install packages
run: |
sudo apt-get update
sudo apt-get install --no-install-recommends -y libxml2-utils
- name: Run xmllint against XMLSchema.xsd
run: |
wget https://www.w3.org/2012/04/XMLSchema.xsd
xmllint --noout --schema XMLSchema.xsd schema/PackIndex.xsd
- name: Run xmllint against keil.pidx
run: |
wget https://www.keil.com/pack/keil.pidx
xmllint --noout --schema schema/PackIndex.xsd keil.pidx