Skip to content

Commit

Permalink
Release v0.3.1
Browse files Browse the repository at this point in the history
  • Loading branch information
akubera committed May 9, 2023
2 parents 272123e + 94191ee commit 24d9ae0
Show file tree
Hide file tree
Showing 6 changed files with 522 additions and 160 deletions.
15 changes: 15 additions & 0 deletions .editorconfig
Original file line number Diff line number Diff line change
@@ -0,0 +1,15 @@
# https://EditorConfig.org

# top-most EditorConfig file
root = true

[*]
indent_style = space
indent_size = 4
end_of_line = lf
charset = utf-8
trim_trailing_whitespace = true
insert_final_newline = true

[*.yaml]
indent_size = 2
158 changes: 158 additions & 0 deletions .gitlab-ci.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,158 @@

cache:
policy: pull-push
# should we only share cache between jobs on one tag?
# key: ${CI_COMMIT_REF_SLUG}
paths:
- .cargo/bin
- .cargo/registry/index
- .cargo/registry/cache
- target/debug/deps
- target/debug/build

variables:
# store cargo registry in the project directory
CARGO_HOME: ${CI_PROJECT_DIR}/.cargo

# this fixes an error when updating cargo registry
CARGO_NET_GIT_FETCH_WITH_CLI: 'true'


.cargo:build-script: &cargo-build-script
script:
- rustc --version && cargo --version
- cargo build


.cargo-test-script: &cargo-test-script
script:
- rustc --version && cargo --version
- cargo test --verbose


cargo:build-stable:
stage: build
image: "rust:latest"
<<: *cargo-build-script


cargo:test-stable:
stage: test
image: "rust:latest"
needs:
- "cargo:build-stable"
<<: *cargo-build-script


cargo:build-nightly:
stage: build
image: rustlang/rust:nightly
allow_failure: true
<<: *cargo-build-script


cargo:test-nightly:
stage: test
image: rustlang/rust:nightly
needs:
- cargo:build-nightly
allow_failure: true
<<: *cargo-test-script


cargo:build-1.34:
stage: build
image: "akubera/rust-kcov:1.34.2-stretch"
<<: *cargo-build-script

cargo:test-1.34:
stage: test
needs:
- cargo:build-1.34
image: "akubera/rust-kcov:1.34.2-stretch"
allow_failure: true
<<: *cargo-test-script


cargo:build-1.42:
stage: build
image: "akubera/rust-kcov:1.42.0-buster"
<<: *cargo-build-script

cargo:test·1.42:
stage: test
needs:
- "cargo:build-1.42"
image: "akubera/rust-kcov:1.42.0-buster"
<<: *cargo-test-script


cargo:build-1.54:
stage: build
image: "akubera/rust-kcov:1.54.0-bullseye"
<<: *cargo-build-script

cargo:test·1.54:
stage: test
needs:
- "cargo:build-1.54"
image: "akubera/rust-kcov:1.54.0-bullseye"
<<: *cargo-test-script


cargo:build-1.68:
stage: build
image: "akubera/rust-grcov:1.68.2-bullseye"
<<: *cargo-build-script

cargo:test-1.68:
stage: test
needs:
- "cargo:build-1.68"
image: "akubera/rust-grcov:1.68.2-bullseye"
<<: *cargo-test-script


coverage-test:
stage: test
needs:
- "cargo:test-1.68"
image: "akubera/rust-grcov:1.68.2-bullseye"

variables:
CARGO_NET_GIT_FETCH_WITH_CLI: 'true'
LLVM_PROFILE_FILE: "target/coverage/%p-%m.profraw"
RUSTFLAGS: "-Cinstrument-coverage -Ccodegen-units=1 -Copt-level=0 -Clink-dead-code -Coverflow-checks=off "
# RUSTDOCFLAGS: "-Cpanic=abort"
CARGO_INCREMENTAL: "0"

coverage: '/Code Coverage: \d+\.\d+/'
script:
- rustc --version && cargo --version
- cargo test
- ls -l target/coverage
- grcov target/coverage --binary-path target/debug -s . --keep-only 'src/*' -tcobertura -o cobertura.xml
- >
grep -m1 -o 'line-rate="[^"]*' cobertura.xml
| sed 's/[^0-9.]*//'
| awk '{ print "Code Coverage: " $0 * 100 }'
artifacts:
reports:
coverage_report:
coverage_format: cobertura
path: cobertura.xml


cargo-publish:
stage: deploy
image: "rust:latest"
when: manual
only:
- master
allow_failure: true
cache: []
variables:
CARGO_HOME: /usr/local/cargo
script:
- cargo publish
2 changes: 1 addition & 1 deletion Cargo.toml
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
[package]
name = "bigdecimal"
version = "0.3.0"
version = "0.3.1"
authors = ["Andrew Kubera"]
description = "Arbitrary precision decimal numbers"
documentation = "https://docs.rs/bigdecimal"
Expand Down
73 changes: 73 additions & 0 deletions README.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,73 @@
# bigdecimal-rs


[![crate](https://img.shields.io/crates/v/bigdecimal.svg)](https://crates.io/crates/bigdecimal)
[![Documentation](https://docs.rs/bigdecimal/badge.svg)](https://docs.rs/bigdecimal)

[![minimum rustc 1.34](https://img.shields.io/badge/rustc-1.34+-red.svg)](https://rust-lang.github.io/rfcs/2495-min-rust-version.html)

[![coverage](https://gitlab.com/akubera/bigdecimal-rs/badges/master/coverage.svg)](https://gitlab.com/akubera/bigdecimal-rs/-/pipelines)
[![build status - master](https://gitlab.com/akubera/bigdecimal-rs/badges/master/pipeline.svg?ignore_skipped=true)](https://gitlab.com/akubera/bigdecimal-rs/-/pipelines)
[![build status - dev](https://gitlab.com/akubera/bigdecimal-rs/badges/devel/pipeline.svg?ignore_skipped=true)](https://gitlab.com/akubera/bigdecimal-rs/-/pipelines)


Arbitary-precision decimal numbers implemented in pure Rust.

## Usage

Add bigdecimal as a dependency to your `Cargo.toml` file:

```toml
[dependencies]
bigdecimal = "0.3"
```

Import and use the `BigDecimal` struct to solve your problems:

```rust
use bigdecimal::BigDecimal;

fn main() {
let two = BigDecimal::from(2);
println!("sqrt(2) = {}", two.sqrt().unwrap());
}
```

this code will print

```
sqrt(2) = 1.414213562373095048801688724209698078569671875376948073176679737990732478462107038850387534327641573
```


## Improvements

Work is being done on this codebase again and there are many features
and improvements on the way.


## About

This repository contains code originally meant for a bigdecimal module
in the popular [num](https://crates.io/crates/num) crate, but was not
merged due to uncertainty of what the best design for such a crate
should be.


## License

This code is dual-licensed under the permissive
[MIT](https://opensource.org/licenses/MIT) &
[Apache 2.0](https://opensource.org/licenses/Apache-2.0) licenses.

### Contribution

Unless you explicitly state otherwise, any contribution intentionally
submitted for inclusion in the work by you, as defined in the
Apache-2.0 license, shall be dual licensed as above, without any
additional terms or conditions.


## Community

Join the conversation on Zulip: https://bigdecimal-rs.zulipchat.com
53 changes: 0 additions & 53 deletions README.rst

This file was deleted.

0 comments on commit 24d9ae0

Please sign in to comment.