version: 2.1 executors: default: docker: - image: filecoin/rust:latest working_directory: /mnt/crate restore-workspace: &restore-workspace attach_workspace: at: /mnt restore-cache: &restore-cache restore_cache: keys: - cargo-v0-{{ checksum "rust-toolchain" }}-{{ checksum "Cargo.toml" }}-{{ checksum "Cargo.lock" }}-{{ arch }} - repo-source-{{ .Branch }}-{{ .Revision }} commands: test_target: parameters: target: type: string steps: - *restore-workspace - *restore-cache - setup_remote_docker: docker_layer_caching: true # TODO: move into image - run: name: Install Docker client command: | set -x VER="18.09.2" curl -L -o /tmp/docker-$VER.tgz https://download.docker.com/linux/static/stable/x86_64/docker-$VER.tgz tar -xz -C /tmp -f /tmp/docker-$VER.tgz mv /tmp/docker/* /usr/bin - run: name: Test (<< parameters.target >>) command: TARGET=<< parameters.target >> ci/run.sh no_output_timeout: 15m jobs: cargo_fetch: executor: default steps: - checkout - run: name: Update submodules command: git submodule update --init --recursive - run: name: Calculate dependencies command: cargo generate-lockfile - restore_cache: keys: - cargo-v0-{{ checksum "rust-toolchain" }}-{{ checksum "Cargo.toml" }}-{{ checksum "Cargo.lock" }}-{{ arch }} - run: rustup install $(cat rust-toolchain) - run: rustup default $(cat rust-toolchain) - run: rustup component add --toolchain $(cat rust-toolchain) rustfmt - run: cargo update - run: cargo fetch - run: rustc +stable --version - run: rustc +$(cat rust-toolchain) --version - run: rm -rf .git - persist_to_workspace: root: /mnt paths: - crate - save_cache: key: cargo-v0-{{ checksum "rust-toolchain" }}-{{ checksum "Cargo.toml" }}-{{ checksum "Cargo.lock" }}-{{ arch }} paths: - "~/.cargo" - "~/.rustup" rustfmt: executor: default steps: - *restore-workspace - *restore-cache - run: name: Run cargo fmt command: cargo fmt --all -- --check test_macos: macos: xcode: "10.0.0" working_directory: ~/crate steps: - run: name: Configure environment variables command: | echo 'export PATH="${HOME}/.cargo/bin:${HOME}/.bin:${PATH}"' >> $BASH_ENV echo 'export CIRCLE_ARTIFACTS="/tmp"' >> $BASH_ENV - checkout - run: name: Install Rust command: | curl https://sh.rustup.rs -sSf | sh -s -- -y - run: rustup install $(cat rust-toolchain) - run: rustup default $(cat rust-toolchain) - run: cargo update - run: cargo fetch - run: name: Test command: TARGET=x86_64-apple-darwin ci/run.sh test_x86_64-unknown-linux-gnu: executor: default steps: - test_target: target: "x86_64-unknown-linux-gnu" test_i686-unknown-linux-gnu: executor: default steps: - test_target: target: "i686-unknown-linux-gnu" test_aarch64-linux-android: executor: default steps: - test_target: target: "aarch64-linux-android" build_test_docs_wheel: machine: True steps: - checkout # - run: docker pull deltachat/doxygen - run: docker pull deltachat/coredeps - run: name: build docs, run tests and build wheels command: ci_scripts/ci_run.sh environment: TESTS: 1 DOCS: 1 - run: name: copying docs and wheels to workspace command: | mkdir -p workspace/python # cp -av docs workspace/c-docs cp -av python/.docker-tox/wheelhouse workspace/ cp -av python/doc/_build/ workspace/py-docs - persist_to_workspace: root: workspace paths: # - c-docs - py-docs - wheelhouse upload_docs_wheels: machine: True steps: - checkout - attach_workspace: at: workspace - run: ls -laR workspace - run: ci_scripts/ci_upload.sh workspace/py-docs workspace/wheelhouse workflows: version: 2.1 test: jobs: - build_test_docs_wheel - upload_docs_wheels: requires: - build_test_docs_wheel - cargo_fetch - rustfmt: requires: - cargo_fetch # Linux Desktop - test_x86_64-unknown-linux-gnu: requires: - cargo_fetch # Linux Desktop # - test_aarch64-linux-android: # requires: # - cargo_fetch # Desktop Apple # - test_macos: # requires: # - cargo_fetch