CI: migrate to bread-ecosystem's shared Arch build image
Routes the release build/test steps and a new fast pre-release check.yml through ci/build.sh, which delegates to bread-ecosystem's pinned shared Containerfile/build.sh instead of building against whatever the bare hestia runner happens to have installed. Follows the pattern already proven in breadpad. No extra ci/deps.txt: bread's system_deps (systemd-libs, openssl, zlib) are all already pulled in transitively by the shared image's base + git packages.
This commit is contained in:
parent
6063eb901c
commit
cdd5de8f58
6 changed files with 52 additions and 6 deletions
24
.forgejo/workflows/check.yml
Normal file
24
.forgejo/workflows/check.yml
Normal file
|
|
@ -0,0 +1,24 @@
|
||||||
|
name: check
|
||||||
|
|
||||||
|
# Fast-fail lint/test on short-lived work branches, before it ever reaches
|
||||||
|
# main and triggers a dev-track release build.
|
||||||
|
on:
|
||||||
|
push:
|
||||||
|
branches: ['feature/**', 'fix/**']
|
||||||
|
|
||||||
|
jobs:
|
||||||
|
check:
|
||||||
|
runs-on: [self-hosted, hestia]
|
||||||
|
steps:
|
||||||
|
- name: checkout
|
||||||
|
run: |
|
||||||
|
set -euo pipefail
|
||||||
|
rm -rf src && mkdir src
|
||||||
|
git clone --branch "${GITHUB_REF_NAME}" --depth 1 \
|
||||||
|
"https://git.breadway.dev/${GITHUB_REPOSITORY}.git" src
|
||||||
|
|
||||||
|
- name: clippy
|
||||||
|
run: cd src && bash ci/build.sh cargo clippy --workspace --all-targets --locked -- -D warnings
|
||||||
|
|
||||||
|
- name: test
|
||||||
|
run: cd src && bash ci/build.sh cargo test --workspace --locked
|
||||||
|
|
@ -26,10 +26,10 @@ jobs:
|
||||||
run: cd src && cargo run -p xtask --locked -- check-docs
|
run: cd src && cargo run -p xtask --locked -- check-docs
|
||||||
|
|
||||||
- name: build
|
- name: build
|
||||||
run: cd src && cargo build --release --locked
|
run: cd src && bash ci/build.sh cargo build --release --locked
|
||||||
|
|
||||||
- name: test
|
- name: test
|
||||||
run: cd src && cargo test --release --locked --workspace
|
run: cd src && bash ci/build.sh cargo test --release --locked --workspace
|
||||||
|
|
||||||
# breadd/Cargo.toml is the canonical version source (this workspace has
|
# breadd/Cargo.toml is the canonical version source (this workspace has
|
||||||
# no shared workspace.package.version — breadd and bread-cli are kept
|
# no shared workspace.package.version — breadd and bread-cli are kept
|
||||||
|
|
|
||||||
|
|
@ -21,10 +21,10 @@ jobs:
|
||||||
"https://git.breadway.dev/${GITHUB_REPOSITORY}.git" src
|
"https://git.breadway.dev/${GITHUB_REPOSITORY}.git" src
|
||||||
|
|
||||||
- name: build
|
- name: build
|
||||||
run: cd src && cargo build --release --locked
|
run: cd src && bash ci/build.sh cargo build --release --locked
|
||||||
|
|
||||||
- name: test
|
- name: test
|
||||||
run: cd src && cargo test --release --locked --workspace
|
run: cd src && bash ci/build.sh cargo test --release --locked --workspace
|
||||||
|
|
||||||
- name: prepare artifacts
|
- name: prepare artifacts
|
||||||
run: |
|
run: |
|
||||||
|
|
|
||||||
|
|
@ -17,10 +17,10 @@ jobs:
|
||||||
"https://git.breadway.dev/${GITHUB_REPOSITORY}.git" src
|
"https://git.breadway.dev/${GITHUB_REPOSITORY}.git" src
|
||||||
|
|
||||||
- name: build
|
- name: build
|
||||||
run: cd src && cargo build --release --locked
|
run: cd src && bash ci/build.sh cargo build --release --locked
|
||||||
|
|
||||||
- name: test
|
- name: test
|
||||||
run: cd src && cargo test --release --locked --workspace
|
run: cd src && bash ci/build.sh cargo test --release --locked --workspace
|
||||||
|
|
||||||
- name: prepare artifacts
|
- name: prepare artifacts
|
||||||
run: |
|
run: |
|
||||||
|
|
|
||||||
1
ci/bread-ecosystem.rev
Normal file
1
ci/bread-ecosystem.rev
Normal file
|
|
@ -0,0 +1 @@
|
||||||
|
147cfbbf96ae4b171027defa1130d2caddb934b1
|
||||||
21
ci/build.sh
Executable file
21
ci/build.sh
Executable file
|
|
@ -0,0 +1,21 @@
|
||||||
|
#!/usr/bin/env bash
|
||||||
|
# Delegates to bread-ecosystem's shared CI build image/script, pinned to
|
||||||
|
# the commit in ci/bread-ecosystem.rev — not `main`. bread-ecosystem's CI
|
||||||
|
# files now affect every product's release pipeline, so bumping the pin
|
||||||
|
# is a deliberate act instead of silent drift (see the bread-theme test
|
||||||
|
# that broke here for exactly that reason, before it was pinned by rev).
|
||||||
|
#
|
||||||
|
# Usage: ci/build.sh cargo build --release --locked
|
||||||
|
set -euo pipefail
|
||||||
|
|
||||||
|
ROOT="$(cd "$(dirname "${BASH_SOURCE[0]}")/.." && pwd)"
|
||||||
|
REV="$(cat "${ROOT}/ci/bread-ecosystem.rev")"
|
||||||
|
|
||||||
|
CACHE_DIR="/tmp/bread-ecosystem-ci-${REV}"
|
||||||
|
if [ ! -d "$CACHE_DIR" ]; then
|
||||||
|
rm -rf /tmp/bread-ecosystem-ci-*
|
||||||
|
git clone https://git.breadway.dev/Breadway/bread-ecosystem.git "$CACHE_DIR"
|
||||||
|
git -C "$CACHE_DIR" checkout --quiet "$REV"
|
||||||
|
fi
|
||||||
|
|
||||||
|
bash "${CACHE_DIR}/ci/build.sh" bread "$ROOT" "$@"
|
||||||
Loading…
Add table
Add a link
Reference in a new issue