Skip to content

Commit

Permalink
KnotVec, ScalarT, VectorT and grcov (#2)
Browse files Browse the repository at this point in the history
  • Loading branch information
lancelet authored Oct 10, 2020
1 parent d391327 commit 869a9b0
Show file tree
Hide file tree
Showing 12 changed files with 890 additions and 218 deletions.
7 changes: 7 additions & 0 deletions .github/actions-rs/grcov.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,7 @@
# Re-enable branch and excl-br-line when this is released:
# https://github.com/actions-rs/grcov/pull/90

# branch: true
ignore-not-existing: true
output-path: coverage
# excl-br-line: "^\s*((debug_)?assert(_eq|_ne)?!|#\[derive\()"
54 changes: 54 additions & 0 deletions .github/workflows/coverage.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,54 @@
name: Coverage

on:
push:
branches: [ main, devel ]
pull_request:
branches: [ main ]

env:
CARGO_TERM_COLOR: always

jobs:
grcov:
runs-on: ubuntu-latest

steps:

- name: Checkout
uses: actions/checkout@v2

- name: Install Rust nightly
uses: actions-rs/toolchain@v1
with:
profile: minimal
toolchain: nightly
override: true

- name: Clean
uses: actions-rs/cargo@v1
with:
command: clean

- name: Run tests
uses: actions-rs/cargo@v1
with:
command: test
args: --all
env:
CI_GRCOV: '1'
CARGO_INCREMENTAL: 0
RUSTFLAGS: '-Zprofile -Ccodegen-units=1 -Copt-level=0 -Clink-dead-code -Coverflow-checks=off -Zpanic_abort_tests -Cpanic=abort'
RUSTDOCFLAGS: '-Zprofile -Ccodegen-units=1 -Copt-level=0 -Clink-dead-code -Coverflow-checks=off -Zpanic_abort_tests -Cpanic=abort'

- name: Run grcov
id: grcov
uses: actions-rs/[email protected]
with:
config: .github/actions-rs/grcov.yml

- name: Upload code coverage to codecov.io
uses: codecov/[email protected]
with:
file: ${{steps.grcov.outputs.report}}
token: ${{secrets.CODECOV_TOKEN}}
24 changes: 20 additions & 4 deletions .github/workflows/rust.yml
Original file line number Diff line number Diff line change
@@ -1,8 +1,8 @@
name: Rust
name: Rust Build

on:
push:
branches: [ main ]
branches: [ main, devel ]
pull_request:
branches: [ main ]

Expand All @@ -15,8 +15,24 @@ jobs:
runs-on: ubuntu-latest

steps:

- uses: actions/checkout@v2
- name: Build

- name: Install latest Rust nightly
uses: actions-rs/toolchain@v1
with:
toolchain: nightly
override: true
components: rustfmt, clippy

- name: Compile
run: cargo build --verbose
- name: Run tests

- name: Test
run: cargo test --verbose

- name: Rustfmt check
run: cargo fmt -- --check

- name: Clippy check
run: cargo clippy
19 changes: 18 additions & 1 deletion CHANGELOG.md
Original file line number Diff line number Diff line change
Expand Up @@ -5,6 +5,22 @@ Please track all notable changes in this file. This format is based on

## [Unreleased]

## [0.0.2]

### Added

- `ScalarT` and `VectorT` traits to represent the operations required of
scalars and vectors used by NURBS curves and surfaces.
- `KnotVec` type to represent knot vectors in NURBS curves. This will later be
shared with NURBS surfaces.
- `codecov.io` test coverage using `grcov`.
- README badges for `codecov.io`, `crates.io`, `docs.rs` and the LICENSE.

### Changed

- `Curve` type is now parameterised by scalar and vector types.
- Examples in `main` use `nalgebra::Vector2` instead of 3D points.

## [0.0.1]

### Added
Expand All @@ -13,5 +29,6 @@ Please track all notable changes in this file. This format is based on
- NURBS Curve representation and evaluation using the de Boors algorithm.
- Plot some examples for the README.

[unreleased]: https://github.com/lancelet/capstan/compare/v0.0.1...HEAD
[unreleased]: https://github.com/lancelet/capstan/compare/v0.0.2...HEAD
[0.0.2]: https://github.com/lancelet/capstan/releases/tag/v0.0.2
[0.0.1]: https://github.com/lancelet/capstan/releases/tag/v0.0.1
158 changes: 156 additions & 2 deletions Cargo.lock

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

6 changes: 5 additions & 1 deletion Cargo.toml
Original file line number Diff line number Diff line change
Expand Up @@ -16,5 +16,9 @@ readme = "README.md"
alga = "0.9"
approx = "0.3"
nalgebra = "0.22"
num-traits = "0.2"
svg = "0.8"
thiserror = "1.0"
thiserror = "1.0"

[dev-dependencies]
proptest = "0.10"
4 changes: 4 additions & 0 deletions README.md
Original file line number Diff line number Diff line change
@@ -1,6 +1,10 @@
# Capstan

![GitHub Rust CI](https://github.com/lancelet/capstan/workflows/Rust/badge.svg)
[![Codecov.io](https://codecov.io/gh/lancelet/capstan/branch/main/graph/badge.svg)](https://codecov.io/gh/lancelet/capstan)
[![Crates.io](https://img.shields.io/crates/v/capstan.svg)](https://crates.io/crates/capstan)
[![Docs.rs](https://docs.rs/capstan/badge.svg)](https://docs.rs/capstan)
[![License: MIT](https://img.shields.io/badge/License-MIT-yellow.svg)](https://opensource.org/licenses/MIT)

NURBS utilities in Rust.

Expand Down
Loading

0 comments on commit 869a9b0

Please sign in to comment.