forge
Explore
Log in

Don't you dare go Hollow

im

Clone
★ 0

0 watching0 forksRustAGPL-3.0542.8 KiBb9f0726Tahinli27 days ago34 commits

ci.toml49 lines, 1.9 KiBHistoryRawDownload
1# CI for im. Format: forge's docs/ci.md.
2#
3# The workflow has no branch condition, so the job also runs for pull requests.
4# One job does everything, so its steps run one at a time. A tag push matching "v*" publishes a
5# release with the binary and SHA256SUMS, only when the job succeeded.
6
7name = "build"
8
9[on]
10push = ["main"]
11pull_request = true
12manual = true
13tags = ["v*"]
14
15[jobs.build]
16image = "docker.io/library/rust:1"
17# Build parallelism comes from the runner (CARGO_BUILD_JOBS follows its CPU limit). Drops debuginfo.
18# CARGO_HOME in the workspace puts the downloaded crates in the cache, so a run downloads only new ones.
19# That places turso_core's source inside this repo, and its build.rs then watches our .git/HEAD, which
20# is new in every job, so it would rebuild on every run. With SOURCE_DATE_EPOCH set it skips git.
21env = { CARGO_PROFILE_DEV_DEBUG = "0", CARGO_PROFILE_TEST_DEBUG = "0", CARGO_HOME = "/workspace/.cargo-home", SOURCE_DATE_EPOCH = "0" }
22# Tests run first, so a failure shows before the slow LTO release build.
23# The groups are the job's steps on the run page, and `exec 2>&1` keeps a marker in order with cargo's
24# stderr, which the runner reads from a separate pipe.
25# IM_BUILD_SHA is what /healthz reports. safe.directory is needed because the checkout may be owned
26# by another uid inside the sandbox; without git it falls back to "dev".
27run = """
28exec 2>&1
29echo "::group::Tests"
30cargo test --workspace
31echo "::endgroup::"
32echo "::group::Release build"
33IM_BUILD_SHA=$(git -c safe.directory=/workspace rev-parse --short=12 HEAD 2>/dev/null || echo dev)
34export IM_BUILD_SHA
35echo "IM_BUILD_SHA=$IM_BUILD_SHA"
36cargo build --release -p im-web
37echo "::endgroup::"
38echo "::group::Package"
39ARCH=$(uname -m)
40cp target/release/im im-$ARCH-linux
41sha256sum im-$ARCH-linux > SHA256SUMS
42echo "::endgroup::"
43"""
44artifacts = ["im-*-linux", "SHA256SUMS"]
45cache = ["target", ".cargo-home"]
46timeout_minutes = 120
47
48[release]
49assets = ["build:im-*-linux", "build:SHA256SUMS"]