From 08dc29012bc36e10a668ef406d4532ec8f3d1e60 Mon Sep 17 00:00:00 2001 From: Breadway Date: Tue, 1 Sep 2026 17:15:27 +0800 Subject: [PATCH] ci: add a branch/main check.yml (clippy + test) MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit The only CI here was dev-release.yml / rc-release.yml / release.yml — the publish workflows. Nothing ran clippy or the test suite, so a PR (or a push straight to main, which publishes a dev build) could ship with lint errors or failing tests. This runs `cargo clippy --all-targets -D warnings` + `cargo test` on feature/**, fix/**, and main. The Tauri crate is at ./src; clippy and tests don't need the built frontend. fmt not gated yet (tree isn't fmt-clean — separate change). --- .forgejo/workflows/check.yml | 33 +++++++++++++++++++++++++++++++++ 1 file changed, 33 insertions(+) create mode 100644 .forgejo/workflows/check.yml diff --git a/.forgejo/workflows/check.yml b/.forgejo/workflows/check.yml new file mode 100644 index 0000000..0678caf --- /dev/null +++ b/.forgejo/workflows/check.yml @@ -0,0 +1,33 @@ +name: check + +# Lint + test on work branches AND on `main` — a push to `main` publishes a +# dev-track build (dev-release.yml), so it should be clippy'd and tested +# first. Before this the only CI here was the dev/rc/release publish +# workflows, none of which run clippy or the test suite. +# +# The Tauri crate lives at ./src (not the usual src-tauri). clippy and the +# test suite don't need the built frontend (frontendDist is only consumed by +# a release `cargo build`), so this stays fast — no `npm` step. +# +# fmt is not gated yet: the tree isn't `cargo fmt` clean and normalising it +# is a separate change. +on: + push: + branches: ['feature/**', 'fix/**', 'main'] + +jobs: + check: + runs-on: [self-hosted, hestia] + steps: + - name: checkout + run: | + set -euo pipefail + rm -rf src && mkdir src + git clone --branch "${GITHUB_REF_NAME}" --depth 1 \ + "https://git.breadway.dev/${GITHUB_REPOSITORY}.git" src + + - name: clippy + run: cd src/src && cargo clippy --all-targets --locked -- -D warnings + + - name: test + run: cd src/src && cargo test --locked