From 2f7eb48516c402160e17b182abe2497666fa96da Mon Sep 17 00:00:00 2001 From: Lars-Magnus Skog Date: Wed, 1 May 2019 17:10:11 +0200 Subject: [PATCH] ci: add basic setup for circleci --- .circleci/config.yml | 67 ++++++++++++++++++++++++++++++++++++++++++++ README.md | 6 +++- 2 files changed, 72 insertions(+), 1 deletion(-) create mode 100644 .circleci/config.yml diff --git a/.circleci/config.yml b/.circleci/config.yml new file mode 100644 index 000000000..2d6d2ac53 --- /dev/null +++ b/.circleci/config.yml @@ -0,0 +1,67 @@ +# copied from http://koushiro.me/2019/04/30/Building-and-Testing-Rust-projects-on-CircleCI/ +# TODO remove things that aren't needed for apt +# TODO might want to create our own docker image for this and get rid of apt stuff + +version: 2.1 +jobs: + build: + docker: + - image: ubuntu:18.04 + + working_directory: ~/deltachat-core-rust + + steps: + - checkout + + - run: + name: Setup build environment (TODO move this to custom docker container) + command: | + apt update + apt install -y sudo curl build-essential git pkg-config zlib1g-dev python libssl-dev autoconf libtool + # this will pick default toolchain from `rust-toolchain` file + curl --proto '=https' --tlsv1.2 -sSf https://sh.rustup.rs | sh -s -- --no-modify-path --default-toolchain none -y; + source $HOME/.cargo/env + no_output_timeout: 1800s + + - run: + name: build etpan (TODO move this to custom docker container) + command: | + curl -L -o libetpan-1.9.1.tar.gz https://github.com/dinhviethoa/libetpan/archive/1.9.1.tar.gz + tar xzf libetpan-1.9.1.tar.gz + cd libetpan-1.9.1 + ./autogen.sh + ./configure --disable-silent-rules --enable-ipv6 --enable-iconv --disable-db --with-openssl --with-sasl --with-zlib --without-curl --without-expat + make -j $(nproc) + sudo make install + sudo ldconfig -v + + - run: + name: build sasl2 (TODO move this to custom docker container) + command: | + curl -O https://www.cyrusimap.org/releases/cyrus-sasl-2.1.27.tar.gz + tar zxf cyrus-sasl-2.1.27.tar.gz + cd cyrus-sasl-2.1.27 + ./configure --enable-shared --disable-cmulocal --disable-sample --disable-obsolete_cram_attr --disable-obsolete_digest_attr --disable-alwaystrue --enable-checkapop --enable-cram --enable-digest --enable-scram --enable-plain --enable-anon --enable-login + make -j $(nproc) + sudo make install + sudo ldconfig -v + + - run: + name: Format + command: | + export PATH=~/.cargo/bin:$PATH + rustup component add rustfmt + cargo fmt -- --check + + - run: + name: Test + command: | + export PATH=~/.cargo/bin:$PATH + export RUST_BACKTRACE=1 + cargo test + +workflows: + version: 2.1 + build: + jobs: + - build diff --git a/README.md b/README.md index 1f8c809a4..a19b11cd7 100644 --- a/README.md +++ b/README.md @@ -1,6 +1,10 @@ # Delta Chat Rust -Current commit on deltachat/deltachate-core: `12ef73c8e76185f9b78e844ea673025f56a959ab`. +> Project porting deltachat-core to rust + +[![CircleCI](https://circleci.com/gh/deltachat/deltachat-core-rust.svg?style=svg)](https://circleci.com/gh/deltachat/deltachat-core-rust) + +Current commit on deltachat/deltachat-core: `12ef73c8e76185f9b78e844ea673025f56a959ab`. ## Development