Skip to content

Commit

Permalink
chore: generate coverage report
Browse files Browse the repository at this point in the history
Refs: #43
  • Loading branch information
sripwoud committed Aug 8, 2024
1 parent 46273f2 commit 3236dd8
Show file tree
Hide file tree
Showing 3 changed files with 29 additions and 7 deletions.
27 changes: 23 additions & 4 deletions .github/workflows/main.yml
Original file line number Diff line number Diff line change
Expand Up @@ -39,8 +39,27 @@ jobs:
runs-on: ubuntu-latest
steps:
- uses: actions/checkout@v4
- name: Install cargo-nextest
uses: taiki-e/[email protected]
- uses: dtolnay/rust-toolchain@stable
- uses: Swatinem/[email protected]
- name: Install cargo-llvm-cov
uses: taiki-e/[email protected]
with:
tool: cargo-llvm-cov
- name: Run tests with coverage report
run: cargo llvm-cov --all-features report --output-path lcov.info
- name: Upload test coverage report
uses: actions/upload-artifact@v4
with:
name: lcov.info
path: lcov.info

coverage:
needs: test
runs-on: ubuntu-latest
steps:
- uses: actions/download-artifact@v4
with:
path: coverage
- uses: coverallsapp/[email protected]
with:
tool: cargo-nextest
- run: cargo nextest run
github-token: ${{ secrets.GITHUB_TOKEN }}
2 changes: 1 addition & 1 deletion .setup.sh
Original file line number Diff line number Diff line change
Expand Up @@ -38,7 +38,7 @@ maybe_install_local() {

install_dev_deps() {
log "Installing development dependencies..."
crates="convco dprint cargo-nextest"
crates="convco dprint cargo-llvm-cov cargo-nextest"

for crate in $crates; do
maybe_install_local "$crate"
Expand Down
7 changes: 5 additions & 2 deletions Makefile
Original file line number Diff line number Diff line change
Expand Up @@ -5,7 +5,7 @@ CYAN := \033[36m
RESET := \033[0m
PATH := $(DEV_BIN_DIR):$(PATH)

.PHONY: help build build.docs fix fmt lint setup test
.PHONY: help build build.docs check commit coverage docs fix fmt lint setup test

help: ## display this help message (default task)
@printf "%b\n" "Usage: make [$(CYAN)task$(RESET)]"
Expand All @@ -25,6 +25,9 @@ check: ## check that all files match formatting rules
commit: ## make conventional commit
@PATH=$(PATH) convco commit

coverage: ## generate coverage report
@PATH=$(PATH) cargo llvm-cov --all-features report

docs: ## build & open the documentation in the browser
@cargo doc --no-deps --open --all-features

Expand All @@ -41,4 +44,4 @@ setup: ## run the setup script to install dependencies
@./.setup.sh

test: ## run all tests
@cargo-nextest ntr
@cargo-nextest ntr --all-features --all-targets --workspace

0 comments on commit 3236dd8

Please sign in to comment.