diff options
author | Albert Krewinkel <albert@zeitkraut.de> | 2020-10-30 21:01:43 +0100 |
---|---|---|
committer | Albert Krewinkel <albert@zeitkraut.de> | 2020-10-31 15:20:30 +0100 |
commit | 07e434850d4a1d84179a5e75791e60ca254a4f98 (patch) | |
tree | 2a62e0b4b12c0b948f4434ab519c081e18fb4f49 | |
parent | f1f2728259ca0258a9870028a5c05b5973efdc20 (diff) | |
download | pandoc-07e434850d4a1d84179a5e75791e60ca254a4f98.tar.gz |
CI: validate JATS old-style writer test output
-rw-r--r-- | .github/workflows/format-validation.yml | 47 |
1 files changed, 47 insertions, 0 deletions
diff --git a/.github/workflows/format-validation.yml b/.github/workflows/format-validation.yml new file mode 100644 index 000000000..5928d0376 --- /dev/null +++ b/.github/workflows/format-validation.yml @@ -0,0 +1,47 @@ +name: Format validation + +on: + push: + paths-ignore: + - '*' + - '!/test/writer.*' + - '!/test/tables.*' + pull_request: + paths-ignore: + - '*' + - '!/test/writer.*' + - '!/test/tables.*' + +jobs: + jats: + name: JATS + runs-on: ubuntu-latest + env: + VALIDATOR_URL: "https://jats-validator.hubmed.org/dtd/" + strategy: + fail-fast: false + matrix: + tagset: + - articleauthoring + - publishing + - archiving + file: + - writer + # tables are not supported yet, the files contain only snippets. + steps: + - name: Checkout + uses: actions/checkout@v2 + + - name: Validate + run: | + filename=test/${{ matrix.file }}.jats_${{ matrix.tagset }} + echo "$filename" + json="$(curl --form "xml=@${filename}" --silent "$VALIDATOR_URL")" + echo "$json" + err_count="$(echo "$json" | jq '.errors | length')" + if [ "$err_count" -eq 0 ]; then + exit 0 + else + printf "Validator report:\n%s" "$json" + exit 1 + fi |