Skip to content

Commit

Permalink
Merge pull request #369 from hpxmlwg/single_xsd
Browse files Browse the repository at this point in the history
Add combined XSD via automatic commit
  • Loading branch information
nmerket authored Feb 15, 2023
2 parents b8d6633 + 4c3f010 commit c85d801
Show file tree
Hide file tree
Showing 6 changed files with 11,419 additions and 4 deletions.
44 changes: 41 additions & 3 deletions .github/workflows/tests.yml
Original file line number Diff line number Diff line change
Expand Up @@ -3,12 +3,12 @@ name: Test Schemas
on: [pull_request]

jobs:
build:
test-xsd:
runs-on: ubuntu-latest
steps:
- uses: actions/checkout@v2
- uses: actions/checkout@v3
- name: Set up Python
uses: actions/setup-python@v2
uses: actions/setup-python@v4
with:
python-version: 3.9
- name: Install dependencies
Expand All @@ -18,3 +18,41 @@ jobs:
- name: Test with pytest
run: |
pytest tests
flatten-xsd:
runs-on: ubuntu-latest
steps:
- uses: actions/checkout@v3
with:
ref: ${{ github.head_ref }}
- name: Install dependencies
run: |
python -m pip install --upgrade pip
pip install lxml
- name: Install software
shell: bash
run: |
export DEBIAN_FRONTEND=noninteractive
sudo apt update
sudo -E apt-get install -y libxml2-utils
- name: Flatten XSD
run: |
cd schemas
python ../scripts/xsdflatten.py HPXML.xsd ../merged_schema/HPXMLMerged.xsd
- name: Commit XSD
run: |
branch_name="${{ github.head_ref }}"
git pull origin $branch_name
git add merged_schema/HPXMLMerged.xsd
git status
if [[ $(git diff --cached --exit-code) ]]; then
git config --global user.email "github-action@users.noreply.github.com"
git config --global user.name "GitHub Action"
git commit -m "Latest HPXMLMerged.xsd"
echo "Pushing to branch: $branch_name"
git push -u origin $branch_name
fi
- name: Validate XSD
run: |
export XSDPATH=merged_schema/HPXMLMerged.xsd
xmllint --schema $XSDPATH examples/audit.xml --noout
Loading

0 comments on commit c85d801

Please sign in to comment.