1
0
Fork 0
mirror of synced 2025-09-23 12:18:44 +00:00
ZoKrates/.circleci/config.yml
2020-12-10 19:46:10 +01:00

145 lines
4 KiB
YAML

version: 2
jobs:
build:
docker:
- image: zokrates/env:latest
steps:
- checkout
- run:
name: Version information
command: rustc --version; cargo --version; rustup --version
# - run:
# name: Calculate dependencies
# command: cargo generate-lockfile
- restore_cache:
keys:
- v4-cargo-cache-{{ arch }}-{{ checksum "Cargo.lock" }}
- run:
name: Build
command: WITH_LIBSNARK=1 RUSTFLAGS="-D warnings" ./build.sh
- save_cache:
paths:
- /usr/local/cargo/registry
- target/debug/.fingerprint
- target/debug/build
- target/debug/deps
key: v4-cargo-cache-{{ arch }}-{{ checksum "Cargo.lock" }}
test:
docker:
- image: zokrates/env:latest
steps:
- checkout
- run:
name: Version information
command: rustc --version; cargo --version; rustup --version
# - run:
# name: Calculate dependencies
# command: cargo generate-lockfile
- restore_cache:
keys:
- v4-cargo-cache-{{ arch }}-{{ checksum "Cargo.lock" }}
- run:
name: Check format
command: cargo fmt --all -- --check
- run:
name: Build
command: WITH_LIBSNARK=1 RUSTFLAGS="-D warnings" ./build.sh
- run:
name: Run tests
command: WITH_LIBSNARK=1 RUSTFLAGS="-D warnings" ./test.sh
# - run:
# name: Generate code coverage report
# command: ./scripts/cov.sh
cpp_format:
docker:
- image: zokrates/env:latest
steps:
- checkout
- run:
name: Check cpp format (clang-format)
command: run-clang-format.py -r $(pwd)/zokrates_core/lib
wasm_test:
docker:
- image: zokrates/env:latest
steps:
- checkout
- run:
name: Version information
command: rustc --version; cargo --version; rustup --version
# - run:
# name: Calculate dependencies
# command: cargo generate-lockfile
- restore_cache:
keys:
- v4-cargo-cache-{{ arch }}-{{ checksum "Cargo.lock" }}
- run:
name: Test on firefox
command: cd zokrates_core && wasm-pack test --firefox --headless -- --no-default-features --features "wasm bellman"
integration_test:
docker:
- image: zokrates/env:latest
- image: trufflesuite/ganache-cli:next
steps:
- checkout
- run:
name: Version information
command: rustc --version; cargo --version; rustup --version
# - run:
# name: Calculate dependencies
# command: cargo generate-lockfile
- restore_cache:
keys:
- v4-cargo-cache-{{ arch }}-{{ checksum "Cargo.lock" }}
- run:
name: Run integration tests
command: WITH_LIBSNARK=1 RUSTFLAGS="-D warnings" ./full_test.sh
deploy:
docker:
- image: circleci/python:latest-node
steps:
- checkout
- setup_remote_docker:
docker_layer_caching: true
- run:
name: Release
command: ./scripts/release.sh
zokrates_js_build:
docker:
- image: zokrates/env:latest
steps:
- checkout
- run:
name: Build
command: cd zokrates_js && npm run build:dev
zokrates_js_test:
docker:
- image: zokrates/env:latest
steps:
- checkout
- run:
command: cd zokrates_js && npm run test
workflows:
version: 2
build-test-and-deploy:
jobs:
- build
- test
- cpp_format
- wasm_test
- integration_test
- zokrates_js_build
- zokrates_js_test
- deploy:
filters:
branches:
only:
- master
requires:
- build
- test
- cpp_format
- wasm_test
- integration_test
- zokrates_js_build
- zokrates_js_test