Files
miner/.gitea/workflows/ci.yml
rob thijssen db6316713a
All checks were successful
ci / fmt (pull_request) Successful in 20s
ci / clippy (pull_request) Successful in 2m4s
ci / doc (pull_request) Successful in 2m8s
ci / test (pull_request) Successful in 6m27s
ci: add rustfmt and clippy components explicitly
rustup auto-installs the pinned toolchain from rust-toolchain on the runner
but not its listed components; the fmt job failed with "cargo-fmt is not
installed for the toolchain". Add the component in the two jobs that need it.

Co-Authored-By: Claude Fable 5.1 <noreply@anthropic.com>
Claude-Session: https://claude.ai/code/session_01CBgs2nSi4H2mdh8kD8vMX5
2026-09-03 12:54:29 +03:00

82 lines
2.6 KiB
YAML

---
# Lint, build and test on the fleet's `rust` runner (architecture/gitea-runners.md).
#
# Replaces origin's .github/workflows/ci.yml, which targeted GitHub-hosted
# runners that do not exist here. Gitea Actions also reads .github/workflows,
# so origin's files are deleted rather than left inert; on every origin merge
# `git rm -r .github/workflows` is the standing resolution (quantus/miner#1).
#
# Deliberately not here: origin's CPU benchmark job (meaningless on a shared
# 4-CPU runner; the real gate is the GPU harness, quantus/miner#2) and taplo
# (not on the runner image; add it to runner-rust per gitea-runners.md §5
# rather than `cargo install` on every run).
name: ci
on:
pull_request:
push:
branches: [main, origin-main]
concurrency:
group: ci-${{ github.event.pull_request.number || github.ref }}
cancel-in-progress: true
env:
CARGO_INCREMENTAL: "0"
CARGO_TERM_COLOR: always
# rust-toolchain pins 1.93.0. rustup on the runner auto-installs the toolchain
# on first use but NOT the components the file lists (observed: "cargo-fmt is
# not installed for the toolchain"), so each job that needs one adds it
# explicitly; the call is a no-op once present.
jobs:
fmt:
runs-on: rust
steps:
- uses: actions/checkout@v4
- name: toolchain
run: rustup component add rustfmt
- name: rustfmt
run: cargo fmt --all -- --check
clippy:
runs-on: rust
needs: fmt
steps:
- uses: actions/checkout@v4
- name: toolchain
run: rustup component add clippy
- name: clippy (all targets, all features, warnings denied)
# Same invocation as clippy.sh so local and CI agree.
run: cargo clippy --workspace --all-targets --all-features --locked -- -D warnings
test:
runs-on: rust
needs: fmt
steps:
- uses: actions/checkout@v4
- name: build
run: cargo build --locked --workspace
- name: test
# GPU tests skip themselves when no adapter is present; the runner has none.
run: cargo test --locked --workspace
- name: version carries the commit
# build.rs embeds the SHA; a binary that says "unknown" cannot be
# matched to a deploy (quantus/miner#8).
run: |
set -euo pipefail
v=$(./target/debug/quantus-miner --version)
echo "$v"
case "$v" in
*unknown*) echo "build SHA not embedded" >&2; exit 1 ;;
esac
doc:
runs-on: rust
needs: fmt
steps:
- uses: actions/checkout@v4
- name: doc
run: cargo doc --locked --workspace --no-deps --all-features