Merge pull request #1530 from michaelhkay/1500-character-map-function #872
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
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 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/[email protected] | |
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/[email protected] | |
with: | |
folder: build/www | |
token: ${{ secrets.ACCESS_TOKEN }} | |
branch: gh-pages | |
target-folder: /branch/${{ github.ref_name }} | |
- name: Save the updated tests | |
if: ${{ env.UPDATE_TESTS == 'true' && github.ref_name == env.PUBLISH_TESTS_FROM }} | |
run: | | |
mkdir -p /tmp/test-suite | |
rsync -ar build/test-suite/ /tmp/test-suite/ | |
- 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: Update the tests repository | |
if: ${{ env.UPDATE_TESTS == 'true' && github.ref_name == env.PUBLISH_TESTS_FROM }} | |
run: rsync -var /tmp/test-suite/ ./ | |
- name: What tests changed? | |
if: ${{ env.UPDATE_TESTS == 'true' && github.ref_name == env.PUBLISH_TESTS_FROM }} | |
run: git status | |
- name: Deploy the updated tests | |
if: ${{ env.UPDATE_TESTS == 'true' && github.ref_name == env.PUBLISH_TESTS_FROM }} | |
uses: JamesIves/[email protected] | |
with: | |
repository-name: ${{ secrets.TEST_REPOSITORY }} | |
token: ${{ secrets.ACCESS_TOKEN }} | |
branch: master | |
folder: . | |
target-folder: / |