Files
breeze/.github/workflows/ci.yml
T
waozi 61dcd9bbba Check build laws with Ziran instead of Bend
Sync retry and the private-data layout are ordinary Ziran modules with
#law obligations checked by ziran check. The Bend proofs, Node generators,
pinned Bend dependency and Node build tool are removed, and a mutation test
shows each law rejects a deliberately broken implementation.
2026-09-28 19:23:19 -03:00

276 lines
8.5 KiB
YAML

name: CI
on:
push:
branches:
- master
pull_request:
branches:
- master
workflow_dispatch:
permissions:
contents: read
concurrency:
group: ${{ github.workflow }}-${{ github.ref }}
cancel-in-progress: true
jobs:
secret-scan:
name: Secret Scan
runs-on: ubuntu-latest
steps:
- name: Checkout Repository
uses: actions/checkout@v4
with:
fetch-depth: 0
- name: Fetch Ziran packages
run: sh scripts/packages.sh --locked
- name: Check Version Consistency
run: |
python3 scripts/check-version.py
python3 tests/version_test.py
- name: Scan Tracked Files and History
run: |
set -euo pipefail
python3 scripts/check-secrets.py --working-tree
python3 scripts/check-secrets.py --history
guard-package-urls:
name: Package URLs are public HTTPS
runs-on: ubuntu-latest
steps:
# Plain checkout on purpose: the guard must not depend on fetching
# the packages it validates (an SSH URL would break that fetch).
- name: Checkout Repository
uses: actions/checkout@v4
- name: Reject submodules and non-HTTPS package URLs
run: |
set -eu
if [ -f .gitmodules ]; then
echo "::error::Dependencies are Ziran packages in ziran.toml, not submodules"
exit 1
fi
bad=$(grep -nE '^[[:space:]]*git[[:space:]]*=' ziran.toml \
| grep -vE '^[0-9]+:[[:space:]]*git[[:space:]]*=[[:space:]]*"https://' || true)
if [ -n "$bad" ]; then
echo "::error::Non-HTTPS package URL(s) break fresh clones and CI:$bad"
exit 1
fi
echo "all package URLs HTTPS - ok"
test:
name: Test
runs-on: ubuntu-latest
needs:
- guard-package-urls
- secret-scan
timeout-minutes: 60
env:
APT_CACHE_DIR: /tmp/apt-cache
steps:
- name: Checkout Repository
uses: actions/checkout@v4
with:
fetch-depth: 1
lfs: true
- name: Fetch Ziran packages
run: sh scripts/packages.sh --locked
- name: Set up Node.js
uses: actions/setup-node@v4
with:
node-version: 22
- name: Cache Test apt packages
uses: actions/cache@v4
with:
path: ${{ env.APT_CACHE_DIR }}
key: test-apt-${{ runner.os }}-${{ runner.arch }}-${{ hashFiles('.github/apt/test-packages.txt') }}
restore-keys: |
test-apt-${{ runner.os }}-${{ runner.arch }}-
- name: Install Test Dependencies
timeout-minutes: 15
run: .github/scripts/install-apt-packages.sh .github/apt/test-packages.txt
- name: Run Tests
run: make test
- name: Check out sync test server
uses: actions/checkout@v4
with:
repository: kryonlabs/daochi
ref: 902230435fba6f64f5067afab551410456fb57d0
path: .test-server
submodules: recursive
- name: Set up Go for sync test server
uses: actions/setup-go@v5
with:
go-version-file: .test-server/go.mod
cache-dependency-path: .test-server/go.sum
- name: Verify sync and recovery
run: |
make -C .test-server build
make sync-server-test DAOCHI_BIN="$GITHUB_WORKSPACE/.test-server/daochi"
build-chrome-extension:
name: Build Chrome Extension
runs-on: ubuntu-latest
timeout-minutes: 60
needs: test
env:
APT_CACHE_DIR: /tmp/apt-cache
steps:
- name: Checkout Repository
uses: actions/checkout@v4
with:
fetch-depth: 1
lfs: true
- name: Fetch Ziran packages
run: sh scripts/packages.sh --locked
- name: Set up Node.js
uses: actions/setup-node@v4
with:
node-version: 22
- name: Cache Web apt packages
uses: actions/cache@v4
with:
path: ${{ env.APT_CACHE_DIR }}
key: web-apt-${{ runner.os }}-${{ runner.arch }}-${{ hashFiles('.github/apt/web-packages.txt') }}
restore-keys: |
web-apt-${{ runner.os }}-${{ runner.arch }}-
- name: Install Web Dependencies
timeout-minutes: 15
run: .github/scripts/install-apt-packages.sh .github/apt/web-packages.txt
- name: Set up Emscripten
run: |
set -euo pipefail
git clone --depth 1 https://github.com/emscripten-core/emsdk.git "$HOME/emsdk"
"$HOME/emsdk/emsdk" install latest
"$HOME/emsdk/emsdk" activate latest
echo "EMSDK=$HOME/emsdk" >> "$GITHUB_ENV"
echo "EM_CONFIG=$HOME/emsdk/.emscripten" >> "$GITHUB_ENV"
echo "INBE_NODE_BIN=$(dirname "$(command -v node)")" >> "$GITHUB_ENV"
echo "$HOME/emsdk/upstream/emscripten" >> "$GITHUB_PATH"
bash scripts/ensure-emscripten-zlib.sh "$HOME/emsdk/upstream/emscripten/embuilder"
- name: Build Chrome Extension ZIP
run: |
set -euo pipefail
export PATH="$INBE_NODE_BIN:$PATH"
node --version
make package-unpackaged-assets
make chrome-web-store
test -f build/dist/inbe-chrome-web-store.zip
- name: Run Web Smoke Test
run: |
set -euo pipefail
export PATH="$INBE_NODE_BIN:$PATH"
make web-smoke-test
- name: Run Canvas Web Smoke Test
run: |
set -euo pipefail
export PATH="$INBE_NODE_BIN:$PATH"
make web-canvas
make web-canvas-smoke-test
build-firefox-addons:
name: Build Firefox Add-on
runs-on: ubuntu-latest
timeout-minutes: 60
needs: test
env:
APT_CACHE_DIR: /tmp/apt-cache
steps:
- name: Checkout Repository
uses: actions/checkout@v4
with:
fetch-depth: 1
lfs: true
- name: Fetch Ziran packages
run: sh scripts/packages.sh --locked
- name: Set up Node.js
uses: actions/setup-node@v4
with:
node-version: 22
- name: Cache Web apt packages
uses: actions/cache@v4
with:
path: ${{ env.APT_CACHE_DIR }}
key: web-apt-${{ runner.os }}-${{ runner.arch }}-${{ hashFiles('.github/apt/web-packages.txt') }}
restore-keys: |
web-apt-${{ runner.os }}-${{ runner.arch }}-
- name: Install Web Dependencies
timeout-minutes: 15
run: .github/scripts/install-apt-packages.sh .github/apt/web-packages.txt
- name: Set up Emscripten
run: |
set -euo pipefail
git clone --depth 1 https://github.com/emscripten-core/emsdk.git "$HOME/emsdk"
"$HOME/emsdk/emsdk" install latest
"$HOME/emsdk/emsdk" activate latest
echo "EMSDK=$HOME/emsdk" >> "$GITHUB_ENV"
echo "EM_CONFIG=$HOME/emsdk/.emscripten" >> "$GITHUB_ENV"
echo "INBE_NODE_BIN=$(dirname "$(command -v node)")" >> "$GITHUB_ENV"
echo "$HOME/emsdk/upstream/emscripten" >> "$GITHUB_PATH"
bash scripts/ensure-emscripten-zlib.sh "$HOME/emsdk/upstream/emscripten/embuilder"
- name: Build Firefox Add-on ZIP
run: |
set -euo pipefail
export PATH="$INBE_NODE_BIN:$PATH"
node --version
make package-unpackaged-assets
make firefox-addons
test -f build/dist/inbe-firefox-addons.zip
make firefox-addons-lint
- name: Install Firefox (Mozilla build)
timeout-minutes: 15
run: |
set -euo pipefail
.github/scripts/install-apt-packages.sh .github/apt/empty-packages.txt \
xvfb libgl1-mesa-dri libgl1 libegl1 mesa-utils || true
.github/scripts/install-apt-packages.sh .github/apt/empty-packages.txt \
libgtk-3-0t64 libx11-xcb1 libxcb-shm0 libasound2t64 libdbus-glib-1-2 \
libxt6t64 libxtst6 libpci3 || \
.github/scripts/install-apt-packages.sh .github/apt/empty-packages.txt \
libgtk-3-0 libx11-xcb1 libxcb-shm0 libasound2 libdbus-glib-1-2 libxt6 libxtst6 libpci3
curl -sL "https://download.mozilla.org/?product=firefox-latest&os=linux64&lang=en-US" \
-o "$HOME/firefox.tar.xz"
tar -xJf "$HOME/firefox.tar.xz" -C "$HOME"
test -x "$HOME/firefox/firefox"
echo "$HOME/firefox" >> "$GITHUB_PATH"
- name: Run Web Smoke Test (Firefox)
env:
LIBGL_ALWAYS_SOFTWARE: '1'
run: |
set -euo pipefail
export PATH="$INBE_NODE_BIN:$PATH"
xvfb-run -a --server-args="-screen 0 1280x1024x24" make web-smoke-test-firefox