From 54f6cefaad307beeab25bc93cd9296857704d3b4 Mon Sep 17 00:00:00 2001 From: Mikhail Zabaluev Date: Wed, 11 Mar 2020 18:54:39 +0200 Subject: [PATCH 1/4] Remove the CI dockerfiles These have been moved to their own repository. --- docker/ci/Dockerfile.nightly | 12 ------------ docker/ci/Dockerfile.release | 12 ------------ 2 files changed, 24 deletions(-) delete mode 100644 docker/ci/Dockerfile.nightly delete mode 100644 docker/ci/Dockerfile.release diff --git a/docker/ci/Dockerfile.nightly b/docker/ci/Dockerfile.nightly deleted file mode 100644 index 3a1ecf1881..0000000000 --- a/docker/ci/Dockerfile.nightly +++ /dev/null @@ -1,12 +0,0 @@ -FROM rustlang/rust:nightly - -LABEL org.label-schema.schema-version = "1.0" -LABEL org.label-schema.vendor = "Input Output HK Limited" -LABEL org.label-schema.description = "CI image for Jormungandr (nightly Rust)" - -RUN apt-get update && \ - apt-get install -y protobuf-compiler && \ - apt-get clean && \ - cargo install cargo-audit && \ - rm -rf $HOME/.cargo/git && \ - rm -rf $HOME/.cargo/registry diff --git a/docker/ci/Dockerfile.release b/docker/ci/Dockerfile.release deleted file mode 100644 index 1325bd6544..0000000000 --- a/docker/ci/Dockerfile.release +++ /dev/null @@ -1,12 +0,0 @@ -FROM circleci/rust:latest - -LABEL org.label-schema.schema-version = "1.0" -LABEL org.label-schema.vendor = "Input Output HK Limited" -LABEL org.label-schema.description = "CI image for Jormungandr" - -RUN sudo apt-get update && \ - sudo apt-get install -y protobuf-compiler && \ - sudo apt-get clean && \ - cargo install cargo-audit && \ - rm -rf $HOME/.cargo/git && \ - rm -rf $HOME/.cargo/registry From dcd36fd1a61d25dea580f6b28e8525fba284de6f Mon Sep 17 00:00:00 2001 From: Mikhail Zabaluev Date: Wed, 11 Mar 2020 19:00:33 +0200 Subject: [PATCH 2/4] Switch to the custom image for CircleCI builds No more need to install cargo audit during the build. --- .circleci/config.yml | 25 +++++++++++-------------- 1 file changed, 11 insertions(+), 14 deletions(-) diff --git a/.circleci/config.yml b/.circleci/config.yml index 7d797e109c..c2d925d59f 100644 --- a/.circleci/config.yml +++ b/.circleci/config.yml @@ -2,8 +2,8 @@ version: 2 jobs: cargo_fetch: docker: - - image: rust:latest - working_directory: /mnt/crate + - image: inputoutput/rust:stable + working_directory: /home/circleci/project steps: - checkout - run: git submodule sync @@ -22,8 +22,8 @@ jobs: cargo_audit: docker: - - image: rust:latest - working_directory: /mnt/crate + - image: inputoutput/rust:stable + working_directory: /home/circleci/project steps: - checkout - run: git submodule sync @@ -31,9 +31,6 @@ jobs: - restore_cache: keys: - cargo-v3-{{ checksum "Cargo.toml" }}-{{ checksum "Cargo.lock" }} - - run: - name: Install Cargo Audit - command: cargo install cargo-audit - run: name: Print Cargo Audit Version command: cargo audit --version @@ -43,8 +40,8 @@ jobs: rustfmt: docker: - - image: rust:latest - working_directory: /mnt/crate + - image: inputoutput/rust:stable + working_directory: /home/circleci/project steps: - checkout - run: @@ -59,10 +56,10 @@ jobs: test_debug: docker: - - image: rust:latest + - image: inputoutput/rust:stable environment: CARGO_INCREMENTAL: 0 - working_directory: /mnt/crate + working_directory: /home/circleci/project steps: - checkout - run: git submodule sync @@ -87,8 +84,8 @@ jobs: test_release: docker: - - image: rust:latest - working_directory: /mnt/crate + - image: inputoutput/rust:stable + working_directory: /home/circleci/project steps: - checkout - run: git submodule sync @@ -114,7 +111,7 @@ jobs: - image: instrumentisto/rust:beta environment: CARGO_INCREMENTAL: 0 - working_directory: /mnt/crate + working_directory: /home/circleci/project steps: - checkout - run: git submodule sync From 54158dec743a73c3a3858e5c6ed2cc9f8c4d92c7 Mon Sep 17 00:00:00 2001 From: Mikhail Zabaluev Date: Wed, 11 Mar 2020 19:05:33 +0200 Subject: [PATCH 3/4] Cache the advisory db for cargo audit --- .circleci/config.yml | 7 +++++++ 1 file changed, 7 insertions(+) diff --git a/.circleci/config.yml b/.circleci/config.yml index c2d925d59f..441e1b6a58 100644 --- a/.circleci/config.yml +++ b/.circleci/config.yml @@ -31,12 +31,19 @@ jobs: - restore_cache: keys: - cargo-v3-{{ checksum "Cargo.toml" }}-{{ checksum "Cargo.lock" }} + - restore_cache: + keys: + - cargo-advisory-db-v1 - run: name: Print Cargo Audit Version command: cargo audit --version - run: name: Check Cargo Audit command: cargo audit + - save_cache: + key: cargo-advisory-db-v1 + paths: + - /usr/local/cargo/advisory-db rustfmt: docker: From 5f0e997a5c11db1ead51c056ad56ccb5999124c8 Mon Sep 17 00:00:00 2001 From: Mikhail Zabaluev Date: Wed, 11 Mar 2020 19:05:50 +0200 Subject: [PATCH 4/4] No need to install rustfmt for CircleCI --- .circleci/config.yml | 3 --- 1 file changed, 3 deletions(-) diff --git a/.circleci/config.yml b/.circleci/config.yml index 441e1b6a58..33919498d1 100644 --- a/.circleci/config.yml +++ b/.circleci/config.yml @@ -51,9 +51,6 @@ jobs: working_directory: /home/circleci/project steps: - checkout - - run: - name: Install rustfmt - command: rustup component add rustfmt - run: name: Print version information command: cargo fmt -- --version