Skip to content

Commit

Permalink
Workflows with validation for generated XMLs
Browse files Browse the repository at this point in the history
  • Loading branch information
HorstOeko committed Nov 8, 2024
1 parent 7ac856b commit 93efe40
Show file tree
Hide file tree
Showing 2 changed files with 58 additions and 0 deletions.
31 changes: 31 additions & 0 deletions .github/workflows/build.ci.yml
Original file line number Diff line number Diff line change
Expand Up @@ -17,6 +17,17 @@ on:
- "master"
workflow_dispatch:

env:
VALIDATORURL: https://github.com/itplr-kosit/validator/releases/download/v1.5.0/validator-1.5.0-distribution.zip
VALIDATORSCENARIOURL: https://github.com/itplr-kosit/validator-configuration-xrechnung/releases/download/release-2023-07-31/validator-configuration-xrechnung_3.0.0_2023-07-31.zip
VALIDATORPATH: build/validator
VALIDATORZIPFILENAME: validator.zip
VALIDATORSCENARIOZIPFILENAME: validator-configuration.zip
VALIDATORJARFILENAME: validationtool-1.5.0-standalone.jar
VALIDATORSCENARIOFILENAME: scenarios.xml
PHPDOCUMENTORURL: https://phpdoc.org/phpDocumentor.phar
PHPDOCUMENTORFILENAME: phpDocumentor.phar

jobs:
build:
permissions: write-all
Expand All @@ -37,6 +48,12 @@ jobs:
extensions: dom, curl, libxml, mbstring, zip, pcntl, pdo, bcmath, intl, gd, exif, iconv, imagick, json, xdebug
coverage: xdebug

- name: Set up JDK 11
uses: actions/setup-java@v4
with:
java-version: "11"
distribution: "adopt"

- name: Get Composer Cache Directory
id: composer-cache
run: |
Expand Down Expand Up @@ -111,6 +128,20 @@ jobs:
env:
XDEBUG_MODE: coverage

- name: Run Tests (Schematron)
run: |
set -e
rm -rf $VALIDATORPATH
mkdir $VALIDATORPATH
wget $VALIDATORURL -O $VALIDATORPATH/$VALIDATORZIPFILENAME
wget $VALIDATORSCENARIOURL -O $VALIDATORPATH/$VALIDATORSCENARIOZIPFILENAME
unzip $VALIDATORPATH/$VALIDATORZIPFILENAME -d $VALIDATORPATH
unzip $VALIDATORPATH/$VALIDATORSCENARIOZIPFILENAME -d $VALIDATORPATH
for afile in $(find . -type f -name '*.xml' -path './build/generated/*.xml' -print); do
java -jar $VALIDATORPATH/$VALIDATORJARFILENAME -r $VALIDATORPATH -s $VALIDATORPATH/$VALIDATORSCENARIOFILENAME $afile
done
rm -rf $VALIDATORPATH
- name: Publish Unit Test Results
uses: EnricoMi/publish-unit-test-result-action@v2
if: github.event_name != 'pull_request'
Expand Down
27 changes: 27 additions & 0 deletions .github/workflows/build.release.yml
Original file line number Diff line number Diff line change
Expand Up @@ -10,6 +10,13 @@ on:
- "examples/**"

env:
VALIDATORURL: https://github.com/itplr-kosit/validator/releases/download/v1.5.0/validator-1.5.0-distribution.zip
VALIDATORSCENARIOURL: https://github.com/itplr-kosit/validator-configuration-xrechnung/releases/download/release-2023-07-31/validator-configuration-xrechnung_3.0.0_2023-07-31.zip
VALIDATORPATH: build/validator
VALIDATORZIPFILENAME: validator.zip
VALIDATORSCENARIOZIPFILENAME: validator-configuration.zip
VALIDATORJARFILENAME: validationtool-1.5.0-standalone.jar
VALIDATORSCENARIOFILENAME: scenarios.xml
PHPDOCUMENTORURL: https://phpdoc.org/phpDocumentor.phar
PHPDOCUMENTORFILENAME: phpDocumentor.phar

Expand All @@ -29,6 +36,12 @@ jobs:
extensions: dom, curl, libxml, mbstring, zip, pcntl, pdo, bcmath, intl, gd, exif, iconv, imagick, json, xdebug
coverage: xdebug

- name: Set up JDK 11
uses: actions/setup-java@v4
with:
java-version: "11"
distribution: "adopt"

- name: Get Composer Cache Directory
id: composer-cache
run: |
Expand Down Expand Up @@ -103,6 +116,20 @@ jobs:
env:
XDEBUG_MODE: coverage

- name: Run Tests (Schematron)
run: |
set -e
rm -rf $VALIDATORPATH
mkdir $VALIDATORPATH
wget $VALIDATORURL -O $VALIDATORPATH/$VALIDATORZIPFILENAME
wget $VALIDATORSCENARIOURL -O $VALIDATORPATH/$VALIDATORSCENARIOZIPFILENAME
unzip $VALIDATORPATH/$VALIDATORZIPFILENAME -d $VALIDATORPATH
unzip $VALIDATORPATH/$VALIDATORSCENARIOZIPFILENAME -d $VALIDATORPATH
for afile in $(find . -type f -name '*.xml' -path './build/generated/*.xml' -print); do
java -jar $VALIDATORPATH/$VALIDATORJARFILENAME -r $VALIDATORPATH -s $VALIDATORPATH/$VALIDATORSCENARIOFILENAME $afile
done
rm -rf $VALIDATORPATH
- name: Documentation
continue-on-error: true
run: |
Expand Down

0 comments on commit 93efe40

Please sign in to comment.