add-ci-checks #28

Merged
clawdie merged 2 commits from add-ci-checks into main 2026-06-13 09:58:01 +02:00
4 changed files with 73 additions and 3 deletions

41
.forgejo/workflows/ci.yml Normal file
View file

@ -0,0 +1,41 @@
# Forgejo Actions CI for Colibri.
#
# Gates every push to main and every pull request on the same checks agents are
# expected to run locally (./scripts/ci-checks.sh): rustfmt, clippy, workspace
# tests, and the markdown format gate. This is what would have caught the
# build-break that PR #23 had to fix.
#
# Requirements (verify on the Forgejo instance):
# - A registered Forgejo Actions runner whose labels include `ubuntu-latest`
# (adjust `runs-on` below to match your runner's label if different).
# - The runner can pull the `rust` and `node` container images and reach
# crates.io / npm for dependencies.
name: CI
on:
push:
branches: [main]
pull_request:
jobs:
rust:
runs-on: ubuntu-latest
container: rust:1.95
steps:
- uses: actions/checkout@v4
- name: Ensure rustfmt + clippy are present
run: rustup component add rustfmt clippy
- name: cargo fmt --check
run: cargo fmt --check
- name: cargo clippy (warnings = errors)
run: cargo clippy --workspace --all-targets -- -D warnings
- name: cargo test --workspace
run: cargo test --workspace
markdown:
runs-on: ubuntu-latest
container: node:20
steps:
- uses: actions/checkout@v4
- name: Markdown format gate
run: ./scripts/check-format.sh

View file

@ -348,7 +348,12 @@ fn parse_skill_options(args: &[String]) -> Result<(Option<String>, Option<String
category = Some(value.clone());
i += 2;
}
other => return Err(format!("unknown register-skill option: {other}\n\n{}", usage())),
other => {
return Err(format!(
"unknown register-skill option: {other}\n\n{}",
usage()
))
}
}
}
Ok((description, category))

View file

@ -21,8 +21,7 @@ const OSA_WATCHDOG_STATUS: &str =
const OSA_WATCHDOG_RUN: &str =
include_str!("../../../manifests/2026-05-26-osa-watchdog-host-status-run-manifest.json");
const DEBBY_INV: &str = include_str!("../../../manifests/2026-05-26-debby-runtime-inventory.json");
const USB_INV: &str =
include_str!("../../../manifests/2026-06-04-usb-runtime-inventory.json");
const USB_INV: &str = include_str!("../../../manifests/2026-06-04-usb-runtime-inventory.json");
fn roundtrip_eq<T>(value: &T)
where

25
scripts/ci-checks.sh Executable file
View file

@ -0,0 +1,25 @@
#!/bin/sh
# Run every repository gate, the same set CI runs. Use this before pushing.
#
# ./scripts/ci-checks.sh
#
# Gates: rustfmt, clippy (warnings = errors), workspace tests, markdown format.
set -eu
ROOT_DIR="$(CDPATH= cd -- "$(dirname -- "$0")/.." && pwd)"
cd "$ROOT_DIR"
echo "==> cargo fmt --check"
cargo fmt --check
echo "==> cargo clippy --workspace --all-targets -- -D warnings"
cargo clippy --workspace --all-targets -- -D warnings
echo "==> cargo test --workspace"
cargo test --workspace
echo "==> markdown format gate"
./scripts/check-format.sh
echo "All checks passed."