forked from qt4cg/qtspecs
-
Notifications
You must be signed in to change notification settings - Fork 0
126 lines (111 loc) · 4.98 KB
/
build-specs.yml
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
124
125
126
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: /