Include xmllint checks
authorColin Clark <colin.clark@cclark.uk>
Tue, 2 Apr 2024 15:26:18 +0000 (16:26 +0100)
committerColin Clark <colin.clark@cclark.uk>
Tue, 2 Apr 2024 15:26:18 +0000 (16:26 +0100)
.github/workflows/check-build-actions.yml
scripts/test-ancillary-files.sh

index 53a8e30..b1d541e 100644 (file)
@@ -28,6 +28,7 @@ jobs:
     - run: sudo apt-get install desktop-file-utils
     - run: sudo apt-get install gettext
     - run: sudo apt-get install libgtk-3-bin
+    - run: sudo apt-get install libxml2-utils
     - run: sudo apt-get install shellcheck
     - uses: actions/checkout@v3
     - uses: actions/setup-python@v4
@@ -96,6 +97,7 @@ jobs:
     - run: sudo apt-get install libunwind-dev
     - run: sudo apt-get install libwebp-dev
     - run: sudo apt-get install libwebp7
+    - run: sudo apt-get install libxml2-utils
     - run: sudo apt-get install pandoc
     - run: sudo apt-get install shellcheck
     #~ - run: sudo apt-get install libffmpegthumbnailer-dev
index 4aef378..c15cf3f 100755 (executable)
@@ -29,6 +29,7 @@
 ## desktop
 ## scripts
 ## ui
+## xml
 ##
 
 cd "$1" || exit 1
@@ -238,4 +239,25 @@ else
        printf "%s: appstreamcli in org.geeqie.Geeqie.appdata.xml.in: \n%s\n" "$status" "$result"
 fi
 
+# xml files lint
+if [ -z "$(command -v xmllint)" ]
+then
+       printf "ERROR: xmllint is not installed"
+       exit_status=1
+else
+       while read -r line
+       do
+               if [ -n "$line" ]
+               then
+                       if ! xmllint --quiet --nowarning "$line" > /dev/null
+                       then
+                               printf "ERROR: xmllint error in: %s\n" "$line"
+                               exit_status=1
+                       fi
+               fi
+       done << EOF
+$(find ./doc/docbook -name "*.xml")
+EOF
+fi
+
 exit "$exit_status"