Skip to content
Snippets Groups Projects
config.yml 2.17 KiB
Newer Older
# Copyright 2019 PrivateStorage.io, LLC
#
# Licensed under the Apache License, Version 2.0 (the "License");
# you may not use this file except in compliance with the License.
# You may obtain a copy of the License at
#
#     http://www.apache.org/licenses/LICENSE-2.0
#
# Unless required by applicable law or agreed to in writing, software
# distributed under the License is distributed on an "AS IS" BASIS,
# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
# See the License for the specific language governing permissions and
# limitations under the License.

version: 2.1
      - image: "nixorg/nix:circleci"
      NIXPKGS_REV: "3c83ad6ac13b67101cc3e2e07781963a010c1624"
      - run:
          name: "Setup NIX_PATH Environment Variable"
          command: |
Jean-Paul Calderone's avatar
Jean-Paul Calderone committed
            echo "export NIX_PATH=nixpkgs=https://github.com/NixOS/nixpkgs/archive/$NIXPKGS_REV.tar.gz" >> $BASH_ENV
      - restore_cache:
          name: "Restore Nix Store Paths"
          keys:
            - paymentserver-nix-store-v1-{{ .Environment.NIXPKGS_REV }}
            - paymentserver-nix-store-v1-

      - restore_cache:
          # Read about caching dependencies: https://circleci.com/docs/2.0/caching/
          name: "Restore Cached Dependencies"
          keys:
            - paymentserver-v1-{{ checksum "stack.yaml" }}-{{ checksum "PaymentServer.cabal" }}
            - paymentserver-v1-{{ checksum "stack.yaml" }}

          name: "Run Tests"
          command: |
Jean-Paul Calderone's avatar
Jean-Paul Calderone committed
            env
            cat $BASH_ENV
            nix-shell shell.nix --run "stack build --no-terminal --test --coverage --fast"
      - save_cache:
          name: "Cache Dependencies"
          key: paymentserver-v1-{{ checksum "stack.yaml" }}-{{ checksum "PaymentServer.cabal" }}
          paths:
            - "/root/.stack"
            - ".stack-work"

      - save_cache:
          name: "Cache Nix Store Paths"
          key: paymentserver-nix-store-v1-{{ .Environment.NIXPKGS_REV }}
      - store_artifacts:
          path: ".stack-work/logs"

workflows:
  version: 2
  everything:
    jobs:
      - "test"