-
Notifications
You must be signed in to change notification settings - Fork 0
79 lines (72 loc) · 3.28 KB
/
Copy pathci.yml
File metadata and controls
79 lines (72 loc) · 3.28 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
name: ci
# What this checks that a plain `mcpp build` does not: that the generated
# pnp-id-table.c still matches the pinned pnp.ids beside it, and that the
# manufacturer lookup it exists for gives the right answer on a real monitor's
# EDID.
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
# XLINGS_NON_INTERACTIVE is what makes the installer usable here: without
# it the script takes its `curl | bash` branch (`xlings self install <
# /dev/tty`) and a runner's /dev/tty is readable but not connected.
#
# XLINGS_VERSION pins the INSTALLER so a red run can be told apart from an
# ecosystem change. mcpp itself stays unpinned on purpose — this package
# depends on the current ecosystem, and a pinned mcpp carries a frozen
# snapshot of it.
#
# TWO PATH entries, and the second is the one that matters: `xlings`
# itself lands in ~/.xlings/bin, but `mcpp` is installed INTO THE SUBOS,
# so without `subos/default/bin` the next step dies with a bare
# `mcpp: command not found` (exit 127) that says nothing about why.
- 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/displayinfo
mcpp test
# No regenerate-and-diff step, and none is possible: build.mcpp PRODUCES
# the table during `mcpp test` above, so a mismatch between the data and
# the code is not a state this repo can be in. That is the difference
# between generating at build time and checking a generated file in.
#
# What is still worth printing is that the pinned input is not the
# runner's — the failure this fork exists to prevent looks exactly like a
# passing build.
- name: the pinned pnp.ids is NOT the runner's
run: |
if [ -f /usr/share/hwdata/pnp.ids ]; then
d=$(diff <(sort mcpp/data/pnp.ids) <(sort /usr/share/hwdata/pnp.ids) | grep -c '^[<>]' || true)
echo "pinned pnp.ids differs from the runner's by $d line(s)"
else
echo "the runner has no /usr/share/hwdata/pnp.ids — which is why upstream's fallback is a trap"
fi
- name: upstream/ is the release tarball, unmodified
run: |
curl -fsSL -o /tmp/u.tar.gz \
https://gitlab.freedesktop.org/emersion/libdisplay-info/-/archive/0.2.0/libdisplay-info-0.2.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 libdisplay-info 0.2.0"
diff -r -q /tmp/u upstream | head -20
exit 1
fi
echo "upstream/ is 0.2.0, unmodified"