Skip to content

Merge pull request #14 from Henze-Digital/develop #38

Merge pull request #14 from Henze-Digital/develop

Merge pull request #14 from Henze-Digital/develop #38

Workflow file for this run

name: Building and Testing
on: [push, pull_request]
jobs:
build:
name: Build
runs-on: ubuntu-latest
steps:
- name: Checkout code
uses: actions/checkout@v4
- name: Build xar package
run: ant clean xar
- name: Archive xar package
uses: actions/upload-artifact@v4
with:
name: xar-package
path: build/*.xar
test:
needs: build
name: Test
runs-on: ubuntu-latest
strategy:
fail-fast: false
matrix:
include:
- DOCKER_IMAGE: stadlerpeter/existdb:6
EXIST_AUTODEPLOY: /opt/exist/autodeploy
- DOCKER_IMAGE: existdb/existdb:6.2.0
EXIST_AUTODEPLOY: /exist/autodeploy
- DOCKER_IMAGE: existdb/existdb:5.5.1
EXIST_AUTODEPLOY: /exist/autodeploy
steps:
- name: Download xar package
uses: actions/download-artifact@v4
with:
name: xar-package
path: xars
- name: Download additional xar packages
run: |
curl -LsS http://exist-db.org/exist/apps/public-repo/public/functx-1.0.1.xar -o xars/functx-1.0.1.xar
curl -LsS http://exist-db.org/exist/apps/public-repo/public/templating-1.0.2.xar -o xars/templating-1.0.2.xar
- name: Create Docker container
run: |
docker create --name exist -p 8080:8080 ${{ matrix.DOCKER_IMAGE }}
for i in xars/*.xar ; do docker cp $i exist:${{ matrix.EXIST_AUTODEPLOY }}/ ; done
- name: Run Docker container
run: |
docker start exist
i=0 ; while (! docker inspect exist | grep -e Status....healthy) ; do if ((i > 30)) ; then echo ' **** timeout ... aborting **** ' ; exit 1 ; else sleep 5 ; echo waiting for container ... ; i=$((i+1)) ; fi ; done
- name: Run test suite
run: curl -LsS http://localhost:8080/exist/apps/WeGA-WebApp-lib/testing/run-tests.xql -o report.xml
- name: Parse test results
run: grep testsuite report.xml && (! grep 'failures="[1-9]' report.xml) && (! grep 'errors="[1-9]' report.xml)
shell: bash {0}
- name: Error output
if: ${{ failure() }}
run: cat report.xml