Skip to content

Commit 1342d71

Browse files
committed
add code coverage and initial test infrastructure
1 parent 7a130a8 commit 1342d71

6 files changed

Lines changed: 873 additions & 144 deletions

File tree

.github/workflows/ci.yml

Lines changed: 39 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,39 @@
1+
name: CI
2+
3+
on:
4+
push:
5+
branches: [main]
6+
pull_request:
7+
branches: [main]
8+
9+
jobs:
10+
test:
11+
runs-on: ubuntu-latest
12+
steps:
13+
- uses: actions/checkout@v4
14+
15+
- name: Install Rust
16+
uses: dtolnay/rust-toolchain@stable
17+
18+
- name: Cache cargo
19+
uses: actions/cache@v4
20+
with:
21+
path: |
22+
~/.cargo/registry
23+
~/.cargo/git
24+
target
25+
key: ${{ runner.os }}-cargo-${{ hashFiles('**/Cargo.lock') }}
26+
27+
- name: Install cargo-llvm-cov
28+
uses: taiki-e/install-action@cargo-llvm-cov
29+
30+
- name: Run tests with coverage
31+
run: cargo llvm-cov --lcov --output-path lcov.info
32+
33+
- name: Upload coverage to Codecov
34+
uses: codecov/codecov-action@v4
35+
with:
36+
files: lcov.info
37+
fail_ci_if_error: false
38+
env:
39+
CODECOV_TOKEN: ${{ secrets.CODECOV_TOKEN }}

Cargo.lock

Lines changed: 144 additions & 5 deletions
Some generated files are not rendered by default. Learn more about customizing how changed files appear on GitHub.

Cargo.toml

Lines changed: 5 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -36,11 +36,16 @@ tar = "0.4"
3636
semver = "1"
3737
sqlformat = "0.5.0"
3838

39+
[dev-dependencies]
40+
mockito = "1"
41+
tempfile = "3"
42+
3943
[package.metadata.release]
4044
pre-release-hook = ["git", "cliff", "-o", "CHANGELOG.md", "--tag", "{{version}}" ]
4145
publish = false
4246
pre-release-replacements = [
4347
{ file = "skills/hotdata-cli/SKILL.md", search = "^version: .+", replace = "version: {{version}}", exactly = 1 },
48+
{ file = "README.md", search = "version-[0-9.]+-blue", replace = "version-{{version}}-blue", exactly = 1 },
4449
]
4550

4651
# The profile that 'dist' will build with

README.md

Lines changed: 6 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,11 @@
11
# hotdata-cli
22

3+
<p align="center">
4+
<img src="https://img.shields.io/badge/version-0.1.8-blue" alt="version">
5+
<a href="https://github.com/hotdata-dev/hotdata-cli/actions/workflows/ci.yml"><img src="https://github.com/hotdata-dev/hotdata-cli/actions/workflows/ci.yml/badge.svg" alt="build"></a>
6+
<a href="https://codecov.io/gh/hotdata-dev/hotdata-cli"><img src="https://codecov.io/gh/hotdata-dev/hotdata-cli/branch/main/graph/badge.svg" alt="coverage"></a>
7+
</p>
8+
39
Command line interface for [Hotdata](https://www.hotdata.dev).
410

511
## Install

0 commit comments

Comments
 (0)