Skip to content

Commit

Permalink
Add initial implementation
Browse files Browse the repository at this point in the history
  • Loading branch information
OTheDev committed Nov 30, 2024
1 parent ac334c0 commit 30a30b1
Show file tree
Hide file tree
Showing 44 changed files with 9,766 additions and 7 deletions.
44 changes: 44 additions & 0 deletions .github/workflows/static.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,44 @@
name: Static Analysis

on:
push:
branches: [ main ]
paths:
- 'arbi/**'
- 'examples/**'

pull_request:
branches: [ main ]
paths:
- 'arbi/**'
- 'examples/**'

workflow_dispatch:

jobs:
lint-and-audit:
runs-on: ubuntu-latest

steps:
- uses: actions/checkout@v4

- name: Setup Rust Environment
run: |
# Install rustup
curl --proto '=https' --tlsv1.2 -sSf https://sh.rustup.rs | sh -s -- -y
. "$HOME/.cargo/env"
# Install clippy and rustfmt
rustup component add clippy rustfmt
# Install cargo-audit
cargo install cargo-audit
- name: clippy
run: cargo clippy -- -D warnings

- name: rustfmt
run: cargo fmt -- --check

- name: cargo-audit
run: cargo audit
43 changes: 43 additions & 0 deletions .github/workflows/test.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,43 @@
name: Test

on:
push:
branches: [ main ]
paths:
- 'arbi/**'
- 'examples/**'

pull_request:
branches: [ main ]
paths:
- 'arbi/**'
- 'examples/**'

workflow_dispatch:

jobs:
build-and-test:
runs-on: ${{ matrix.os }}
strategy:
matrix:
os: [ubuntu-latest, windows-latest, macos-latest]

steps:
- uses: actions/checkout@v4

- name: Install Rust
run: |
curl --proto '=https' --tlsv1.2 -sSf https://sh.rustup.rs | sh -s -- -y
shell: bash

- name: Run tests
run: |
cargo test --release
# # Run examples
# for example in examples/*; do
# if [ -f "$example/Cargo.toml" ]; then
# cargo run --release --manifest-path "$example/Cargo.toml"
# fi
# done
shell: bash
2 changes: 2 additions & 0 deletions arbi/.cargo/config.toml
Original file line number Diff line number Diff line change
@@ -0,0 +1,2 @@
[build]
rustdocflags = [ "--html-in-header", "./arbi/doc/header.html" ]
9 changes: 8 additions & 1 deletion arbi/Cargo.toml
Original file line number Diff line number Diff line change
Expand Up @@ -4,6 +4,7 @@ categories = [
"algorithms",
"data-structures",
"mathematics",
"no-std",
]
description = "Arbitrary precision integer."
edition = "2021"
Expand All @@ -17,6 +18,12 @@ license = "Apache-2.0 OR MIT"
name = "arbi"
readme = "README.md"
repository = "https://github.com/OTheDev/arbi"
version = "0.1.0"
version = "0.1.1"

[dependencies]

[dev-dependencies]
rand = { version = "0.8.5", features = ["std_rng"] }

[package.metadata.docs.rs]
rustdoc-args = ["--html-in-header", "./doc/header.html"]
Loading

0 comments on commit 30a30b1

Please sign in to comment.