version: 2.1 executors: default: docker: - image: filecoin/rust:latest working_directory: /mnt/crate doxygen: docker: - image: hrektts/doxygen python: docker: - image: 3.7.7-stretch restore-workspace: &restore-workspace attach_workspace: at: /mnt restore-cache: &restore-cache restore_cache: keys: - cargo-v3-{{ 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 - run: name: Test (<< parameters.target >>) command: TARGET=<< parameters.target >> ci_scripts/run-rust-test.sh no_output_timeout: 15m jobs: cargo_fetch: executor: default steps: - checkout - restore_cache: keys: - cargo-v3-{{ 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: rustup component add --toolchain $(cat rust-toolchain) clippy-preview - run: cargo fetch - run: rustc +stable --version - run: rustc +$(cat rust-toolchain) --version # make sure this git repo doesn't grow too big - run: git gc - persist_to_workspace: root: /mnt paths: - crate - save_cache: key: cargo-v3-{{ 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 fetch - run: name: Test command: TARGET=x86_64-apple-darwin ci_scripts/run-rust-test.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_doxygen: executor: doxygen steps: - checkout - run: bash ci_scripts/run-doxygen.sh - run: mkdir -p workspace/c-docs - run: cp -av deltachat-ffi/{html,xml} workspace/c-docs/ - persist_to_workspace: root: workspace paths: - c-docs remote_python_packaging: machine: true steps: - checkout # the following commands on success produces # workspace/{wheelhouse,py-docs} as artefact directories - run: bash ci_scripts/remote_python_packaging.sh - persist_to_workspace: root: workspace paths: # - c-docs - py-docs - wheelhouse remote_tests_python: machine: true steps: - checkout - run: ci_scripts/remote_tests_python.sh upload_docs_wheels: machine: true steps: - checkout - attach_workspace: at: workspace - run: pyenv versions - run: pyenv global 3.5.2 - run: ls -laR workspace - run: ci_scripts/ci_upload.sh workspace/py-docs workspace/wheelhouse workspace/c-docs clippy: executor: default steps: - *restore-workspace - *restore-cache - run: name: Run cargo clippy command: cargo clippy workflows: version: 2.1 test: jobs: # - cargo_fetch - remote_tests_python: filters: tags: only: /.*/ - remote_python_packaging: requires: - remote_tests_python filters: branches: only: master tags: only: /.*/ - upload_docs_wheels: requires: - remote_python_packaging - build_doxygen filters: branches: only: master tags: only: /.*/ # - rustfmt: # requires: # - cargo_fetch # - clippy: # requires: # - cargo_fetch - build_doxygen: filters: branches: only: master tags: only: /.*/ # Linux Desktop 64bit # - test_x86_64-unknown-linux-gnu: # requires: # - cargo_fetch # Linux Desktop 32bit # - test_i686-unknown-linux-gnu: # requires: # - cargo_fetch # Android 64bit # - test_aarch64-linux-android: # requires: # - cargo_fetch # Desktop Apple # - test_macos: # requires: # - cargo_fetch