-
Notifications
You must be signed in to change notification settings - Fork 28
105 lines (101 loc) · 4.2 KB
/
test.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
name: Test
on: [ push, pull_request ]
jobs:
build:
runs-on: ubuntu-latest
env:
DITA_OT_VERSION: '3.5.4'
steps:
- uses: actions/checkout@v2
- name: Set up JDK 1.8
uses: actions/setup-java@v2
with:
distribution: 'temurin'
java-version: '8'
cache: 'gradle'
- name: Cache DITA-OT
uses: actions/cache@v2
with:
path: |
dita-ot-${{ env.DITA_OT_VERSION }}.zip
key: ${{ runner.os }}-${{ env.DITA_OT_VERSION }}
- name: Set up DITA-OT
run: |
set -e
if [ -f "dita-ot-$DITA_OT_VERSION.zip" ]; then
echo "Use cached $PWD/dita-ot-$DITA_OT_VERSION.zip"
else
curl -sfL https://github.com/dita-ot/dita-ot/releases/download/$DITA_OT_VERSION/dita-ot-$DITA_OT_VERSION.zip -o dita-ot-$DITA_OT_VERSION.zip
fi
unzip -q dita-ot-$DITA_OT_VERSION.zip
echo "DITA_HOME=$PWD/dita-ot-$DITA_OT_VERSION" >> $GITHUB_ENV
- name: Install plug-ins
run: |
set -e
# Copy latest base doctype updates over the beta version in DITA-OT;
# replace whatever (possibly older) version is currently shipped.
rm -rv $DITA_HOME/plugins/org.oasis-open.dita.v2_0/dtd/
rm -rv $DITA_HOME/plugins/org.oasis-open.dita.v2_0/rng/
cp -av ./doctypes/. $DITA_HOME/plugins/org.oasis-open.dita.v2_0/
# Copy the latest tech comm grammars as well
mkdir temp
cd temp
curl -sfL https://github.com/oasis-tcs/dita-techcomm/archive/refs/heads/DITA-2.0.zip -o DITA-2.0.zip
unzip -q DITA-2.0.zip
cd ..
rm -rv $DITA_HOME/plugins/org.oasis-open.dita.techcomm.v2_0/dtd/
rm -rv $DITA_HOME/plugins/org.oasis-open.dita.techcomm.v2_0/rng/
cp -av ./temp/dita-techcomm-DITA-2.0/doctypes/. $DITA_HOME/plugins/org.oasis-open.dita.techcomm.v2_0/
# Install extract codeblock
cp -av .github/resources/extract-codeblock/ $DITA_HOME/plugins/extract-codeblock/
# Install the updated grammar plugins
$DITA_HOME/bin/dita install
# Install RNG support
#curl -sfL https://github.com/oxygenxml/dita-relaxng-defaults/archive/master.zip -o dita-ng.zip
#$DITA_HOME/bin/dita -install dita-ng.zip -v
#rm dita-ng.zip
- name: Extract codeblock content
run: |
$DITA_HOME/bin/dita \
-i $PWD/specification/dita-2.0-specification.ditamap \
--filter $PWD/specification/resources/DITA2.0-spec.ditaval \
-f extract-codeblock
- name: Validate codeblock content
working-directory: .github
run: |
./gradlew test \
-Prepository=$GITHUB_REPOSITORY \
-Psha=$GITHUB_SHA \
-Pcatalogs=$DITA_HOME/catalog-dita.xml \
-Pout=$PWD/../out \
-Proot=$GITHUB_WORKSPACE \
--info
- name: Install test files
run: |
set -e
curl --etag-compare testfiles.zip.etag --etag-save testfiles.zip.etag -sfL https://github.com/robander/metadita-sampledocs/archive/master.zip -o testfiles.zip
unzip testfiles.zip
- name: Test DITA 1.3 basemap
run: |
set -e
# Build 1.3 doctype to ensure builds working properly
#$DITA_HOME/bin/dita -i $PWD/metadita-sampledocs-master/doctypes/dita1.3/dtd/base/basemap.ditamap -f html5
- name: Test all-v2-grammars.ditamap
run: |
set -e
# Build beta 2.0 doctype
#$DITA_HOME/bin/dita -i $PWD/metadita-sampledocs-master/doctypes/dita20/dtd/base/basetopic.dita -f html5
#$DITA_HOME/bin/dita -i $PWD/metadita-sampledocs-master/doctypes/dita20/dtd/base/basemap.ditamap -f html5
$DITA_HOME/bin/dita \
-i $PWD/metadita-sampledocs-master/doctypes/all-v2-grammars.ditamap \
-f html5 \
--processing-mode=strict \
-v
- name: Test dita-2.0-specification.ditamap
run: |
set -e
$DITA_HOME/bin/dita \
-i $PWD/specification/dita-2.0-specification.ditamap \
-f html5 \
--processing-mode=strict \
-v