Skip to content

Commit

Permalink
Merge pull request #32 from Cosmian/feature/enable_tests_on_external_…
Browse files Browse the repository at this point in the history
…libs

Enable tests on external librairies (java and js)
  • Loading branch information
Manuthor authored Sep 5, 2022
2 parents b5c75ef + a4e3b18 commit bb59911
Show file tree
Hide file tree
Showing 10 changed files with 217 additions and 246 deletions.
93 changes: 55 additions & 38 deletions .gitlab-ci.yml
Original file line number Diff line number Diff line change
Expand Up @@ -3,16 +3,22 @@ image: gitlab.cosmian.com:5000/core/ci-rust:latest
variables:
CARGO_HOME: ${CI_PROJECT_DIR}/.cargo/
SCCACHE_DIR: ${CI_PROJECT_DIR}/.cache/sccache
COSMIAN_SERVER_URL: http://localhost:9998
KMS_PUBLIC_PATH: /tmp
KMS_PRIVATE_PATH: /tmp
KMS_SHARED_PATH: /tmp

stages:
- prebuild
- build
- test
- publish

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

doc:
stage: prebuild
Expand All @@ -24,23 +30,18 @@ clippy:
stage: prebuild
cache: {}
script:
# no feature activated
- cargo clippy --all-targets -- -D warnings
# all features activated
- cargo clippy --all-targets -- -D warnings
# no feature activated
- cargo clippy-all

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

#
# Build base
Expand All @@ -56,19 +57,14 @@ cargo_audit:
before_script:
- sccache -s

build_x86_64:
benchmarks:
<<: *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
- cargo bench --all-features
when: manual

build_centos7:
build_x86_64:
<<: *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
Expand All @@ -79,31 +75,20 @@ build_centos7:
- target/*.h
expire_in: 3 mos

build_wasm32:
build_wasm:
<<: *base_compile
image: gitlab.cosmian.com:5000/core/ci-npm:latest
stage: build
script:
- wasm-pack build --release --features wasm_bindgen
- wasm-pack test --node --features wasm_bindgen --lib
- wasm-pack build --target nodejs --release --features wasm_bindgen
artifacts:
paths:
- pkg
expire_in: 3 mos

build_python_whl:
<<: *base_compile
stage: build
script:
- maturin build --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
Expand All @@ -115,7 +100,6 @@ build_windows:

build_osx:
<<: *base_compile
stage: build
image: gitlab.cosmian.com:5000/core/ci-rust-osx:latest
script:
- cargo build --verbose --release --features ffi
Expand All @@ -129,13 +113,46 @@ build_osx:

build_android:
<<: *base_compile
stage: build
image: gitlab.cosmian.com:5000/core/ci-rust-android:latest
before_script:
- rustup target add i686-linux-android x86_64-linux-android armv7-linux-androideabi aarch64-linux-android
script:
- cargo ndk -t x86 -t x86_64 -t armeabi-v7a -t arm64-v8a -o jniLibs build --release --features ffi --lib
artifacts:
paths:
- jniLibs
expire_in: 3 mos

test_cosmian_java_lib:
image: gitlab.cosmian.com:5000/core/ci-java-8:latest
stage: test
services:
- name: gitlab.cosmian.com:5000/core/kms:2.1.0_ci
alias: kms_ci
script:
- bash ci/cosmian_java_lib.sh

test_python:
stage: test
script:
- maturin build --release --features python
- bash src/interfaces/pyo3/tests/test.sh
artifacts:
paths:
- target/wheels/*.whl
expire_in: 3 mos

test_cosmian_js_lib:
image: node:16
stage: test
script:
- bash ci/cosmian_js_lib.sh

publish:
image: gitlab.cosmian.com:5000/core/ci-npm:latest
stage: publish
rules:
- if: '$CI_COMMIT_TAG =~ /^v\d+.\d+.\d+$/'
script:
- echo "//registry.npmjs.org/:_authToken=$NPM_ACCESS_TOKEN" > ~/.npmrc
- wasm-pack build --release --features wasm_bindgen
- wasm-pack pack
- wasm-pack publish
13 changes: 12 additions & 1 deletion CHANGELOG.md
Original file line number Diff line number Diff line change
Expand Up @@ -2,6 +2,17 @@

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

---
## [6.0.1] - 2022-09-05
### Added
- Enable tests on `cosmian_js_lib` and `cosmian_java_lib`
- Auto NPM publish on tags
### Changed
### Fixed
- Fix error message on invalid size errors.
### Removed
---

---
## [6.0.0] - 2022-08-29
### Added
Expand Down Expand Up @@ -32,7 +43,7 @@ All notable changes to this project will be documented in this file.
- Remove `Partition`s from `Encapsulation`s: now CoverCrypt returns a vector of
symmetric keys when `decaps`. These keys should be tried on real symmetric
ciphertexts in order to determine which is the good one. This works because
symmetric ciphertexts are autenticated.
symmetric ciphertexts are authenticated.
### Fixed
- bug in public key rotation
### Removed
Expand Down
Loading

0 comments on commit bb59911

Please sign in to comment.