Skip to content

Commit

Permalink
[INFR] PDF validation added to CI-Workflow
Browse files Browse the repository at this point in the history
  • Loading branch information
HorstOeko committed Dec 4, 2024
1 parent 1e5ffc9 commit 8e477e3
Showing 1 changed file with 33 additions and 0 deletions.
33 changes: 33 additions & 0 deletions .github/workflows/build.ci.yml
Original file line number Diff line number Diff line change
Expand Up @@ -28,6 +28,9 @@ env:
VALIDATORSCENARIOFILENAME: scenarios.xml
PHPDOCUMENTORURL: https://phpdoc.org/phpDocumentor.phar
PHPDOCUMENTORFILENAME: phpDocumentor.phar
VERAPDFURL: https://software.verapdf.org/rel/verapdf-installer.zip
VERAPDFPATH: build/verapdf
VERAPDFZIPFILENAME: verapdf.zip

jobs:
build:
Expand Down Expand Up @@ -146,6 +149,36 @@ jobs:
java -jar $VALIDATORPATH/$VALIDATORJARFILENAME -r $VALIDATORPATH -s $VALIDATORPATH/$VALIDATORSCENARIOFILENAME examples/factur-x.xml
rm -rf build/validator
- name: Run Tests (VeraPDF)
continue-on-error: true
run: |
set -e
rm -rf $VERAPDFPATH
mkdir $VERAPDFPATH
wget $VERAPDFURL -O $VERAPDFPATH/$VERAPDFZIPFILENAME
unzip -j $VERAPDFPATH/$VERAPDFZIPFILENAME -d $VERAPDFPATH
rm -f $VERAPDFPATH/$VERAPDFZIPFILENAME
echo "<?xml version=\"1.0\" encoding=\"UTF-8\" standalone=\"no\"?>
<AutomatedInstallation langpack=\"eng\">
<com.izforge.izpack.panels.htmlhello.HTMLHelloPanel id=\"welcome\"/>
<com.izforge.izpack.panels.target.TargetPanel id=\"install_dir\">
<installpath>$VERAPDFPATH</installpath>
</com.izforge.izpack.panels.target.TargetPanel>
<com.izforge.izpack.panels.packs.PacksPanel id=\"sdk_pack_select\">
<pack index=\"0\" name=\"veraPDF Mac and *nix Scripts\" selected=\"true\"/>
<pack index=\"1\" name=\"veraPDF Validation model\" selected=\"true\"/>
<pack index=\"2\" name=\"veraPDF Documentation\" selected=\"true\"/>
<pack index=\"3\" name=\"veraPDF Sample Plugins\" selected=\"true\"/>
</com.izforge.izpack.panels.packs.PacksPanel>
<com.izforge.izpack.panels.install.InstallPanel id=\"install\"/>
<com.izforge.izpack.panels.finish.FinishPanel id=\"finish\"/>
</AutomatedInstallation>" > $VERAPDFPATH/install.xml
VERAPDFINSTALLJAR=$(find $VERAPDFPATH -type f -name "*.jar" | head -n 1); [[ -z "$VERAPDFINSTALLJAR" ]] && { echo "No veraPDF installer found" >&2; exit 1; } || echo "veraPDF installer fount at $VERAPDFINSTALLJAR"
java -jar $VERAPDFINSTALLJAR $VERAPDFPATH/install.xml
php -f examples/En16931SimpleWithPdf.php
VERAPDFRESULT=$($VERAPDFPATH/verapdf --format text examples/fullpdf.pdf)
[[ $VERAPDFRESULT == PASS* ]] || { echo "Error: PDF validation not passed" >&2; exit 1; }
- name: Publish Unit Test Results
uses: EnricoMi/publish-unit-test-result-action@v2
if: github.event_name != 'pull_request'
Expand Down

0 comments on commit 8e477e3

Please sign in to comment.