From fb96cb32022051f1cac2d48818e83c1d361a854a Mon Sep 17 00:00:00 2001 From: Jean-Paul Calderone <exarkun@twistedmatrix.com> Date: Fri, 18 Oct 2019 15:54:38 -0400 Subject: [PATCH] CircleCI caching for the docs job --- .circleci/config.yml | 47 ++++++++++++++++++-------------------------- 1 file changed, 19 insertions(+), 28 deletions(-) diff --git a/.circleci/config.yml b/.circleci/config.yml index 09e59f17..20864190 100644 --- a/.circleci/config.yml +++ b/.circleci/config.yml @@ -34,12 +34,6 @@ jobs: docker: - image: "nixorg/nix:circleci" steps: - - run: - name: "Install Git" - command: | - # Required for the checkout step - nix-env -i git openssh - - "checkout" - restore_cache: @@ -63,46 +57,43 @@ jobs: - privatestorageio-nix-store-v1-{{ checksum "nixpkgs.rev" }} - privatestorageio-nix-store-v1- - - save_cache: - name: "Cache Nix Store Paths" - key: privatestorageio-nix-store-v1-{{ checksum "nixpkgs.rev" }} - paths: - - "/nix" - - run: name: "Run Tests" command: | export NIX_PATH=nixpkgs=https://github.com/NixOS/nixpkgs-channels/archive/$(cat nixpkgs.rev).tar.gz nix-build --max-jobs 1 nixos/system-tests.nix -A driver + - save_cache: + name: "Cache Nix Store Paths" + key: privatestorageio-nix-store-v1-{{ checksum "nixpkgs.rev" }} + paths: + - "/nix" + build: docker: - image: "nixorg/nix:circleci" steps: - - run: - name: "Install CA Certificates" - command: | - # Required for cache and artifact interactions. Though we use a - # nix image, it's actually an alpine base... The CircleCI cache - # management (which we stopped using) and artifact uploader don't - # know how to use the nix ca bundle we could install. - apk update - apk add ca-certificates - - - run: - name: "Install Git" - command: | - # Required for the checkout step - nix-env -i git openssh - - "checkout" + - restore_cache: + # See comments for nix store caching in `build` job. + name: "Restore Nix Store Paths" + keys: + - privatestorageio-docs-nix-store-v1-{{ checksum "nixpkgs.rev" }} + - privatestorageio-docs-nix-store-v1- + - run: name: "Nix Build" command: | export NIX_PATH=nixpkgs=https://github.com/NixOS/nixpkgs-channels/archive/$(cat nixpkgs.rev).tar.gz nix-build docs.nix + - save_cache: + name: "Cache Nix Store Paths" + key: privatestorageio-docs-nix-store-v1-{{ checksum "nixpkgs.rev" }} + paths: + - "/nix" + - store_artifacts: path: "result/docs" destination: "docs" -- GitLab