# CI for forge itself. Format: docs/ci.md, parser: crates/forge-ci/src/config.rs. # # The workflow has no branch condition, so the job also runs for pull requests. # One job does everything, so its steps run one at a time and no memory is declared. An earlier run # with concurrency 4 hit a host-wide OOM and the kernel killed rustc mid-build. # A tag push matching "v*" publishes a release with the job's binaries and SHA256SUMS, and # self-update deploys forge--linux. Both happen only when the job succeeded. # # The job is named build because self-update's `job` setting and the release assets name it. [on] push = ["main"] pull_request = true manual = true tags = ["v*"] [jobs.build] image = "docker.io/library/rust:1" # Build parallelism comes from the runner (CARGO_BUILD_JOBS follows its CPU limit). Drops debuginfo. # CARGO_HOME in the workspace puts the downloaded crates in the cache, so a run downloads only new ones. # That places turso_core's source inside this repo, and its build.rs then watches our .git/HEAD, which # is new in every job, so it would rebuild on every run. With SOURCE_DATE_EPOCH set it skips git. # Incremental is off: since topcoat 0.12 the forge-web test build was OOM-killed with it on (runs 156, 158). env = { CARGO_INCREMENTAL = "0", CARGO_PROFILE_DEV_DEBUG = "0", CARGO_PROFILE_TEST_DEBUG = "0", CARGO_HOME = "/workspace/.cargo-home", SOURCE_DATE_EPOCH = "0" } # Unit tests run first, so a failure shows before the release build. The e2e tests then run against # the binary this job ships, so forge is not compiled a third time just for them. # The groups are the job's steps on the run page, and `exec 2>&1` keeps a marker in order with cargo's # stderr, which the runner reads from a separate pipe. run = """ exec 2>&1 echo "::group::Unit tests" cargo test --workspace --exclude forge-e2e echo "::endgroup::" echo "::group::Release build" cargo build --profile dist -p forge-web -p forge-runner echo "::endgroup::" echo "::group::E2E tests" FORGE_BIN="$PWD/target/dist/forge" cargo test -p forge-e2e echo "::endgroup::" echo "::group::Package" ARCH=$(uname -m) cp target/dist/forge forge-$ARCH-linux cp target/dist/forge-runner forge-runner-$ARCH-linux sha256sum forge-$ARCH-linux forge-runner-$ARCH-linux > SHA256SUMS echo "::endgroup::" """ artifacts = ["forge-*-linux", "SHA256SUMS"] cache = ["target", ".cargo-home"] timeout_minutes = 240 [release] assets = ["build:forge-*-linux", "build:SHA256SUMS"]