Skip to content

Commit b450dfb

Browse files
committed
Removing the sample from the document appendix, instead linking to a standalone file.
Also, adding tests.
1 parent a0d825e commit b450dfb

File tree

8 files changed

+498
-317
lines changed

8 files changed

+498
-317
lines changed

.github/workflows/build.yml

Lines changed: 19 additions & 10 deletions
Original file line numberDiff line numberDiff line change
@@ -1,3 +1,9 @@
1+
# This file generated from a template file maintained in the ivoatex repository.
2+
# To create and install it into a project repository, do:
3+
# make github-preview
4+
# git commit
5+
# git push
6+
#
17
name: Check the IVOA document
28

39
env:
@@ -11,29 +17,32 @@ jobs:
1117
build:
1218

1319
runs-on: ubuntu-latest
14-
20+
1521
steps:
16-
22+
1723
- name: Checkout the repository
18-
uses: actions/checkout@v1
24+
uses: actions/checkout@v4
1925
with:
2026
submodules: true
21-
27+
2228
- name: Setup dependencies
2329
run: |
2430
sudo apt update
25-
sudo apt install texlive-latex-base texlive-latex-recommended texlive-latex-extra texlive-fonts-recommended xsltproc latexmk cm-super
26-
31+
sudo apt install texlive-latex-base texlive-latex-recommended \
32+
texlive-latex-extra texlive-fonts-recommended \
33+
librsvg2-bin latexmk \
34+
pdftk xsltproc latexmk cm-super
35+
2736
- name: Build the document
2837
run: make
29-
38+
3039
- name: Check the output
3140
run: |
3241
test -f ${{ env.doc_name }}.pdf
3342
test -f ${{ env.doc_name }}.bbl
34-
35-
- name: Keep the PDF artefact
36-
uses: actions/upload-artifact@v1
43+
44+
- name: Keep the PDF artefact
45+
uses: actions/upload-artifact@v4
3746
with:
3847
name: PDF Preview
3948
path: ${{ env.doc_name }}.pdf

.github/workflows/preview.yml

Lines changed: 48 additions & 35 deletions
Original file line numberDiff line numberDiff line change
@@ -1,60 +1,73 @@
1+
# This file generated from a template file maintained in the ivoatex repository.
2+
# To create and install it into a project repository, do:
3+
# make github-preview
4+
# git commit
5+
# git push
6+
#
17
name: Update PDF Preview
28

39
env:
4-
doc_name: TAPRegExt
10+
doc_name : TAPRegExt
11+
branch_name: ${{ github.head_ref || github.ref_name }}
12+
tag_preview: auto-pdf-preview
513

614
on:
715
push:
816
branches:
9-
- master
17+
- main
1018

1119
jobs:
1220
build:
13-
21+
1422
runs-on: ubuntu-latest
15-
23+
1624
steps:
17-
25+
1826
- name: Checkout the repository
19-
uses: actions/checkout@v1
27+
uses: actions/checkout@v4
2028
with:
2129
submodules: true
22-
30+
2331
- name: Setup dependencies
2432
run: |
25-
sudo apt update
26-
sudo apt install texlive-latex-base texlive-latex-recommended texlive-latex-extra texlive-fonts-recommended xsltproc latexmk cm-super
27-
sudo snap install pdftk
28-
33+
sudo apt install texlive-latex-base texlive-latex-recommended \
34+
texlive-latex-extra texlive-fonts-recommended \
35+
librsvg2-bin latexmk \
36+
pdftk xsltproc latexmk cm-super
37+
2938
- name: Build the document
3039
run: make ${{ env.doc_name }}-draft.pdf
31-
40+
3241
- name: Check the output
3342
run: |
3443
test -f ${{ env.doc_name }}-draft.pdf
3544
test -f ${{ env.doc_name }}.bbl
36-
37-
- name: Move the auto-pdf-preview tag
38-
uses: weareyipyip/walking-tag-action@v1
39-
with:
40-
TAG_NAME: auto-pdf-preview
41-
TAG_MESSAGE: |
42-
Last commit taken into account for the automatically updated PDF preview of this IVOA document.
45+
46+
- name: Remove the former PDF preview (if any)
47+
run: |
48+
existingTag=$( gh release list --exclude-drafts --json 'isPrerelease,tagName' \
49+
--jq '.[] | select(.isPrerelease == true and .tagName == "${{ env.tag_preview }}") | .tagName' \
50+
| xargs -n 1 echo )
51+
if [ -n "$existingTag" ];
52+
then
53+
gh release delete --cleanup-tag "$existingTag"
54+
fi
4355
env:
44-
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }}
45-
46-
- name: Update the PDF preview
47-
uses: Xotl/cool-github-releases@v1
48-
with:
49-
mode: update
50-
isPrerelease: true
51-
tag_name: auto-pdf-preview
52-
release_name: "Auto PDF Preview"
53-
body_mrkdwn: |
54-
This release aims to provide a PDF preview of the last commit applied on this repository.
56+
GH_TOKEN: ${{ secrets.GITHUB_TOKEN }}
57+
58+
- name: Upload the new PDF preview
59+
run: |
60+
RELEASE_NOTES="This release aims to provide a PDF preview of the last commit applied on this repository.
5561
It will be updated automatically after each merge of a PullRequest.
56-
**DO NOT PUBLISH THIS PRE-RELEASE!**"
57-
_Corresponding commit: ${{ github.sha }}_
58-
assets: ${{ env.doc_name }}-draft.pdf
59-
replace_assets: true
60-
github_token: ${{ secrets.GITHUB_TOKEN }}
62+
**DO NOT PUBLISH THIS PRE-RELEASE!**
63+
_Corresponding commit: ${{ github.sha }}_"
64+
65+
gh release create ${{ env.tag_preview }} \
66+
${{ env.doc_name }}-draft.pdf \
67+
--prerelease \
68+
--target "${{ env.branch_name }}" \
69+
--title 'Auto PDF Preview' \
70+
--notes "$RELEASE_NOTES"
71+
env:
72+
GH_TOKEN: ${{ secrets.GITHUB_TOKEN }}
73+

