Merge pull request #5 from Magnus167/docs_and_tests

Adding workflow for docs & testcov
This commit is contained in:
Palash Tyagi 2025-04-20 01:25:07 +01:00 committed by GitHub
commit 2649d50986
No known key found for this signature in database
GPG Key ID: B5690EEEBB952194
5 changed files with 84 additions and 3 deletions

68
.github/workflows/docs-and-testcov.yml vendored Normal file
View File

@ -0,0 +1,68 @@
name: docs-and-testcov
on:
push:
branches: [main]
# pull_request:
# branches: [main]
workflow_dispatch:
permissions:
contents: read
id-token: write
pages: write
jobs:
docs-and-testcov:
runs-on: ubuntu-latest
steps:
- uses: actions/checkout@v4
- name: Set up Rust
uses: actions-rs/toolchain@v1
with:
toolchain: stable
override: true
- name: Build documentation
run: cargo doc --no-deps
- name: Prepare documentation for Pages
run: |
- name: Install Cargo binstall
uses: cargo-bins/cargo-binstall@main
- name: Install cargo-tarpaulin via binstall
run: cargo binstall cargo-tarpaulin --no-confirm --locked
- name: Generate coverage report
run: |
mkdir -p testcov
cargo tarpaulin --out Html
- name: Check for tarpaulin-report.html
run: |
if [ ! -f tarpaulin-report.html ]; then
echo "tarpaulin-report.html not found!"
exit 1
fi
- name: Copy files to output directory
run: |
mkdir output
cp tarpaulin-report.html target/doc/rustframe/
echo "<meta http-equiv=\"refresh\" content=\"0; url=rustframe\">" > target/doc/index.html
- name: Upload Pages artifact
if: github.event_name == 'push'
uses: actions/upload-pages-artifact@v3
with:
path: target/doc/
- name: Deploy to GitHub Pages
if: github.event_name == 'push'
uses: actions/deploy-pages@v4

View File

@ -20,6 +20,8 @@ jobs:
uses: taiki-e/install-action@cargo-llvm-cov
- name: Generate code coverage
run: cargo llvm-cov --all-features --workspace --lcov --output-path lcov.info
- name: Test docs generation
run: cargo doc --no-deps
- name: Upload coverage to Codecov
uses: codecov/codecov-action@v3
with:

4
.gitignore vendored
View File

@ -6,4 +6,6 @@ data/
*.pkl
.env
.venv/
.venv/
tarpaulin-report.html

View File

@ -1,3 +1,11 @@
# rustframe
A simple dataframe library.
[![codecov](https://codecov.io/gh/Magnus167/rustframe/graph/badge.svg?token=J7ULJEFTVI)](https://codecov.io/gh/Magnus167/rustframe)
A simple dataframe library.
---
`tarpaulin` coverage report: [tarpaulin-report](tarpaulin-report.html).
---

View File

@ -1,6 +1,7 @@
#![doc = include_str!("../README.md")]
pub mod matrix;
pub mod frame;
pub mod utils;
pub mod utils;