Skip to content

XSLT40 and SER40 changes resulting from context item becoming context… #364

XSLT40 and SER40 changes resulting from context item becoming context…

XSLT40 and SER40 changes resulting from context item becoming context… #364

Workflow file for this run

name: build-specs
on: push
jobs:
build-and-deploy:
runs-on: ubuntu-latest
env:
HAVE_ACCESS_TOKEN: ${{ secrets.ACCESS_TOKEN != '' }}
HAVE_SAXON_LICENSE: ${{ secrets.SAXON_LICENSE != '' }}
# There’s no particular reason why the TEST_REPOSITORY should be
# a secret. This is the only way I can think of to initialize
# a variable based on the repository that the action is running in,
# rather than the *contents* of that repository.
UPDATE_TESTS: ${{ secrets.TEST_REPOSITORY != '' && secrets.ACCESS_TOKEN != '' }}
AUTODIFF: ${{ secrets.DIFFURI != '' && secrets.DIFFPW != '' }}
PUBLISH_TESTS_FROM: "master"
BRANCH_NAME: ${{ github.ref_name }}
steps:
- name: Install dependencies
run: sudo apt-get install tidy graphviz
- name: Checkout the tests repository
if: ${{ env.UPDATE_TESTS == 'true' && github.ref_name == env.PUBLISH_TESTS_FROM }}
uses: actions/checkout@v3
with:
repository: ${{ secrets.TEST_REPOSITORY }}
token: ${{ secrets.ACCESS_TOKEN }}
ref: 'master'
- name: Save the tests
if: ${{ env.UPDATE_TESTS == 'true' && github.ref_name == env.PUBLISH_TESTS_FROM }}
run: |
mkdir -p /tmp/test-suite/{app,array,docs,fn,map,math,misc,op,prod,ser,upd,xs}
rsync -ar ./app/ /tmp/test-suite/app/
rsync -ar ./array/ /tmp/test-suite/array/
rsync -ar ./docs/ /tmp/test-suite/docs/
rsync -ar ./fn/ /tmp/test-suite/fn/
rsync -ar ./map/ /tmp/test-suite/map/
rsync -ar ./math/ /tmp/test-suite/math/
rsync -ar ./misc/ /tmp/test-suite/misc/
rsync -ar ./op/ /tmp/test-suite/op/
rsync -ar ./prod/ /tmp/test-suite/prod/
rsync -ar ./ser/ /tmp/test-suite/ser/
rsync -ar ./upd/ /tmp/test-suite/upd/
rsync -ar ./xs/ /tmp/test-suite/xs/
- name: Checkout the specifications
uses: actions/checkout@v3
- name: Setup Saxon EE
if: ${{ env.HAVE_SAXON_LICENSE == 'true' }}
run: |
echo "${{ secrets.SAXON_LICENSE }}" > lib/saxon-license.lic
- name: Build
run: |
./gradlew
- name: Cleanup Saxon EE
if: ${{ env.HAVE_SAXON_LICENSE == 'true' }}
run: |
rm lib/saxon-license.lic
- name: Setup DeltaXML
if: ${{ env.AUTODIFF == 'true' }}
run: |
curl -s ${{ secrets.DIFFURI }} | openssl enc -aes-256-cbc -salt -pbkdf2 -d -k ${{ secrets.DIFFPW }} | tar zxf -
- name: Make DeltaXML diffs
if: ${{ env.AUTODIFF == 'true' }}
run: |
sh tools/autodiff.sh build/www/xpath-functions-40/Overview.html
sh tools/autodiff.sh build/www/xslt-40/Overview.html
sh tools/autodiff.sh build/www/xquery-40/xpath-40.html xpath-40-autodiff.html
sh tools/autodiff.sh build/www/xquery-40/xquery-40.html xquery-40-autodiff.html
sh tools/autodiff.sh build/www/xquery-40/shared-40.html shared-40-autodiff.html
sh tools/autodiff.sh build/www/xpath-datamodel-40/Overview.html
sh tools/autodiff.sh build/www/xslt-xquery-serialization-40/Overview.html
- name: Cleanup DeltaXML
if: ${{ env.AUTODIFF == 'true' }}
run: |
rm -rf tools/deltaxml
- name: Deploy master to specifications
if: ${{ env.HAVE_ACCESS_TOKEN == 'true' && github.ref_name == 'master' }}
uses: JamesIves/github-pages-deploy-action@v4
with:
folder: build/www
token: ${{ secrets.ACCESS_TOKEN }}
branch: gh-pages
target-folder: /specifications
- name: Deploy other branches to branch
if: ${{ env.HAVE_ACCESS_TOKEN == 'true' && github.ref_name != 'master' }}
uses: JamesIves/github-pages-deploy-action@v4
with:
folder: build/www
token: ${{ secrets.ACCESS_TOKEN }}
branch: gh-pages
target-folder: /branch/${{ github.ref_name }}
- name: Update the saved tests
if: ${{ env.UPDATE_TESTS == 'true' && github.ref_name == env.PUBLISH_TESTS_FROM }}
run: rsync -ar build/test-suite/ /tmp/test-suite/
- name: Checkout the tests repository again
if: ${{ env.UPDATE_TESTS == 'true' && github.ref_name == env.PUBLISH_TESTS_FROM }}
uses: actions/checkout@v3
with:
repository: ${{ secrets.TEST_REPOSITORY }}
token: ${{ secrets.ACCESS_TOKEN }}
ref: 'master'
- name: Update the tests repository
if: ${{ env.UPDATE_TESTS == 'true' && github.ref_name == env.PUBLISH_TESTS_FROM }}
run: rsync -ar /tmp/test-suite/ ./
- name: Deploy the updated tests
if: ${{ env.UPDATE_TESTS == 'true' && github.ref_name == env.PUBLISH_TESTS_FROM }}
uses: JamesIves/github-pages-deploy-action@v4
with:
repository-name: ${{ secrets.TEST_REPOSITORY }}
token: ${{ secrets.ACCESS_TOKEN }}
branch: master
folder: .
target-folder: /