Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

chore: generate coverage report #46

Merged
merged 1 commit into from
Aug 8, 2024
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
31 changes: 27 additions & 4 deletions .github/workflows/main.yml
Original file line number Diff line number Diff line change
Expand Up @@ -39,8 +39,31 @@ 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 --all-targets --lcov --workspace --output-path lcov.info
- name: Upload test coverage report
uses: actions/upload-artifact@v4
with:
name: lcov.info
path: lcov.info

coverage:
needs: test
if: github.event_name == 'push' && github.ref == 'refs/heads/main'
runs-on: ubuntu-latest
steps:
- uses: actions/download-artifact@v4
with:
name: lcov.info
path: .
- uses: coverallsapp/[email protected]
with:
tool: cargo-nextest
- run: cargo nextest run
base-path: /
file: lcov.info
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"
Copy link
Member Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.


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