forge
Clone
https://git.tahinli.com/Tahinli/forge.git
0 watching0 forksRustAGPL-3.07.1 MiB490f099Tahinli7 hours ago322 commits
| 1 | # CI for forge itself. Format: docs/ci.md, parser: crates/forge-ci/src/config.rs. |
| 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 and no memory is declared. An earlier run |
| 5 | # with concurrency 4 hit a host-wide OOM and the kernel killed rustc mid-build. |
| 6 | # A tag push matching "v*" publishes a release with the job's binaries and SHA256SUMS, and |
| 7 | # self-update deploys forge-<arch>-linux. Both happen only when the job succeeded. |
| 8 | # |
| 9 | # The job is named build because self-update's `job` setting and the release assets name it. |
| 10 | |
| 11 | [on] |
| 12 | push = ["main"] |
| 13 | pull_request = true |
| 14 | manual = true |
| 15 | tags = ["v*"] |
| 16 | |
| 17 | [jobs.build] |
| 18 | image = "docker.io/library/rust:1" |
| 19 | # Build parallelism comes from the runner (CARGO_BUILD_JOBS follows its CPU limit). Drops debuginfo. |
| 20 | # CARGO_HOME in the workspace puts the downloaded crates in the cache, so a run downloads only new ones. |
| 21 | # That places turso_core's source inside this repo, and its build.rs then watches our .git/HEAD, which |
| 22 | # is new in every job, so it would rebuild on every run. With SOURCE_DATE_EPOCH set it skips git. |
| 23 | # Incremental is off: since topcoat 0.12 the forge-web test build was OOM-killed with it on (runs 156, 158). |
| 24 | env = { CARGO_INCREMENTAL = "0", CARGO_PROFILE_DEV_DEBUG = "0", CARGO_PROFILE_TEST_DEBUG = "0", CARGO_HOME = "/workspace/.cargo-home", SOURCE_DATE_EPOCH = "0" } |
| 25 | # Unit tests run first, so a failure shows before the release build. The e2e tests then run against |
| 26 | # the binary this job ships, so forge is not compiled a third time just for them. |
| 27 | # The groups are the job's steps on the run page, and `exec 2>&1` keeps a marker in order with cargo's |
| 28 | # stderr, which the runner reads from a separate pipe. |
| 29 | run = """ |
| 30 | exec 2>&1 |
| 31 | echo "::group::Unit tests" |
| 32 | cargo test --workspace --exclude forge-e2e |
| 33 | echo "::endgroup::" |
| 34 | echo "::group::Release build" |
| 35 | cargo build --profile dist -p forge-web -p forge-runner |
| 36 | echo "::endgroup::" |
| 37 | echo "::group::E2E tests" |
| 38 | FORGE_BIN="$PWD/target/dist/forge" cargo test -p forge-e2e |
| 39 | echo "::endgroup::" |
| 40 | echo "::group::Package" |
| 41 | ARCH=$(uname -m) |
| 42 | cp target/dist/forge forge-$ARCH-linux |
| 43 | cp target/dist/forge-runner forge-runner-$ARCH-linux |
| 44 | sha256sum forge-$ARCH-linux forge-runner-$ARCH-linux > SHA256SUMS |
| 45 | echo "::endgroup::" |
| 46 | """ |
| 47 | artifacts = ["forge-*-linux", "SHA256SUMS"] |
| 48 | cache = ["target", ".cargo-home"] |
| 49 | timeout_minutes = 240 |
| 50 | |
| 51 | [release] |
| 52 | assets = ["build:forge-*-linux", "build:SHA256SUMS"] |