Skip to content

Commit

Permalink
chore: move from rust-aluvm crate
Browse files Browse the repository at this point in the history
Signed-off-by: Dr Maxim Orlovsky <[email protected]>
  • Loading branch information
dr-orlovsky committed Nov 13, 2024
0 parents commit 40f8b88
Show file tree
Hide file tree
Showing 28 changed files with 2,420 additions and 0 deletions.
3 changes: 3 additions & 0 deletions .github/FUNDING.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,3 @@
# These are supported funding model platforms

github: [ dr-orlovsky, UBIDECO, AluVM, LNP-BP ]
84 changes: 84 additions & 0 deletions .github/workflows/build.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,84 @@
name: Build

on:
push:
branches:
- master
tags:
- 'v[0-9]+.*'
pull_request:
branches:
- master
- develop
- 'v[0-9]+.?*'

env:
CARGO_TERM_COLOR: always

jobs:
default:
runs-on: ubuntu-latest
steps:
- uses: actions/checkout@v4
- uses: dtolnay/rust-toolchain@stable
- run: cargo check --workspace
no-default:
runs-on: ubuntu-latest
steps:
- uses: actions/checkout@v4
- uses: dtolnay/rust-toolchain@stable
- run: cargo check --workspace --no-default-features --features alloc
features:
runs-on: ubuntu-latest
strategy:
fail-fast: false
matrix:
feature:
- log
- armor
- serde
- stl
steps:
- uses: actions/checkout@v4
- uses: dtolnay/rust-toolchain@stable
- name: Feature ${{matrix.feature}}
run: cargo check --workspace --no-default-features --features=std,${{matrix.feature}}
- name: Feature ${{matrix.feature}}
run: cargo check --workspace --features=${{matrix.feature}}
features-nostd:
runs-on: ubuntu-latest
strategy:
fail-fast: false
matrix:
feature:
- secp256k1
- curve25519
steps:
- uses: actions/checkout@v4
- uses: dtolnay/rust-toolchain@stable
- name: Feature ${{matrix.feature}}
run: cargo check --workspace --no-default-features --features=alloc,${{matrix.feature}}
platforms:
runs-on: ${{ matrix.os }}
strategy:
fail-fast: false
matrix:
os: [ ubuntu-22.04, ubuntu-latest, macos-13, macos-latest, windows-2019, windows-latest ]
steps:
- uses: actions/checkout@v4
- uses: dtolnay/rust-toolchain@stable
- name: Platform ${{matrix.os}}
run: cargo check --workspace --all-features # we skip test targets here to be sure that the main library can be built
toolchains:
runs-on: ubuntu-latest
strategy:
fail-fast: false
matrix:
toolchain: [ nightly, beta, stable, 1.77.0 ]
steps:
- uses: actions/checkout@v4
- uses: dtolnay/rust-toolchain@master
with:
toolchain: ${{matrix.toolchain}}
- name: Toolchain ${{matrix.toolchain}}
run: cargo +${{matrix.toolchain}} check --workspace --all-targets --all-features
40 changes: 40 additions & 0 deletions .github/workflows/codecov.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,40 @@
name: Codecov

on:
push:
branches:
- master
tags:
- 'v[0-9]+.*'
pull_request:
branches:
- master
- develop
- 'v[0-9]+.?*'

env:
CARGO_TERM_COLOR: always

jobs:
codecov:
runs-on: ubuntu-latest
steps:
- uses: actions/checkout@v4
- uses: dtolnay/rust-toolchain@nightly
with:
components: llvm-tools-preview
- uses: taiki-e/install-action@cargo-llvm-cov
- uses: taiki-e/install-action@nextest
- name: Collect coverage data (including doctests)
run: |
cargo +nightly llvm-cov --no-report nextest --workspace --all-features
cargo +nightly llvm-cov --no-report --doc --workspace --all-features
cargo +nightly llvm-cov report --doctests --lcov --output-path lcov.info
- name: Upload coverage data to codecov
uses: codecov/codecov-action@v4
with:
flags: rust
files: lcov.info
fail_ci_if_error: true
token: ${{ secrets.CODECOV_TOKEN }}
verbose: true
45 changes: 45 additions & 0 deletions .github/workflows/lint.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,45 @@
name: Lints

