-
Notifications
You must be signed in to change notification settings - Fork 16
130 lines (116 loc) · 4.15 KB
/
build-pr.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
127
128
129
130
name: build-pr
on:
pull_request_target:
types: [assigned, opened, edited, synchronize, reopened]
branches:
- master
jobs:
check_branch:
runs-on: ubuntu-latest
outputs:
branch: ${{ steps.check_step.outputs.branch }}
reponame: ${{ steps.check_step.outputs.reponame }}
tag: ${{ steps.check_step.outputs.tag }}
steps:
- name: Checkout the repo
uses: actions/checkout@v4
with:
fetch-depth: 0
- name: Get branch name, etc.
id: check_step
run: |
raw=${{ github.repository }}
reponame=${raw##*/}
echo "reponame=$reponame" >> $GITHUB_OUTPUT
raw=$(git branch -r --contains ${{ github.ref }})
branch=${raw##*/}
echo "branch=$branch" >> $GITHUB_OUTPUT
tag=""
if [ ${{ github.ref_type }} = "tag" ]; then
tag=${{ github.ref_name }}
echo "Running in $reponame on $branch for $tag"
else
echo "Running in $reponame on $branch"
fi
echo "tag=$tag" >> $GITHUB_OUTPUT
build-and-deploy-pr:
runs-on: ubuntu-latest
needs: check_branch
env:
HAVE_ACCESS_TOKEN: ${{ secrets.ACCESS_TOKEN != '' }}
AUTODIFF: ${{ secrets.DIFFURI != '' && secrets.DIFFPW != '' }}
PR_NUMBER: ${{ github.event.number }}
GH_TOKEN: ${{ secrets.ACCESS_TOKEN }}
steps:
- name: Install dependencies
run: sudo apt-get install tidy rsync graphviz
- name: Get the pull request
uses: actions/checkout@v4
with:
ref: ${{ github.event.pull_request.head.sha }}
- name: Build specifications
run: |
./gradlew
- 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: Current PR status
run: |
mkdir -p build/status
sh tools/get-qt4cg-issues.sh build/status
- name: Deploy
if: ${{ env.HAVE_ACCESS_TOKEN == 'true' }}
uses: JamesIves/[email protected]
with:
folder: build/www
token: ${{ secrets.ACCESS_TOKEN }}
branch: gh-pages
target-folder: /pr/${{ github.event.number }}
- name: Deploy PR status
if: ${{ env.HAVE_ACCESS_TOKEN == 'true' }}
uses: JamesIves/[email protected]
with:
folder: build/status
token: ${{ secrets.ACCESS_TOKEN }}
branch: gh-pages
target-folder: /pr-status
build-status:
runs-on: ubuntu-latest
needs: build-and-deploy-pr
env:
HAVE_ACCESS_TOKEN: ${{ secrets.ACCESS_TOKEN != '' }}
AUTODIFF: ${{ secrets.DIFFURI != '' && secrets.DIFFPW != '' }}
PR_NUMBER: ${{ github.event.number }}
GH_TOKEN: ${{ secrets.ACCESS_TOKEN }}
steps:
- name: Checkout the specifications
uses: actions/checkout@v4
with:
fetch-depth: 0
ref: gh-pages
- name: Build
run: |
./gradlew dashboard
- name: Deploy PR status
if: ${{ env.HAVE_ACCESS_TOKEN == 'true' }}
uses: JamesIves/[email protected]
with:
folder: dashboard
token: ${{ secrets.ACCESS_TOKEN }}
branch: gh-pages
target-folder: /dashboard