Skip to content

docs: publish the Holochain 0.7.1 DNA hashes #316

docs: publish the Holochain 0.7.1 DNA hashes

docs: publish the Holochain 0.7.1 DNA hashes #316

Workflow file for this run

name: Build
on:
push:
branches: [main, dev]
pull_request:
branches: [main, dev]
jobs:
build:
runs-on: ubuntu-latest
steps:
- uses: actions/checkout@v4
with:
submodules: recursive
- uses: cachix/install-nix-action@v26
with:
github_access_token: ${{ secrets.GITHUB_TOKEN }}
- uses: cachix/cachix-action@v14
with:
name: holochain-ci
skipPush: true
- uses: Swatinem/rust-cache@v2
with:
workspaces: |
. -> target
vendor/hrea -> vendor/hrea/target
- name: Install dependencies
run: nix develop --command bun install
- name: Build happ
run: nix develop --command bun run build:happ
# Primary backend suite (CLAUDE.md): pure predicate unit tests in
# crates/shared, then Sweettest against real conductors. Runs before e2e so a
# backend regression fails fast instead of surfacing as a confusing browser
# failure ten minutes later.
#
# Sharded one job per [[test]] target. Measured on the first CI run of the
# whole suite in a single job (run 31736241424): 61 min total — 16 min of
# compile plus 40 min of tests executed back-to-back. Sharding overlaps the
# test time so wall clock tracks the slowest target rather than their sum:
#
# nondominium 16m · resource 13m · governance 6m · person 4m · misc 1.5m
#
# Two details make this work and are easy to undo by accident:
#
# * NO custom CARGO_TARGET_DIR. `CLAUDE.md` documents
# `CARGO_TARGET_DIR=target/native-tests` for local runs, which keeps the
# native test artifacts away from the wasm build. In CI that path falls
# outside what Swatinem/rust-cache saves, so every run recompiled
# holochain's test_utils from scratch — the 16 min. The default `target/`
# is cached, and cargo already separates wasm by target triple.
# * `shared-key` so all shards restore ONE cache rather than fighting over
# five. The first run on a new lockfile still pays the compile in
# parallel; later runs restore it.
#
# --test-threads 2: each Sweettest spawns conductors, and 6 threads with 11
# conductor tests in flight gets the runner OOM-killed (SIGTERM mid-suite).
#
# The largest target, nondominium, is split in halves (#142). At two threads
# a pair of conductor tests takes about 2.5 min, so a target's time grows
# with its test count: on dev d91fe28 (run 36675002358) nondominium ran 18
# tests in 28.6 min. Split, its halves ran 17.0 and 14.8 min (run
# 37550976485). resource was split too and measured worse: its halves took
# 5.5 and 20.1 min against 13 to 16 min whole, so it stays one target. The
# split lives in the run step below, as name filters on the same [[test]]
# target, so no test file has to change.
#
# The Group and Lobby DNAs have their own Sweettest packages (#160), run as
# further shards of this same job so a regression in either turns the check
# red: group_sweettest (`group`, `ndo_anchor`) and lobby_sweettest (`lobby`).
# An entry names its `package` and `threads`; the nondominium entries above
# name neither and keep nondominium_sweettest at 2 threads. The group
# entries run at 6 threads, the figure CLAUDE.md and TEST_COMMANDS.md give
# for that suite (two conductors per test); the 2-thread cap above was
# measured on the nondominium target, not on these.
#
# timeout-minutes: without it the runner default is 360 min, so a hung
# conductor holds a runner for six hours. 45 is about twice the slowest half
# measured above; hitting it names itself in the job annotation instead of
# reading as a test failure.
sweettest:
runs-on: ubuntu-latest
needs: build
timeout-minutes: 45
strategy:
# Report every failing target, not just the first — a shared regression
# usually breaks several, and seeing which ones is the diagnosis.
fail-fast: false
matrix:
include:
- target: misc
- target: person
- target: governance
- target: resource
- { target: nondominium, half: a }
- { target: nondominium, half: b }
- { package: group_sweettest, target: group, threads: 6 }
- { package: group_sweettest, target: ndo_anchor, threads: 6 }
- { package: lobby_sweettest, target: lobby, threads: 1 }
steps:
- uses: actions/checkout@v4
with:
submodules: recursive
- uses: cachix/install-nix-action@v26
with:
github_access_token: ${{ secrets.GITHUB_TOKEN }}
- uses: cachix/cachix-action@v14
with:
name: holochain-ci
skipPush: true
- uses: Swatinem/rust-cache@v2
with:
shared-key: sweettest
workspaces: |
. -> target
vendor/hrea -> vendor/hrea/target
- name: Install dependencies
run: nix develop --command bun install
# Sweettest loads the packaged .happ, so the WASM build is a prerequisite.
- name: Build happ
run: nix develop --command bun run build:happ
# Pure predicate tests — no conductors, seconds to run. Only needs to run
# once, so it rides the cheapest shard.
- name: Run shared-crate unit tests
if: matrix.target == 'misc'
run: nix develop --command cargo test --package nondominium_shared
# A split target lists its half `a` once, as libtest name filters (a
# substring match, any filter selects). Half `b` skips exactly those
# filters, so every test runs in exactly one half, including tests added
# later: a new test lands in `b` unless its name matches a filter. To
# rebalance, move a filter; never list `b` separately.
- name: Run Sweettest target
env:
PACKAGE: ${{ matrix.package || 'nondominium_sweettest' }}
TARGET: ${{ matrix.target }}
HALF: ${{ matrix.half }}
THREADS: ${{ matrix.threads || 2 }}
run: |
case "$TARGET" in
nondominium) half_a="ndo_layer0::ndo_lifecycle ndo_layer0::ndo_transition_history ndo_layer0::ndo_hibernation ndo_layer0::ndo_deprecat ndo_layer0::ndo_invalid" ;;
*) half_a="" ;;
esac
filters=()
case "$HALF" in
a) for f in $half_a; do filters+=("$f"); done ;;
b) for f in $half_a; do filters+=(--skip "$f"); done ;;
esac
nix develop --command cargo test --package "$PACKAGE" \
--test "$TARGET" -- --test-threads "$THREADS" "${filters[@]}"
# Browser-level e2e against real conductors (ui/tests/e2e). Gated behind
# sweettest so backend regressions fail before the slower browser suite runs.
e2e:
runs-on: ubuntu-latest
needs: sweettest
steps:
- uses: actions/checkout@v4
with:
submodules: recursive
- uses: cachix/install-nix-action@v26
with:
github_access_token: ${{ secrets.GITHUB_TOKEN }}
- uses: cachix/cachix-action@v14
with:
name: holochain-ci
skipPush: true
- uses: Swatinem/rust-cache@v2
with:
workspaces: |
. -> target
vendor/hrea -> vendor/hrea/target
- name: Install dependencies
run: nix develop --command bun install
- name: Build happ
run: nix develop --command bun run build:happ
- name: Build shared types
run: nix develop --command bash -c "cd packages/shared-types && bun run build"
- name: Install Playwright chromium
run: nix develop --command bash -c "cd ui && bunx playwright install --with-deps chromium"
- name: Run e2e suite
run: nix develop --command bun run e2e
- name: Upload test results
if: always()
uses: actions/upload-artifact@v4
with:
name: e2e-test-results
path: |
ui/test-results/
retention-days: 14