AnyBot/.gitea/workflows/ci.yml

47 lines
1.8 KiB
YAML

# Every push and pull request: build, test, clippy (report only — the tree is not rustfmt'
# clean, so `cargo fmt --check` would need its own one-time reformatting change first). Release builds are release.yml's job.
#
# Runners (see deploy/ci/README.md):
# anybot-linux a Linux computer with Docker; jobs run in anybot-builder:22.04
#
# The nightly `cargo check` keeps the window honest between releases; the computer-use
# bench (bench/computer-use) is NOT here on purpose: it needs a real test box (a Lima VM
# with gVisor, its own volume and image — see its README "怎麼跑"), and it must never run
# against a real box. Run it by hand per release, before tagging, and record the numbers
# in bench/computer-use/README.md.
name: CI
on:
pull_request:
push:
branches: [main]
env:
CARGO_TARGET_DIR: /ci-target
jobs:
check:
runs-on: anybot-linux
steps:
- uses: actions/checkout@v4
- name: Build
run: cargo build --bin anybot
- name: Test
# The step fails when a test fails (piped straight into `tail`, its result was
# tail's: always a pass). The end of the log is shown either way.
run: |
cargo test --bin anybot -- --skip live > "${RUNNER_TEMP:-/tmp}/test.log" 2>&1 || { tail -n 80 "${RUNNER_TEMP:-/tmp}/test.log"; exit 1; }
tail -n 5 "${RUNNER_TEMP:-/tmp}/test.log"
- name: Clippy (report only)
run: cargo clippy --bin anybot 2>&1 | tail -30
- name: Relay build and test
run: cd relay && cargo test
windows-check:
# C9: the Windows engine is real code now; where a Windows runner exists, it must compile.
# Report-only until the release ships Windows binaries.
runs-on: windows
continue-on-error: true
steps:
- uses: actions/checkout@v4
- run: cargo check --bin anybot