# 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