on:
pull_request:
branches:
- master
- develop
- 'v[0-9]+.?*'

env:
CARGO_TERM_COLOR: always

jobs:
fmt:
runs-on: ubuntu-latest
steps:
- uses: actions/checkout@v4
- uses: dtolnay/rust-toolchain@nightly
with:
components: rustfmt
- name: Formatting
run: cargo +nightly fmt --all -- --check
clippy:
runs-on: ubuntu-latest
steps:
- uses: actions/checkout@v4
- uses: dtolnay/rust-toolchain@stable
with:
components: clippy
- name: Formatting
run: cargo clippy --workspace --all-features --all-targets -- -D warnings
doc:
runs-on: ubuntu-latest
steps:
- uses: actions/checkout@v4
- uses: dtolnay/rust-toolchain@nightly
with:
components: rust-docs
- name: Formatting
run: cargo +nightly doc --workspace --all-features
typos:
runs-on: ubuntu-latest
steps:
- uses: actions/checkout@v4
- uses: crate-ci/typos@master
39 changes: 39 additions & 0 deletions .github/workflows/test.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,39 @@
name: Tests

on:
push:
branches:
- master
tags:
- 'v[0-9]+.*'
pull_request:
branches:
- master
- develop
- 'v[0-9]+.?*'

env:
CARGO_TERM_COLOR: always

jobs:
testing:
runs-on: ${{ matrix.os }}
strategy:
fail-fast: false
matrix:
os: [ ubuntu-latest, macos-13, macos-latest, windows-latest ]
steps:
- uses: actions/checkout@v4
- uses: dtolnay/rust-toolchain@stable
- name: Test ${{matrix.os}}
run: cargo test --workspace --all-features --no-fail-fast
wasm-testing:
runs-on: ubuntu-latest
steps:
- uses: actions/checkout@v4
- uses: dtolnay/rust-toolchain@nightly
- uses: jetli/[email protected]
- name: Add wasm32 target
run: rustup target add wasm32-unknown-unknown
- name: Test in headless Chrome
run: wasm-pack test --headless --chrome
8 changes: 8 additions & 0 deletions .gitignore
Original file line number Diff line number Diff line change
@@ -0,0 +1,8 @@
# Generated by Cargo
# will have compiled files and executables
/target/

# These are backup files generated by rustfmt
**/*.rs.bk

/.idea
27 changes: 27 additions & 0 deletions .rustfmt.toml
Original file line number Diff line number Diff line change
@@ -0,0 +1,27 @@
edition = "2021"
style_edition = "2021"

max_width = 120
array_width = 120
attr_fn_like_width = 120
comment_width = 100
chain_width = 60
fn_call_width = 120
single_line_if_else_max_width = 120

fn_single_line = true
format_code_in_doc_comments = true
format_macro_matchers = true
format_macro_bodies = true
format_strings = true
merge_derives = false
overflow_delimited_expr = true
reorder_modules = false
use_field_init_shorthand = true
use_try_shorthand = true
wrap_comments = true
where_single_line = true
unstable_features = true

imports_granularity = "Module"
group_imports = "StdExternalCrate"
19 changes: 19 additions & 0 deletions CODE_OF_CONDUCT.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,19 @@
# Code of Conduct

We do not apply any code of conduct expectations for contributors and
maintainers in their live and behaviour outside the scope of this project.
We believe that a restriction is the word of sin: free people write code, take
their decisions and act in a way they will, taking responsibility for the
consequences.

Moreover, we will try to protect the freedom of speech of contributors, and
explicit distance from personal or public life of contributors, as long as
they behave in a civil and productive way when contributing and interacting
within the project, and will go to great lengths to not deny anyone
participation.

Actions within the technical scope of the project (code quality, spamming etc),
as well as interaction with other maintainers and contributors of course is
a factor of the access to the project development and lifecycle. The decision in
these cases will be made by the project maintainers, with the right of veto or
overriding vote reserved for the original project author, Maxim Orlovsky.
Loading

0 comments on commit 40f8b88

Please sign in to comment.