Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
80 changes: 80 additions & 0 deletions .github/workflows/linux.yml
Original file line number Diff line number Diff line change
Expand Up @@ -72,6 +72,86 @@ jobs:
- name: Root-owned install, cf-execd and canary (step 7)
run: tests/deploy/linux-install.sh

# Upstream cfengine/core and libntech at the overlay bases plus the overlay
# (docs/architecture/upstream-overlay.md §4, §7), not the pinned fork. It is
# the proof that the overlay's all-or-nothing loader (overlay/core/0002) and
# the strict JSON parse (overlay/libntech/0005, 0006) build, and that the
# loader's unit and acceptance tests and run.sh (TENDCF_REQUIRE_FORK_LOADER=1;
# its check 4b probes the loader and fails on any build that kept a
# per-entry skip) pass on them as on the fork build. The loader source is the
# fork's bar the R1 accessor; behaviour is NOT proven equal for JSON numbers
# (B-4, B-10 and core's rlist.c fix are not in the overlay,
# upstream-overlay.md §7). One leg: the point is the overlay, not the
# platform matrix. `bin/overlay.py check` (weekly) only
# proves the patches apply to upstream master, not that they compile (R1).
overlay-build:
runs-on: ubuntu-24.04
steps:
- uses: actions/checkout@v4
- name: Fetch core and libntech at the overlay bases
shell: bash
run: |
set -euo pipefail
m() { python3 -c "import json,sys;print(json.load(open('overlay/overlay.json'))['components'][sys.argv[1]][sys.argv[2]])" "$@"; }
core_base=$(m core base)
lib_base=$(m libntech base)
git init -q /tmp/core
git -C /tmp/core remote add origin "$(m core upstream)"
timeout 600 git -C /tmp/core fetch -q --depth 1 origin "$core_base"
git -C /tmp/core checkout -q FETCH_HEAD
# core's submodule pointer at its base is libntech's base (upstream-overlay.md §3)
pin=$(git -C /tmp/core rev-parse HEAD:libntech)
test "$pin" = "$lib_base" || { echo "libntech base $lib_base is not core's submodule pin $pin"; exit 1; }
git init -q /tmp/core/libntech
git -C /tmp/core/libntech remote add origin "$(m libntech upstream)"
timeout 600 git -C /tmp/core/libntech fetch -q --depth 1 origin "$lib_base"
git -C /tmp/core/libntech checkout -q FETCH_HEAD
- name: Apply the overlay (upstream-overlay.md §4)
shell: bash
run: |
set -euo pipefail
# python3, not the uv shebang: the script has no dependencies
python3 bin/overlay.py apply core --checkout /tmp/core
python3 bin/overlay.py apply libntech --checkout /tmp/core/libntech
git -C /tmp/core add libntech
{
echo "### CFEngine overlay build"
echo
for c in core libntech; do
n=$(python3 -c "import json,sys;print(len(json.load(open('overlay/overlay.json'))['components'][sys.argv[1]]['patches']))" "$c")
if [ "$c" = core ]; then dir=/tmp/core; else dir=/tmp/core/libntech; fi
echo "- $c: base \`$(python3 -c "import json,sys;print(json.load(open('overlay/overlay.json'))['components'][sys.argv[1]]['base'])" "$c")\` plus $n patches, tree \`$(git -C "$dir" rev-parse 'HEAD^{tree}')\` (asserted by apply)"
done
} >> "$GITHUB_STEP_SUMMARY"
- name: Build dependencies (core's own script; Debian/Ubuntu branch)
run: /tmp/core/ci/dependencies.sh
- name: Configure and build
shell: bash
run: |
set -euo pipefail
cd /tmp/core
./autogen.sh --enable-debug --prefix=/tmp/overlay-cf --with-systemd-service=no
make -j"$(nproc)" CFLAGS="-Wall"
make install
/tmp/overlay-cf/bin/cf-agent --version
- name: Loader unit tests (cmdb_test) and libntech json and mustache tests
shell: bash
run: |
set -euo pipefail
make -C /tmp/core/tests/unit check TESTS=cmdb_test
make -C /tmp/core/libntech/tests/unit check TESTS="json_test mustache_test"
- name: Loader acceptance tests (06_host_specific_data)
shell: bash
run: |
set -euo pipefail
cd /tmp/core/tests/acceptance
chmod -R go-w .
./testall --printlog --tests=common,errorlog,errorexit,errorpass 00_basics/06_host_specific_data
- name: Generic-bundle tests (the loader capability probe must pass)
env:
TENDCF_REQUIRE_FORK_LOADER: "1"
run: tests/policy/run.sh --bindir /tmp/overlay-cf/bin

debian-13:
runs-on: ubuntu-24.04
container: debian:13
Expand Down
8 changes: 6 additions & 2 deletions AGENTS.md
Original file line number Diff line number Diff line change
Expand Up @@ -359,8 +359,12 @@ a book: `site-private/AGENTS.md` ("Book knowledge base").
- Linux CI (`.github/workflows/linux.yml`) builds the fork at the commit in
`overlay/fork.json` (`--prefix=/opt/tendcf`) and runs the fork's
unit/acceptance subsets plus the scripts above on ubuntu-24.04/26.04/24.04-arm
and a `debian:13` container, which also uploads the pastebin artifact. Moving
the pin is a commit. `check.yml` runs `bin/schema_lint.py`,
and a `debian:13` container, which also uploads the pastebin artifact. The
`overlay-build` job builds upstream at the overlay bases plus `overlay/`
(the all-or-nothing loader and the strict parse; `upstream-overlay.md` §4,
§7) and runs `cmdb_test`, libntech's `json_test`/`mustache_test`, the
`06_host_specific_data` acceptance directory and `run.sh` with
`TENDCF_REQUIRE_FORK_LOADER=1` on it. Moving the pin is a commit. `check.yml` runs `bin/schema_lint.py`,
`bin/xref_lint.py`, `bin/overlay.py lint`, the canary check and `shellcheck`.
- Plan and status: `docs/architecture/linux-targets.md` §3; the NixOS side in
`docs/architecture/nixos-passthrough-plan.md`. Live hosts: pastebin (root
Expand Down
Loading
Loading