|
3 | 3 | export DEBIAN_FRONTEND=noninteractive |
4 | 4 | export RUST_VERSION=stable |
5 | 5 |
|
6 | | -sudo useradd -ms /bin/bash tester |
7 | | -sudo apt-get update -qq |
| 6 | +sudo mkdir -p /var/cache/apt/archives |
| 7 | +mkdir -p ~/ci-cache/apt/ |
| 8 | +sudo cp -a ~/ci-cache/apt/. /var/cache/apt/archives/ 2>/dev/null || true |
8 | 9 |
|
9 | | -sudo apt-get -qq install --no-install-recommends --allow-unauthenticated -yy \ |
| 10 | +sudo apt-get update |
| 11 | + |
| 12 | +# Install eatmydata, then use it for the rest. |
| 13 | +sudo apt-get install --no-install-recommends --allow-unauthenticated -yy \ |
| 14 | + -o APT::Keep-Downloaded-Packages=true \ |
| 15 | + eatmydata |
| 16 | + |
| 17 | +sudo eatmydata apt-get install --no-install-recommends --allow-unauthenticated -yy \ |
| 18 | + -o APT::Keep-Downloaded-Packages=true \ |
10 | 19 | autoconf \ |
11 | 20 | automake \ |
12 | 21 | binfmt-support \ |
13 | 22 | build-essential \ |
14 | 23 | clang \ |
15 | 24 | cppcheck \ |
16 | 25 | docbook-xml \ |
17 | | - eatmydata \ |
18 | 26 | gcc-aarch64-linux-gnu \ |
19 | 27 | gcc-arm-linux-gnueabihf \ |
20 | 28 | gcc-arm-none-eabi \ |
@@ -52,17 +60,19 @@ sudo apt-get -qq install --no-install-recommends --allow-unauthenticated -yy \ |
52 | 60 | sudo \ |
53 | 61 | tcl \ |
54 | 62 | tclsh \ |
| 63 | + tshark \ |
55 | 64 | unzip \ |
56 | 65 | valgrind \ |
57 | 66 | wget \ |
| 67 | + wireshark-common \ |
58 | 68 | xsltproc \ |
59 | 69 | systemtap-sdt-dev \ |
60 | 70 | zlib1g-dev |
61 | 71 |
|
62 | 72 | echo "tester ALL=(root) NOPASSWD:ALL" | sudo tee /etc/sudoers.d/tester |
63 | 73 | sudo chmod 0440 /etc/sudoers.d/tester |
64 | 74 |
|
65 | | -"$(dirname "$0")"/install-bitcoind.sh |
| 75 | +"$(dirname "$0")"/install-bitcoind.sh ~/ci-cache/ |
66 | 76 |
|
67 | 77 | curl --proto '=https' --tlsv1.2 -sSf https://sh.rustup.rs | sh -s -- \ |
68 | 78 | -y --default-toolchain ${RUST_VERSION} |
@@ -90,10 +100,29 @@ uv tool install poetry |
90 | 100 |
|
91 | 101 | PROTOC_VERSION=29.4 |
92 | 102 | PB_REL="https://github.com/protocolbuffers/protobuf/releases" |
93 | | -curl -LO $PB_REL/download/v${PROTOC_VERSION}/protoc-${PROTOC_VERSION}-linux-x86_64.zip |
94 | | -sudo unzip protoc-${PROTOC_VERSION}-linux-x86_64.zip -d /usr/local/ |
| 103 | +PROTOC_ZIP=protoc-${PROTOC_VERSION}-linux-x86_64.zip |
| 104 | +if [ ! -f ~/ci-cache/$PROTOC_ZIP ]; then |
| 105 | + curl -LO $PB_REL/download/v${PROTOC_VERSION}/$PROTOC_ZIP |
| 106 | + # Check it before we commit it to the cache! |
| 107 | + unzip -t $PROTOC_ZIP |
| 108 | + cp $PROTOC_ZIP ~/ci-cache/ |
| 109 | +fi |
| 110 | +sudo unzip ~/ci-cache/$PROTOC_ZIP -d /usr/local/ |
95 | 111 | sudo chmod a+x /usr/local/bin/protoc |
96 | 112 | export PROTOC=/usr/local/bin/protoc |
97 | 113 | export PATH=$PATH:/usr/local/bin |
98 | 114 | env |
99 | 115 | ls -lha /usr/local/bin |
| 116 | + |
| 117 | +# wireshark-common normally does this, but GH runners are special, so we |
| 118 | +# do it explicitly |
| 119 | +sudo groupadd -f wireshark |
| 120 | +sudo chgrp wireshark /usr/bin/dumpcap |
| 121 | +sudo chmod 750 /usr/bin/dumpcap |
| 122 | +sudo setcap cap_net_raw,cap_net_admin=eip /usr/bin/dumpcap |
| 123 | + |
| 124 | +# Add ourselves to the wireshark group (still need "sg wireshark..." for it to take effect) |
| 125 | +sudo usermod -aG wireshark "$(id -nu)" |
| 126 | + |
| 127 | +# Copy archives back for caching |
| 128 | +cp /var/cache/apt/archives/*.deb ~/ci-cache/apt/ || true |
0 commit comments