Skip to content

Commit

Permalink
ci: Add XML schema validation
Browse files Browse the repository at this point in the history
  • Loading branch information
luk1337 committed Oct 1, 2024
1 parent 8f9dd3e commit 96cf860
Show file tree
Hide file tree
Showing 2 changed files with 24 additions and 1 deletion.
7 changes: 6 additions & 1 deletion .github/workflows/check.yml
Original file line number Diff line number Diff line change
Expand Up @@ -9,4 +9,9 @@ jobs:
steps:
- uses: actions/checkout@v4
- run: sudo apt -y install libxml2-utils
- run: xmllint --noout *.xml
- run: |
if [ -f manifest.xsd ]; then
xmllint --noout --schema manifest.xsd *.xml
else
xmllint --noout *.xml
fi
18 changes: 18 additions & 0 deletions manifest.xsd
Original file line number Diff line number Diff line change
@@ -0,0 +1,18 @@
<?xml version="1.0"?>
<xs:schema xmlns:xs="http://www.w3.org/2001/XMLSchema" version="2.0" elementFormDefault="qualified" attributeFormDefault="unqualified">
<xs:element name="manifest">
<xs:complexType>
<xs:sequence>
<xs:element name="project" maxOccurs="unbounded" type="project"/>
</xs:sequence>
</xs:complexType>
</xs:element>

<xs:complexType name="project">
<xs:attribute name="name" type="xs:string" use="required"/>
<xs:attribute name="path" type="xs:string" use="required"/>
<xs:attribute name="revision" type="xs:string" use="required"/>
<xs:attribute name="groups" type="xs:string"/>
<xs:attribute name="clone-depth" type="xs:int" use="required"/>
</xs:complexType>
</xs:schema>

0 comments on commit 96cf860

Please sign in to comment.