Skip to content
Snippets Groups Projects
Commit a12788a9 authored by Jean-Paul Calderone's avatar Jean-Paul Calderone
Browse files

try to have some circleci caching

parent c7231aa1
No related branches found
No related tags found
1 merge request!39Test with Nix instead
...@@ -75,11 +75,52 @@ jobs: ...@@ -75,11 +75,52 @@ jobs:
- "checkout" - "checkout"
- "run":
# CircleCI won't let us interpolate NIXPKGS_REV into a cache key.
# Only CircleCI's own environment variables or variables set via the
# web interface in a "context" can be interpolated into cache keys.
# However, we can interpolate the checksum of a file... Since we
# don't care about the exact revision, we just care that a new
# revision gives us a new string, we can write the revision to a
# file and then put the checksum of that file into the cache key.
# This way, we don't have to maintain the nixpkgs revision in two
# places and risk having them desynchronize.
name: "Prepare For Cache Key"
command: |
echo "${NIXPKGS_REV}" > nixpkgs.rev
- restore_cache:
# Get all of Nix's state relating to the particular revision of
# nixpkgs we're using. It will always be the same. CircleCI
# artifacts and nixpkgs store objects are probably mostly hosted in
# the same place (S3) so there's not a lot of difference for
# anything that's pre-built. For anything we end up building
# ourselves, though, this saves us all of the build time (less the
# download time).
#
# Read about caching dependencies: https://circleci.com/docs/2.0/caching/
name: "Restore Nix Store Paths"
keys:
# Construct cache keys that allow sharing as long as nixpkgs
# revision is unchanged.
#
# If nixpkgs changes then potentially a lot of cached packages for
# the base system will be invalidated so we may as well drop them
# and make a new cache with the new packages.
- zkapauthorizer-nix-store-v1-{{ checksum "nixpkgs.rev" }}
- zkapauthorizer-nix-store-v1-
- run: - run:
name: "Run Test Suite" name: "Run Test Suite"
command: | command: |
nix-build --argstr hypothesisProfile ci --arg collectCoverage true --attr doc nix-build --argstr hypothesisProfile ci --arg collectCoverage true --attr doc
- save_cache:
name: "Cache Nix Store Paths"
key: zkapauthorizer-nix-store-v1-{{ checksum "nixpkgs.rev" }}
paths:
- "/nix"
- run: - run:
name: "Report Coverage" name: "Report Coverage"
command: | command: |
......
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment