ci: add coverage badge pipeline and README badges
Some checks failed
continuous-integration/drone/push Build is failing

This commit is contained in:
Cinco Euzebio 2026-02-28 21:04:05 -03:00
parent 7c02b9f55d
commit 71971c7b1b
3 changed files with 49 additions and 0 deletions

View File

@ -6,6 +6,9 @@ trigger:
event:
- push
- pull_request
branch:
exclude:
- badges
steps:
- name: test
@ -15,6 +18,41 @@ steps:
- cargo clippy -- -D warnings
- cargo test
- name: coverage
image: xd009642/tarpaulin
privileged: true
environment:
GITEA_TOKEN:
from_secret: gitea_token
commands:
- apt-get update -qq && apt-get install -y -qq jq git curl
- cargo tarpaulin --out Json 2>/dev/null
- |
PCT=$(jq '.coverage | floor' tarpaulin-report.json)
if [ "$PCT" -ge 80 ]; then COLOR="brightgreen"
elif [ "$PCT" -ge 60 ]; then COLOR="yellow"
else COLOR="red"; fi
curl -sf "https://img.shields.io/badge/coverage-${PCT}%25-${COLOR}.svg" -o coverage.svg
- |
git config --global user.email "ci@drone"
git config --global user.name "Drone CI"
REPO="https://cinco:${GITEA_TOKEN}@git.cincoeuzebio.com/cinco/Tmuxido.git"
if git clone --branch badges --single-branch "$REPO" _badges 2>/dev/null; then
cp coverage.svg _badges/
cd _badges
git add coverage.svg
git diff --cached --quiet || git commit -m "ci: update coverage badge [CI SKIP]"
git push
else
mkdir _badges && cp coverage.svg _badges/
cd _badges && git init
git remote add origin "$REPO"
git checkout --orphan badges
git add coverage.svg
git commit -m "ci: add coverage badge"
git push origin badges
fi
---
kind: pipeline
type: docker

View File

@ -4,6 +4,12 @@ All notable changes to this project will be documented in this file.
The format is based on [Keep a Changelog](https://keepachangelog.com/en/1.0.0/).
## [Unreleased]
### Added
- Coverage badge generated by `cargo-tarpaulin` in CI, hosted on the `badges` branch
- CI status, coverage, version, and Rust edition badges in README
## [0.2.1] - 2026-02-28
### Added

View File

@ -1,5 +1,10 @@
# tmuxido
[![CI](https://drone.cincoeuzebio.com/api/badges/cinco/Tmuxido/status.svg)](https://drone.cincoeuzebio.com/cinco/Tmuxido)
[![Coverage](https://git.cincoeuzebio.com/cinco/Tmuxido/raw/branch/badges/coverage.svg)](https://drone.cincoeuzebio.com/cinco/Tmuxido)
[![Version](https://img.shields.io/gitea/v/release/cinco/Tmuxido?gitea_url=https%3A%2F%2Fgit.cincoeuzebio.com&label=version)](https://git.cincoeuzebio.com/cinco/Tmuxido/releases)
![Rust 2024](https://img.shields.io/badge/rust-edition_2024-orange?logo=rust)
A Rust-based tool to quickly find and open projects in tmux using fzf. No external dependencies except tmux and fzf!
## Features