1
0
Fork 0
mirror of synced 2025-09-23 20:28:36 +00:00

update ci images

This commit is contained in:
dark64 2020-08-05 15:33:47 +02:00
parent 079b5cfa95
commit 010998d791
3 changed files with 64 additions and 22 deletions

View file

@ -3,7 +3,7 @@ version: 2
jobs:
build:
docker:
- image: rustlang/rust:nightly-slim
- image: dark64/zokrates-env:latest
steps:
- checkout
- run:
@ -15,9 +15,6 @@ jobs:
- restore_cache:
keys:
- v4-cargo-cache-{{ arch }}-{{ checksum "Cargo.lock" }}
- run:
name: Install libsnark prerequisites
command: ./scripts/install_libsnark_prerequisites.sh
- run:
name: Build
command: ZOKRATES_HOME=$(pwd)/zokrates_stdlib/stdlib/ WITH_LIBSNARK=1 RUSTFLAGS="-D warnings" ./build.sh
@ -30,7 +27,7 @@ jobs:
key: v4-cargo-cache-{{ arch }}-{{ checksum "Cargo.lock" }}
test:
docker:
- image: rustlang/rust:nightly-slim
- image: dark64/zokrates-env:latest
steps:
- checkout
- run:
@ -45,9 +42,6 @@ jobs:
- run:
name: Check format if rustfmt is available
command: "! rustup component add rustfmt || cargo fmt --all -- --check"
- run:
name: Install libsnark prerequisites
command: ./scripts/install_libsnark_prerequisites.sh
- run:
name: Build
command: ZOKRATES_HOME=$(pwd)/zokrates_stdlib/stdlib/ WITH_LIBSNARK=1 RUSTFLAGS="-D warnings" ./build.sh
@ -59,7 +53,7 @@ jobs:
# command: ./scripts/cov.sh
cpp_format:
docker:
- image: dark64/clang-format-checker:env
- image: dark64/zokrates-env:latest
steps:
- checkout
- run:
@ -67,7 +61,7 @@ jobs:
command: run-clang-format.py -r $(pwd)/zokrates_core/lib
wasm_test:
docker:
- image: rustlang/rust:nightly-slim
- image: dark64/zokrates-env:latest
steps:
- checkout
- run:
@ -79,15 +73,12 @@ jobs:
- restore_cache:
keys:
- v4-cargo-cache-{{ arch }}-{{ checksum "Cargo.lock" }}
- run:
name: Install wasm testing env
command: ./scripts/install_wasm_testing.sh
- run:
name: Test on firefox
command: ZOKRATES_HOME=$(pwd)/zokrates_stdlib/stdlib/ cd zokrates_core && wasm-pack test --firefox --headless -- --features wasm
integration_test:
docker:
- image: rustlang/rust:nightly-slim
- image: dark64/zokrates-env:latest
- image: trufflesuite/ganache-cli:next
port: 8545:8545
steps:
@ -101,12 +92,6 @@ jobs:
- restore_cache:
keys:
- v4-cargo-cache-{{ arch }}-{{ checksum "Cargo.lock" }}
- run:
name: Install libsnark prerequisites
command: ./scripts/install_libsnark_prerequisites.sh
- run:
name: Install solcjs
command: ./scripts/install_solcjs_deb.sh
- run:
name: Run integration tests
command: ZOKRATES_HOME=$(pwd)/zokrates_stdlib/stdlib/ WITH_LIBSNARK=1 RUSTFLAGS="-D warnings" ./full_test.sh
@ -122,7 +107,7 @@ jobs:
command: ./scripts/release.sh
zokrates_js_build:
docker:
- image: dark64/rust-wasm-env:latest
- image: dark64/zokrates-env:latest
steps:
- checkout
- run:
@ -130,7 +115,7 @@ jobs:
command: cd zokrates_js && npm run build
zokrates_js_test:
docker:
- image: dark64/rust-wasm-env:latest
- image: dark64/zokrates-env:latest
steps:
- checkout
- run:

11
.clang-format Normal file
View file

@ -0,0 +1,11 @@
Language: Cpp
BasedOnStyle: WebKit
AllowShortCaseLabelsOnASingleLine: true
AllowShortFunctionsOnASingleLine: true
AlwaysBreakTemplateDeclarations: true
BinPackArguments: false
BinPackParameters: false
# make adding new members at the end less noisy in diffs
BreakConstructorInitializersBeforeComma: true
ConstructorInitializerAllOnOneLineOrOnePerLine: true

46
Dockerfile.env Normal file
View file

@ -0,0 +1,46 @@
FROM ubuntu:18.04
SHELL ["/bin/bash", "-c"]
ARG RUST_TOOLCHAIN=nightly-2020-08-05
ENV RUSTUP_HOME=/usr/local/rustup \
CARGO_HOME=/usr/local/cargo \
PATH=/usr/local/cargo/bin:$PATH
# Install prerequisites
RUN apt-get update && apt-get install -y --no-install-recommends \
ca-certificates \
curl \
build-essential \
software-properties-common \
cmake \
gnupg \
libboost-dev \
libboost-program-options-dev \
libgmp3-dev \
libprocps-dev \
libssl-dev \
pkg-config \
clang-format \
python3 \
python-markdown \
&& rm -rf /var/lib/apt/lists/*
RUN add-apt-repository ppa:jonathonf/firefox-esr; \
apt-get update; \
apt-get install -y firefox-esr
RUN curl -sL https://raw.githubusercontent.com/Sarcasm/run-clang-format/master/run-clang-format.py > /opt/run-clang-format.py \
&& ln -s /opt/run-clang-format.py /usr/bin
RUN curl --proto '=https' --tlsv1.2 -sSf https://sh.rustup.rs | sh -s -- --default-toolchain $RUST_TOOLCHAIN -y; \
rustup --version; \
cargo --version; \
rustc --version;
RUN cargo install --git https://github.com/rustwasm/wasm-pack; \
wasm-pack --version;
RUN curl -sL https://deb.nodesource.com/setup_lts.x | bash -; \
apt-get install -y nodejs; echo nodejs $(node -v); \
npm i -g solc;