- Rust 71.4%
- HTML 23.7%
- Python 4.9%
| Filename | Latest commit message | Latest commit date |
|---|---|---|
|
All checks were successful
Release / version (push) Successful in 2s
Release / build (gcc-aarch64-linux-gnu libc6-dev-arm64-cross, aarch64-linux-gnu-gcc, aarch64-unknown-linux-gnu) (push) Successful in 2m18s
coverage 69.43% of lines
CI / check (push) Successful in 3m1s
Release / build (x86_64-unknown-linux-gnu) (push) Successful in 1m9s
Release / publish (push) Successful in 10s
|
||
| .cargo | ||
| .forgejo | ||
| .sqlx | ||
| fixtures | ||
| migrations | ||
| src | ||
| templates | ||
| tests | ||
| www | ||
| .env.example | ||
| .gitignore | ||
| build.rs | ||
| Cargo.lock | ||
| Cargo.toml | ||
| docker-compose.yml | ||
| README.md | ||
Pulse - monitor system health
Local setup
Prerequisites:
- Cargo installed
- Docker installed
After cloning the repository copy the .env.example file and adjust the values accordingly.
Then to run the application in development:
# Start up the database
docker compose up -d
# Migrate the database first
cargo run -- migrate
# Run the actual web server
cargo run -- run
By default, it will run the default backend binary.
To run the cli binary:
cargo run --bin pulse_cli
Migrations
To work with migrations it is useful to have the sqlx CLI installed:
cargo install sqlx-cli --no-default-features --features postgres
Then you can run:
sqlx migrate add <name>
# For reversible migrations
sqlx migrate add <name> --reversible
For better experience always prefer adding reversible migrations.
Before commiting, prepare offline queries:
cargo sqlx prepare -- --all-targets --all-features
Code hygiene
Before pushing run formatting and clippy to ensure code quality is up:
cargo fmt --all
cargo clippy --all-targets --all-features --fix --lib --allow-dirty
cargo prep-sql
Test coverage
Coverage is measured with cargo-llvm-cov
(LLVM source-based instrumentation). One-time setup:
rustup component add llvm-tools-preview
cargo install cargo-llvm-cov
The test suite uses #[sqlx::test], which creates a throwaway database per test, so it needs a live Postgres. Tests
do not load .env (dotenv is only called by the server binary), so export the URL yourself — and note it must include
the /pulse database path segment, which the value in .env.example omits:
docker compose up -d
export DATABASE_URL=postgresql://pulse:pulse@localhost:5432/pulse
Then:
cargo cov # writes lcov.info at the repo root (for editors)
cargo cov-html # renders target/llvm-cov/html and opens it in a browser
cargo cov-text # per-file summary table in the terminal
VSCode
Install the Coverage Gutters
extension (ryanluker.vscode-coverage-gutters), run cargo cov, then run Coverage Gutters: Watch from the command
palette. It picks up lcov.info from the workspace root with no further configuration.
RustRover
Run cargo cov, then Run | Manage Coverage Reports… (Ctrl+Alt+F6) → Add and select
lcov.info to display it in the Coverage tool window. Recent RustRover builds can also instrument directly: More
Actions → Run with Coverage on the cargo test run configuration. If neither works on your version, cargo cov-html is
always available.
CI
Every CI run prints a per-file coverage summary in the job summary and uploads a coverage
artifact containing lcov.info plus the browsable HTML report. Coverage is reported only — it never fails the build.