adding secure-only SW model #221
Workflow file for this run
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
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@v44 | |
- 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@v4 | |
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 |