Repository navigation
96 lines (87 loc) · 3.25 KB
/
Copy pathextras.yml
File metadata and controls
96 lines (87 loc) · 3.25 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
name: Extras
# Extras are opt-in, so bootstrap never installs them and nothing notices when
# a release URL dies or a binary outgrows bookworm's glibc (cartoon's did).
# Weekly, plus any PR that touches how extras install. Not a required check.
on:
pull_request:
paths:
- install/extras/**
- install/release_binary.sh
- install/versions.sh
- .github/workflows/extras.yml
workflow_dispatch:
schedule:
- cron: "0 10 * * 1"
permissions:
contents: read
jobs:
list:
runs-on: ubuntu-latest
outputs:
extras: ${{ steps.list.outputs.extras }}
steps:
- uses: actions/checkout@3d3c42e5aac5ba805825da76410c181273ba90b1 # v7
with:
persist-credentials: false
# cartoon, mprocs and spotify_player build with cargo: minutes each, and
# a crates.io build doesn't rot the way a release URL does.
# docker-desktop installs Docker Desktop on the Windows host, which no runner has.
- name: List extras from their headers
id: list
run: |
extras="$(
grep -H '^## @extra ' install/extras/*.sh |
grep -vE '/(cartoon|docker-desktop|mprocs|spotify)\.sh:' |
sed -E 's|^install/extras/([^.]+)\.sh:## @extra ([^ ]+) .*|{"name":"\1","binary":"\2"}|' |
jq -sc .
)"
echo "extras=${extras}" >> "$GITHUB_OUTPUT"
install:
needs: list
runs-on: ubuntu-latest
# Bookworm, not the runner's newer Ubuntu: the glibc the machines run.
container: debian:bookworm
strategy:
fail-fast: false
matrix:
extra: ${{ fromJSON(needs.list.outputs.extras) }}
name: ${{ matrix.extra.name }}
steps:
- uses: actions/checkout@3d3c42e5aac5ba805825da76410c181273ba90b1 # v7
with:
persist-credentials: false
# The real apt list, not a hand-picked subset: chrome.sh needed wget,
# which bootstrap installs and a guessed list left out.
- name: Install what bootstrap would have
run: |
source install/apt_packages.sh
apt-get update -qq
apt-get install -y -qq sudo xz-utils "${apt_packages[@]}" >/dev/null
printf '%s\n' "${HOME}/.local/bin" "${HOME}/.deno/bin" "${HOME}/.cargo/bin" /usr/local/go/bin /usr/games >> "$GITHUB_PATH"
shell: bash
env:
DEBIAN_FRONTEND: noninteractive
- name: Install ${{ matrix.extra.name }}
run: bash "install/extras/${EXTRA}.sh"
env:
EXTRA: ${{ matrix.extra.name }}
GH_TOKEN: ${{ github.token }}
# Not every binary has --version, so only a binary that can't run fails:
# missing (127), not executable (126), or a glibc too old for it.
- name: Run ${{ matrix.extra.binary }}
run: |
if [[ "${BINARY}" == gh-* ]]; then
gh extension list | grep -F "${BINARY}"
exit 0
fi
command -v "${BINARY}"
rc=0
out="$(timeout 20 "${BINARY}" --version 2>&1 </dev/null)" || rc=$?
echo "${out}"
if [[ "${rc}" == 126 || "${rc}" == 127 || "${out}" == *GLIBC_* ]]; then
exit 1
fi
shell: bash
env:
BINARY: ${{ matrix.extra.binary }}
GH_TOKEN: ${{ github.token }}