Makefile

Lines changed: 22 additions & 20 deletions
Original file line numberDiff line numberDiff line change
@@ -28,30 +28,32 @@ VECTORFIGURES =
2828

2929

3030
# Additional files to distribute (e.g., CSS, schema files, examples...)
31-
AUX_FILES = $(SCHEMA_FILE)
31+
AUX_FILES = $(SCHEMA_FILE) sample.xml
3232

3333
-include ivoatex/Makefile
3434

35-
sample.xml: samplegroom.sed Makefile
36-
# this rule only works if there's a (proper) TAP service on
37-
# http://localhost:8080/tap
38-
curl -s http://dc.zah.uni-heidelberg.de/__system__/tap/run/tap/capabilities \
39-
| xmlstarlet ed -d "//languageFeatures[@type='ivo://ivoa.net/std/TAPRegExt#features-udf']/feature[not(starts-with(form, 'ivo_hashlist_has'))]" \
40-
-d "//languageFeatures[@type='ivo://org.gavo.dc/std/exts#extra-adql-keywords']/feature[not(starts-with(form, 'MOC'))]" \
41-
-d "//outputFormat[not(@ivo-id or mime='text/csv')]" \
42-
-d "//capability[@standardID='ivo://ivoa.net/std/VOSI#availability']" \
43-
-d "//dataModel[@ivo-id='ivo://org.gavo.dc/std/glots#tables-1.0']" \
44-
| xmlstarlet fo > $@.tmp
45-
gavo admin xsdValidate $@.tmp
46-
sed -f samplegroom.sed $@.tmp > $@
47-
rm $@.tmp
48-
49-
50-
install:
51-
# local to Markus' setup
52-
fixschema $(SCHEMA_FILE) > ~/gavo/trunk/schemata/TAPRegExt.xsd
53-
5435
ivoatex/Makefile:
5536
@echo "*** ivoatex submodule not found. Initialising submodules."
5637
@echo
5738
git submodule update --init
39+
40+
41+
sample.xml: make-sample.sh
42+
./make-sample.sh > sample.xml
43+
44+
install:
45+
# local to Markus' setup
46+
~/gavo/standards/fixschema $(SCHEMA_FILE) > ~/gavo/trunk/gavo/resources/schemata/TAPRegExt.xsd
47+
48+
STILTS ?= stilts
49+
SCHEMA_FILE=TAPRegExt-v1.1.xsd
50+
51+
# These tests need stilts >3.4 and xmlstarlet
52+
test:
53+
@sh test-assertions.sh
54+
@$(STILTS) xsdvalidate $(SCHEMA_FILE)
55+
@$(STILTS) xsdvalidate \
56+
schemaloc="http://www.ivoa.net/xml/TAPRegExt/v1.0=$(SCHEMA_FILE)" \
57+
schemaloc="http://www.ivoa.net/xml/VOSICapabilities/v1.0=https://www.ivoa.net/xml/VOSICapabilities/v1.0" \
58+
schemaloc="http://www.ivoa.net/xml/VODataService/v1.1=https://www.ivoa.net/xml/VODataService/v1.1" \
59+
doc=sample.xml

0 commit comments

Comments
 (0)