GITv

Run formatting, lints, tests and a dependency audit in CI

Browse files

A GitHub Actions workflow checks formatting, runs clippy with warnings as errors and the full test suite on every push and pull request, and runs cargo audit against the RustSec database on pushes and weekly. Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>

Author
Um9i vulgarmessiah@gmail.com
Date
22 Nov 2026, 16:20
Commit
01924c93ac1b
Parent
7becb1a

2 files changed +42−0

@@ -0,0 +1,40 @@
name: CI
on:
push:
pull_request:
schedule:
# Weekly, so new advisories against unchanged dependencies still surface.
- cron: "17 6 * * 1"
permissions:
contents: read
env:
CARGO_TERM_COLOR: always
jobs:
check:
name: Format, lint and test
runs-on: ubuntu-latest
if: github.event_name != 'schedule'
steps:
- uses: actions/checkout@v4
- uses: dtolnay/rust-toolchain@stable
with:
components: rustfmt, clippy
- uses: Swatinem/rust-cache@v2
- run: cargo fmt --check
- run: cargo clippy --all-targets --locked -- -D warnings
# The integration tests drive real git, rsync, flock and mountpoint, all on the runner.
- run: cargo test --locked
audit:
name: Dependency advisories
runs-on: ubuntu-latest
steps:
- uses: actions/checkout@v4
- uses: taiki-e/install-action@v2
with:
tool: cargo-audit
- run: cargo audit
+2−0
@@ -83,6 +83,8 @@ cargo test
`tests/ssh.rs` runs `gitv serve` the way a key does over SSH, pushing and cloning real repositories through a stand-in for ssh. `tests/web.rs` builds a fixture repository and checks every page of a running `gitv-web` over HTTP, signed in, including escaping and the requests it must refuse. `tests/auth.rs` covers signing in, two-factor codes, lockout, sessions and changing the password. Neither needs an SSH server or network access; both write only to `target/tmp`.
`.github/workflows/ci.yml` runs the same checks on every push and pull request (`cargo fmt --check`, clippy with warnings as errors, `cargo test`), plus `cargo audit` against the RustSec advisory database, also weekly so new advisories surface without a push.
## Configuration
Settings that differ between installations live in `/etc/gitv/gitv.conf` (`deploy/gitv.conf` is this server's copy; `$GITV_CONFIG` points elsewhere):