-
Notifications
You must be signed in to change notification settings - Fork 2
110 lines (104 loc) · 4.38 KB
/
Copy pathpython-app.yml
File metadata and controls
110 lines (104 loc) · 4.38 KB
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
# This workflow will install Python dependencies, run tests and lint with a single version of Python
# For more information see: https://docs.github.com/en/actions/automating-builds-and-tests/building-and-testing-python
name: Install DeGeŠ
on:
push:
branches: [ "master" ]
pull_request:
branches: [ "master" ]
permissions:
contents: read
jobs:
build:
runs-on: ubuntu-latest
steps:
- uses: actions/checkout@master
- name: astral-sh/setup-uv
uses: astral-sh/setup-uv@v9.0.0
with:
python-version: "3.14"
- name: Install dependencies
run: uv sync --dev
- name: "Install utilities"
run: |
sudo apt-get update -qq
sudo apt-get install -y --no-install-recommends librsvg2-bin lcdf-typetools
# The same script a developer runs from install.sh, so CI and a workstation cannot drift onto
# different pandocs. It pins the filter, asks the binary which pandoc it was built with,
# installs exactly that one and fails if the pair still disagrees; why, and how to bump the
# pair, is in install-pandoc.sh.
- name: "Set up pandoc and pandoc-crossref"
run: |
./install-pandoc.sh
# The script installs into ~/.local/bin, which is not on a runner's PATH. It verifies
# itself by absolute path, so this is for the later steps -- pytest and make shell out
# to `pandoc` by name. $GITHUB_PATH only affects subsequent steps, hence not before.
echo "$HOME/.local/bin" >> "$GITHUB_PATH"
# Must precede FontPro: its scripts run tex, fontinst, vptovf, pltotf, mktexlsr and
# updmap-sys, and it installs into TEXMFLOCAL. This used to work by accident, because the
# pandoc action we no longer use dragged in a TeX distribution of its own.
#
# Installed with apt directly rather than through cache-apt-pkgs-action: that action restores
# files but never runs the packages' postinst, so a restored TeX has binaries yet no
# configuration -- no updmap.cfg under /var/lib/texmf, no ls-R -- and FontPro dies in
# `updmap-sys` after minutes of work. The one CI run that ever got past FontPro was the one
# that populated the cache, i.e. actually installed.
- name: "Install XeLaTeX"
run: |
sudo apt-get update -qq
sudo apt-get install -y --no-install-recommends texlive-full texlive-fonts-extra texlive-science
updmap-sys --version | head -1
kpsewhich -var-value=TEXMFLOCAL
# FontPro fails deep inside a TeX run when a tool is absent, and the apt steps above report
# success even when a stale cache restored nothing. Fail here instead, where the step name
# alone says what happened.
- name: "Verify FontPro prerequisites"
run: |
missing=""
for tool in tex fontinst vptovf pltotf otfinfo otftotfm cfftot1 kpsewhich mktexlsr updmap-sys perl; do
command -v "$tool" >/dev/null 2>&1 || missing="$missing $tool"
done
if [ -n "$missing" ]; then
echo "::error::missing tools:$missing"
exit 1
fi
kpsewhich -var-value=TEXMFLOCAL
- name: "Clone FontPro"
uses: actions/checkout@master
with:
repository: sebschub/FontPro
path: assets/fonts/FontPro
# Split into three, so a failure is identified by the step name -- the log is not readable
# without a token, and this one takes minutes before it dies.
- name: "FontPro: build MinionPro"
run: |
cd assets/fonts/FontPro
mkdir -p otf
cp ../../fonts/MinionPro/*.otf otf/
./scripts/makeall MinionPro
- name: "FontPro: install into TEXMFLOCAL"
run: |
cd assets/fonts/FontPro
yes | sudo ./scripts/install
- name: "FontPro: enable the map file"
run: |
yes | sudo updmap-sys --enable Map=MinionPro.map
kpsewhich MinionPro.map
- name: "Set up XeLaTeX"
run: |
DIR=$(dirname $0)
TEXHOME=`kpsewhich -var-value=TEXMFHOME`
mkdir -p $TEXHOME/tex/latex/
ln -s $PWD/core/latex/dgs.cls $TEXHOME/tex/latex/dgs.cls
- name: Test with pytest
run: |
uv run python -m pytest -s -v
- name: "Clone testing repository"
uses: actions/checkout@master
with:
repository: TrojstenSK/dgs-seminar-testing
path: source/seminar/testing
- name: "Build testing/01/1/1"
run: |
pwd
# pipenv run make output/seminar/test/01/1/1