Skip to content

Commit

Permalink
Merge pull request #12 from Cosmian/feature/add_pyo3_for_ffi_calls
Browse files Browse the repository at this point in the history
Feature/add pyo3 for ffi calls
  • Loading branch information
tbrezot authored Jun 16, 2022
2 parents 511779d + 6c6f64b commit 41f236c
Show file tree
Hide file tree
Showing 23 changed files with 903 additions and 300 deletions.
17 changes: 17 additions & 0 deletions .cargo/config
Original file line number Diff line number Diff line change
@@ -1,2 +1,19 @@
[target.wasm32-unknown-unknown]
runner = 'wasm-bindgen-test-runner'

[alias]

# Check for formatting
format = "fmt --all -- --check"

# Build all features, all targets and all binaries
build-all = "build --release --all-targets --all-features --bins"

# Run Clippy on all code paths
clippy-all = "clippy --workspace --all-targets --all-features -- -D warnings"

# Run coverage
coverage = "tarpaulin --release -v -f -t 1800 --out Xml --ignore-tests --exclude-files resources/* apps/*"

# Find unused dependencies
deps = "udeps --workspace --all-targets --all-features --backend depinfo"
124 changes: 124 additions & 0 deletions .gitlab-ci.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,124 @@
image: gitlab.cosmian.com:5000/core/ci-rust:latest

variables:
CARGO_HOME: ${CI_PROJECT_DIR}/.cargo/
SCCACHE_DIR: ${CI_PROJECT_DIR}/.cache/sccache

stages:
- prebuild
- build

rustfmt:
stage: prebuild
cache: {}
script:
- cargo format

doc:
stage: prebuild
cache: {}
script:
- cargo doc --all-features

clippy:
stage: prebuild
cache: {}
script:
- cargo clippy-all

# Security check
cargo_audit:
stage: prebuild
cache: {}
script:
- cargo audit
allow_failure: true
only:
refs:
- tags
- main
- develop

#
# Build base
#
.base_compile: &base_compile
stage: build
cache:
key: "${CI_COMMIT_REF_SLUG}"
policy: pull
paths:
- $CARGO_HOME
- $SCCACHE_DIR
before_script:
- sccache -s

build_x86_64:
<<: *base_compile
script:
- cargo build --verbose --release --features ffi --target x86_64-unknown-linux-gnu
- cargo test --verbose --release --features ffi --target x86_64-unknown-linux-gnu
artifacts:
paths:
- target/x86_64-unknown-linux-gnu/release/*.so
expire_in: 3 mos

build_centos7:
<<: *base_compile
image: gitlab.cosmian.com:5000/core/ci-rust-glibc-2.17:latest
script:
- cargo build --verbose --release --features ffi --target x86_64-unknown-linux-gnu
- cargo test --verbose --release --features ffi --target x86_64-unknown-linux-gnu
- cbindgen . -c cbindgen.toml | grep -v \#include | uniq >target/${CI_PROJECT_NAME}.h
artifacts:
paths:
- target/x86_64-unknown-linux-gnu/release/*.so
- target/*.h
expire_in: 3 mos

build_wasm32:
<<: *base_compile
stage: build
script:
- wasm-pack build --release --features wasm_bindgen
artifacts:
paths:
- pkg
expire_in: 3 mos

build_python_whl:
<<: *base_compile
stage: build
script:
- maturin build --cargo-extra-args="--release --features python"
- bash src/interfaces/pyo3/tests/test.sh
artifacts:
paths:
- target/wheels/*.whl
expire_in: 3 mos

build_windows:
<<: *base_compile
stage: build
script:
- cargo build --verbose --release --features ffi --target x86_64-pc-windows-gnu
- cbindgen . -c cbindgen.toml | grep -v \#include | uniq >target/${CI_PROJECT_NAME}.h
artifacts:
paths:
- target/x86_64-pc-windows-gnu/release/*.dll
- target/*.h
expire_in: 3 mos

build_osx:
<<: *base_compile
stage: build
image: gitlab.cosmian.com:5000/core/ci-rust-osx:latest
script:
- cargo build --verbose --release --features ffi
- cbindgen . -c cbindgen.toml | grep -v \#include | uniq >target/${CI_PROJECT_NAME}.h
artifacts:
paths:
- target/release/*.a
- target/release/*.so
- target/*.h
expire_in: 3 mos
11 changes: 11 additions & 0 deletions CHANGELOG.md
100644 → 100755
Original file line number Diff line number Diff line change
Expand Up @@ -2,10 +2,21 @@

All notable changes to this project will be documented in this file.

---
## [3.0.0] - 2022-06-14
### Added
- Add Gitlab CI .gitlab-ci.yml
- [pyo3] Add Rust bindings for Python thanks to Pyo3
### Changed
- API changed: `to_bytes` become `try_to_bytes` for `PrivateKey` and `PublicKey`
### Fixed
### Removed

---
## [2.0.1] - 2022-06-07
### Added
- [JS/bindgen + FFI] Add ABE keys generation
- [pyo3] Add ABE keys generation
### Changed
### Fixed
### Removed
Expand Down
Loading

0 comments on commit 41f236c

Please sign in to comment.