Skip to content

Commit

Permalink
🦄 refactor(ci): simplify
Browse files Browse the repository at this point in the history
swith to xmllint
ignore compiliation artifacts
  • Loading branch information
duncdrum committed Oct 7, 2023
1 parent 7613d7f commit 8d398ba
Show file tree
Hide file tree
Showing 2 changed files with 39 additions and 12 deletions.
47 changes: 36 additions & 11 deletions .github/workflows/ci.yml
Original file line number Diff line number Diff line change
Expand Up @@ -29,21 +29,31 @@ jobs:
with:
java-version: '11'
distribution: 'temurin'
- name: Install Build Dependencies
- name: Install packaged dependencies
run: |
sudo apt-get update
sudo apt-get install -y jing libbatik-java libavalon-framework-java libxml2-utils
mkdir lib
mkdir lib
- name: Install 3rd party Dependencies
working-directory: lib
run: |
wget "https://github.com/Saxonica/Saxon-HE/releases/download/SaxonHE11-6/SaxonHE11-6J.zip"
unzip SaxonHE11-6J.zip -d lib
unzip SaxonHE11-6J.zip
rm SaxonHE11-6J.zip
cd lib
wget "https://github.com/schxslt/schxslt/releases/download/v1.9.5/schxslt-cli.jar"
wget "https://raw.githubusercontent.com/TEIC/atop/dev/XSLT/extract-schematron.xslt"
# TODO: atop will do a partial released soon: at that moment the link to extract-schematron.xslt will be updated
# TODO: atop will do a partial released soon: at that moment the link to extract-schematron.xslt will be updated

# VALIDATION
- name: Download schema from TEI release
run: wget "https://tei-c.org/Vault/P5/current/xml/tei/custom/schema/relaxng/tei_odds.rng"
# Validates but exit code 1, disable for now
# - name: Validate ODDs against the tei_odds.rng schema
# run: |
# xmllint --noout --nowarning --relaxng tei_odds.rng tei-betamesaheft.xml
# xmllint --noout --nowarning --relaxng tei_odds.rng tei-betamesaheft-epanded.xml

- name: Validate ODDs against the tei_odds.rng schema
run: |
jing tei_odds.rng tei-betamesaheft.xml
Expand All @@ -60,39 +70,54 @@ jobs:
- name: Schematron validation of main ODD
run: grep -vq 'svrl:text' report-main.xml
- name: Schematron validation of the expanded ODD
run: grep -vq 'svrl:text' report-expanded.xml
run: grep -vq 'svrl:text' report-expanded.xml

# The schemas are generated using the TEIGarare API. Documentation can be found at https://teigarage.tei-c.org/ege-webservice/
# Compile ODD
- name: Generate a compiled ODD of the main ODD
run: |
curl -X 'POST' \
'https://teigarage.tei-c.org/ege-webservice/Conversions/ODD%3Atext%3Axml/ODDC%3Atext%3Axml' \
-H 'Content-Type: multipart/form-data' \
-F '[email protected];type=text/xml' > tei-betamesaheft_compiled.xml
- name: Ensure Result is well-formed
run: xmllint --noout tei-betamesaheft_compiled.xml
- name: Generate a compiled ODD of the expanded version
run: |
curl -X 'POST' \
'https://teigarage.tei-c.org/ege-webservice/Conversions/ODD%3Atext%3Axml/ODDC%3Atext%3Axml' \
-H 'Content-Type: multipart/form-data' \
-F '[email protected];type=text/xml' > tei-betamesaheft-expanded_compiled.xml
# see https://github.com/TEIC/romajs/issues/122
- name: Ensure Result is well-formed
run: xmllint --noout tei-betamesaheft-expanded_compiled.xml
# Generate Relaxng schema from compiled ODDS
- name: Generate RELAXNG schema of the main ODD
run: |
curl -X 'POST' \
'https://teigarage.tei-c.org/ege-webservice/Conversions/ODD%3Atext%3Axml/ODDC%3Atext%3Axml/relaxng%3Aapplication%3Axml-relaxng/' \
-H 'Content-Type: multipart/form-data' \
-F 'fileToConvert=@tei-betamesaheft_compiled.xml;type=text/xml' > tei-betamesaheft.rng
- name: Ensure Result is well-formed
run: xmllint --noout tei-betamesaheft.rng
- name: Generate RELAXNG schema of the expanded version
run: |
curl -X 'POST' \
'https://teigarage.tei-c.org/ege-webservice/Conversions/ODD%3Atext%3Axml/ODDC%3Atext%3Axml/relaxng%3Aapplication%3Axml-relaxng/' \
-H 'Content-Type: multipart/form-data' \
-F 'fileToConvert=@tei-betamesaheft-expanded_compiled.xml;type=text/xml' > tei-betamesaheft-expanded.rng
-F 'fileToConvert=@tei-betamesaheft-expanded_compiled.xml;type=text/xml' > tei-betamesaheft-expanded.rng
- name: Ensure Result is well-formed
run: xmllint --noout tei-betamesaheft-expanded.rng
# Final checks before packaging
# exclude unused cdcc file
- name: Check well-formedness of ODD files
- name: Check well-formedness of all ODD files
run: xmllint --noout tei-*[^cdcc].xml
- name: Check well-formedness of RNG files
run: xmllint --noout *.rng
- name: Check well-formedness of all RNG files
run: xmllint --noout *.rng
# Cleanup and creat xar
- name: Build with Ant
run: ant
run: ant
# Commit updated files to repo
- name: Commit and Push
uses: actions-x/commit@v6
with:
Expand Down
4 changes: 3 additions & 1 deletion .gitignore
Original file line number Diff line number Diff line change
Expand Up @@ -2,4 +2,6 @@
*.processedodd
.DS_Store
build/
lib/
lib/
tei_odds.*
*_compiled.xml

0 comments on commit 8d398ba

Please sign in to comment.