ci: run the job on a custom Arch image (I3)
CI / test (push) Successful in 3m40s
CI / test (pull_request) Successful in 49s

The ubuntu-latest runner image ships GTK 4.22, which cannot satisfy the
crate's v4_24/v1_10 features (they want GTK >= 4.23 / libadwaita >= 1.10,
newer than the latest stable GNOME release), so the first CI run failed
compiling gdk4-sys. The GNOME OS SDK is no better.

Build a regent-ci image (build-aux/ci/) from Arch with the GTK/libadwaita
headers, a rustup-pinned toolchain and the static cargo-deny binary baked
in, register a repo-level runner with the matching label, and drop the
apt/rustup/install-action steps.

Bump url to 2.5.9 (RUSTSEC-2026-0592), which the cargo-deny step would
otherwise fail on.
This commit is contained in:
raucao committed 2026-11-30 11:18:36 +04:00
1 parent b42f9b925a
commit 1ee4930f2b
6 files changed
+133 -30

No files matched your search

+12 -23
View File
@@ -1,10 +1,16 @@
# Continuous integration for Regent (Gitea Actions).
#
# The build needs the GTK 4 / libadwaita development headers (cargo compiles the
# crate, it does not run the Meson UI build). The Rust toolchain is pinned: the
# `clippy -- -D warnings` gate is calibrated to a specific compiler, so a moving
# `stable` would reintroduce lint drift. `cargo-deny` fetches the RustSec advisory
# database at run time, so the job needs network.
# The job runs on the `regent-ci` runner, which is registered with the label
# `regent-ci:docker://gitea.kosmos.org/raucao/regent-ci:latest` (see
# doc/dev/development.md). That image bakes in the GTK 4 / libadwaita
# development headers, the Rust toolchain and cargo-deny, so this workflow
# installs nothing — the old ubuntu-latest job could not build against GTK 4.24
# and spent every run reinstalling the system and Rust dependencies.
#
# The Rust toolchain is pinned *in the image* (1.99.1): the `clippy -- -D
# warnings` gate is calibrated to a specific compiler, so a moving `stable`
# would reintroduce lint drift. `cargo-deny` fetches the RustSec advisory
# database at run time, so the job still needs network.
name: CI
on:
@@ -13,22 +19,10 @@ on:
jobs:
test:
runs-on: ubuntu-latest
runs-on: regent-ci
steps:
- uses: actions/checkout@v4
- name: Install the GTK/libadwaita build dependencies
run: |
sudo apt-get update
sudo apt-get install -y --no-install-recommends \
build-essential pkg-config libgtk-4-dev libadwaita-1-dev
- name: Install Rust (pinned)
uses: dtolnay/rust-toolchain@stable
with:
toolchain: 1.99.1
components: clippy
- name: Cache cargo
uses: actions/cache@v4
with:
@@ -44,10 +38,5 @@ jobs:
- name: Clippy
run: cargo clippy --all-targets --locked -- -D warnings
- name: Install cargo-deny
uses: taiki-e/install-action@v2
with:
tool: cargo-deny
- name: cargo-deny
run: cargo deny check
+10 -3
View File
@@ -1298,9 +1298,16 @@ the UI is tested. `build-aux/deploy-dev.sh` runs on the build host,
- **CI** (`.gitea/workflows/ci.yaml`, Gitea Actions) runs `cargo test --locked`,
`cargo clippy --all-targets --locked -- -D warnings` and `cargo deny check`
(`deny.toml`); the toolchain is pinned because the `-D warnings` gate is
calibrated to a compiler, and `cargo-deny` fetches the advisory database at run
time. Clippy is **clean** at the pinned version — keep it that way.
(`deny.toml`). The job runs on the **`regent-ci` runner**, whose label maps to
the image built from `build-aux/ci/Dockerfile` (`build-aux/ci/build-image.sh`
builds and pushes it to the Gitea registry), so the workflow installs nothing.
The image is **Arch-based** because Regent's `v4_24`/`v1_10` crate features
want GTK ≥ 4.23 / libadwaita ≥ 1.10 — newer than the latest stable GNOME
release (GNOME 50 ships GTK 4.22), so the old `ubuntu-latest` job and the GNOME
OS SDK both fail the build. The toolchain is pinned **in the image** (1.99.1)
because the `-D warnings` gate is calibrated to a compiler, and `cargo-deny`
fetches the advisory database at run time. Clippy is **clean** at the pinned
version — keep it that way.
- Against a real relay — the path that actually matters, and the only one that
exposes the two subscription traps above:
```sh
Generated
+4 -4
View File
@@ -701,9 +701,9 @@ checksum = "77ce24cb58228fbb8aa041425bb1050850ac19177686ea6e0f41a70416f56fdb"
[[package]]
name = "form_urlencoded"
version = "1.2.2"
version = "1.2.3"
source = "registry+https://github.com/rust-lang/crates.io-index"
checksum = "cb4cb245038516f5f85277875cdaa4f7d2c9a0fa0468de06ed190163b1581fcf"
checksum = "afa489199eaffb1211795df1c6236ce1ad0d41a6fa45250add73e3b02420f06e"
dependencies = [
"percent-encoding",
]
@@ -2811,9 +2811,9 @@ checksum = "8ecb6da28b8a351d773b68d5825ac39017e680750f980f3a1a85cd8dd28a47c1"
[[package]]
name = "url"
version = "2.5.8"
version = "2.5.9"
source = "registry+https://github.com/rust-lang/crates.io-index"
checksum = "ff67a8a4397373c3ef660812acab3268222035010ab8680ec4215f38ba3d0eed"
checksum = "f00cd2407bb42c0ef17be88d4cf020f5cceffd121665bac9b8b9493a369b3b1a"
dependencies = [
"form_urlencoded",
"idna",
+48
View File
@@ -0,0 +1,48 @@
# Regent's CI image (Gitea Actions). Built and pushed by build-aux/ci/build-image.sh;
# referenced by the `regent-ci` runner label in .gitea/workflows/ci.yaml.
#
# Arch is the AUR target and the closest match to the development environment.
# Regent asks for GTK >= 4.23 / libadwaita >= 1.10 (the crate's `v4_24` / `v1_10`
# features), which is *newer* than the latest stable GNOME release (GNOME 50
# ships GTK 4.22 / libadwaita 1.9), so a rolling base is required — the Gitea
# runner's ubuntu-latest image and the GNOME OS SDK both fail the build.
#
# Everything the job needs is baked in: the workflow installs nothing at run
# time. nodejs is for actions/checkout and actions/cache; ca-certificates and
# curl for the crate registry, the RustSec advisory database `cargo deny` fetches,
# and the toolchain downloads below.
FROM archlinux:base-devel
RUN pacman -Syu --noconfirm --needed \
ca-certificates \
curl \
git \
nodejs \
gtk4 \
libadwaita \
pkgconf \
&& rm -rf /var/cache/pacman/pkg/*
# The `-D warnings` gate is calibrated to a compiler, so the toolchain is pinned
# here rather than installed by an action on every run. Keep this in step with
# the `rust-version` in Cargo.toml and the development machine. rustup is used
# instead of the `rust` package precisely so the compiler cannot drift with the
# rolling base.
ENV PATH=/root/.cargo/bin:$PATH
RUN pacman -S --noconfirm --needed rustup \
&& rustup toolchain install 1.99.1 --profile minimal --component clippy \
&& rustup default 1.99.1
# cargo-deny ships as a static binary. Deliberately *not* the Arch `cargo-deny`
# package: it depends on `cargo`, which pulls in the rolling `rust` package we
# are pinning away from (and conflicts with rustup).
ARG CARGO_DENY_VERSION=0.22.2
RUN cd /tmp \
&& curl -fsSLO "https://github.com/EmbarkStudios/cargo-deny/releases/download/${CARGO_DENY_VERSION}/cargo-deny-${CARGO_DENY_VERSION}-x86_64-unknown-linux-musl.tar.gz" \
&& curl -fsSLO "https://github.com/EmbarkStudios/cargo-deny/releases/download/${CARGO_DENY_VERSION}/cargo-deny-${CARGO_DENY_VERSION}-x86_64-unknown-linux-musl.tar.gz.sha256" \
&& printf '%s cargo-deny-%s-x86_64-unknown-linux-musl.tar.gz\n' \
"$(cat "cargo-deny-${CARGO_DENY_VERSION}-x86_64-unknown-linux-musl.tar.gz.sha256")" \
"${CARGO_DENY_VERSION}" | sha256sum -c - \
&& tar -xzf "cargo-deny-${CARGO_DENY_VERSION}-x86_64-unknown-linux-musl.tar.gz" \
&& install -m755 "cargo-deny-${CARGO_DENY_VERSION}-x86_64-unknown-linux-musl/cargo-deny" /usr/local/bin/ \
&& rm -rf /tmp/cargo-deny-*
+30
View File
@@ -0,0 +1,30 @@
#!/bin/sh
# Build and push Regent's CI image (see build-aux/ci/Dockerfile).
#
# Runs on the build host, which needs Docker and write access to the registry:
#
# docker login gitea.kosmos.org
# build-aux/ci/build-image.sh # builds and pushes :latest
# build-aux/ci/build-image.sh 2026-11-30 # a dated tag
#
# The image has to be pullable by the `regent-ci` runner, which is registered
# with the label `regent-ci:docker://gitea.kosmos.org/raucao/regent-ci:latest`.
# A label-based runner cannot pass pull credentials, so keep the package public
# (link it to the public raucao/regent repository) — see doc/dev/development.md.
#
# Set NO_PUSH=1 to build only, e.g. to try the Dockerfile locally.
set -eu
ROOT=$(cd "$(dirname "$0")/../.." && pwd)
image=${REGENT_CI_IMAGE:-gitea.kosmos.org/raucao/regent-ci}
tag=${1:-latest}
docker build -t "$image:$tag" "$ROOT/build-aux/ci"
if [ "${NO_PUSH:-}" = 1 ]; then
echo "build-image: built $image:$tag (not pushed)"
exit 0
fi
docker push "$image:$tag"
echo "build-image: pushed $image:$tag"
+29
View File
@@ -89,6 +89,35 @@ HOME, using `gtk4-broadwayd` and `nak`:
dbus-run-session -- build-aux/acceptance.sh
```
## Continuous integration
Gitea Actions runs `cargo test --locked`,
`cargo clippy --all-targets --locked -- -D warnings` and `cargo deny check` on
every push and pull request (`.gitea/workflows/ci.yaml`). The job runs on the
`regent-ci` runner, which is registered with the label
```
regent-ci:docker://gitea.kosmos.org/raucao/regent-ci:latest
```
so it executes inside the image built from `build-aux/ci/Dockerfile`. That image
is **Arch-based** and bakes in the GTK/libadwaita development headers, the pinned
Rust toolchain (1.99.1) and `cargo-deny`, so the job installs nothing at run time.
Arch is required because Regent's crate features ask for GTK ≥ 4.23 /
libadwaita ≥ 1.10, which is newer than the latest stable GNOME release.
Rebuild and push it from the build host after changing the Dockerfile or the
pinned toolchain:
```sh
docker login gitea.kosmos.org
build-aux/ci/build-image.sh
```
The package must stay public (linked to `raucao/regent`): a label-based runner
cannot pass pull credentials. `NO_PUSH=1 build-aux/ci/build-image.sh` builds
without pushing, for trying the Dockerfile locally.
## Validating the package metadata
```sh