-
Notifications
You must be signed in to change notification settings - Fork 0
91 lines (81 loc) · 3.86 KB
/
Copy pathci.yml
File metadata and controls
91 lines (81 loc) · 3.86 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
name: ci
# What this checks beyond `mcpp build`: that the two big generated tables still
# match what upstream's own Python produces. build.mcpp is a transliteration of
# those scripts, and a transliteration is only worth having if it is checked
# against the original.
on:
push:
branches: [ '**' ]
pull_request:
workflow_dispatch:
concurrency:
group: ci-${{ github.event.pull_request.number || github.ref }}
cancel-in-progress: true
jobs:
build:
runs-on: ubuntu-latest
steps:
- uses: actions/checkout@v4
# Two PATH entries: `xlings` lands in ~/.xlings/bin, but `mcpp` is
# installed INTO THE SUBOS. Without the second the next step dies with a
# bare `mcpp: command not found`.
- name: Install xlings + mcpp
env:
XLINGS_NON_INTERACTIVE: "1"
XLINGS_VERSION: "2026.8.27.5"
run: |
curl -fsSL https://d2learn.org/xlings-install.sh | bash
echo "$HOME/.xlings/bin" >> "$GITHUB_PATH"
"$HOME/.xlings/bin/xlings" --version
"$HOME/.xlings/bin/xlings" install mcpp
echo "$HOME/.xlings/subos/default/bin" >> "$GITHUB_PATH"
- name: build and test
run: |
cd mcpp/fontconfig
mcpp test
- name: the generated tables match upstream's own generators
run: |
# LC_ALL=C is load-bearing. fc-lang.py's output order follows the
# order its arguments arrive in, and `ls *.orth` in a UTF-8 locale
# sorts `ayc.orth` before `ay.orth` — collation ignores the dot.
# Measured: without this the diff shows two lines out of 4897, and
# the C++ side (std::sort over std::string, i.e. byte order) is the
# one that is right.
export LC_ALL=C
out=$(find mcpp/fontconfig/target -name fclang.h | head -1)
test -n "$out" || { echo "::error::build.mcpp produced no fclang.h"; exit 1; }
( cd upstream/fc-lang && python3 fc-lang.py $(ls *.orth) \
--template fclang.tmpl.h --output /tmp/ref-fclang.h )
diff "$out" /tmp/ref-fclang.h || {
echo "::error::fclang.h differs from upstream's fc-lang.py"; exit 1; }
echo "fclang.h matches ($(wc -l < "$out") lines)"
out=$(find mcpp/fontconfig/target -name fccase.h | head -1)
test -n "$out" || { echo "::error::build.mcpp produced no fccase.h"; exit 1; }
( cd upstream/fc-case && python3 fc-case.py CaseFolding.txt \
--template fccase.tmpl.h --output /tmp/ref-fccase.h )
diff "$out" /tmp/ref-fccase.h || {
echo "::error::fccase.h differs from upstream's fc-case.py"; exit 1; }
echo "fccase.h matches ($(wc -l < "$out") lines)"
- name: no host font paths were compiled in
run: |
# The four runtime paths are empty on purpose; a wrong value here
# fails by SILENTLY WORKING on a machine that has fonts where
# upstream's default points.
so=$(find mcpp/fontconfig/target -name '*.o' | head -200)
if strings $so 2>/dev/null | grep -qE '/usr/share/fonts|/etc/fonts'; then
echo "::error::a host font path was compiled in"
strings $so | grep -E '/usr/share/fonts|/etc/fonts' | head
exit 1
fi
echo "no /usr/share/fonts or /etc/fonts in the objects"
- name: upstream/ is the release tarball, unmodified
run: |
curl -fsSL -o /tmp/u.tar.gz \
https://gitlab.freedesktop.org/fontconfig/fontconfig/-/archive/2.15.0/fontconfig-2.15.0.tar.gz
mkdir -p /tmp/u && tar xzf /tmp/u.tar.gz -C /tmp/u --strip-components=1
if ! diff -r -q /tmp/u upstream >/dev/null 2>&1; then
echo "::error::upstream/ differs from fontconfig 2.15.0"
diff -r -q /tmp/u upstream | head -20
exit 1
fi
echo "upstream/ is 2.15.0, unmodified"