diff --git a/.circleci/config.yml b/.circleci/config.yml index 9642c9f7254a8963688ca4c7382d367424c38097..462b4fa590e7fe5326b924ef63c2ca92436bb50d 100644 --- a/.circleci/config.yml +++ b/.circleci/config.yml @@ -1,33 +1,39 @@ -# Modeled on https://circleci.com/docs/2.0/language-haskell/ +# 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 + jobs: - build: + test: docker: - - image: "fpco/stack-build:lts" + - image: "nixos/nix:2.2.1" steps: - - "checkout" - - restore_cache: - # Read about caching dependencies: https://circleci.com/docs/2.0/caching/ - name: "Restore Cached Dependencies" - keys: - - paymentserver-haskell-v1-{{ checksum "stack.yaml" }}-{{ checksum "PaymentServer.cabal" }} - - paymentserver-haskell-v1-{{ checksum "stack.yaml" }} - - run: - name: "Resolve/Update Dependencies" - command: "stack --no-terminal setup" - run: - name: "Run tests" - command: "stack --no-terminal test --coverage" + name: "Install Git" + command: | + # Required for the checkout and run steps + nix-env -i git openssh + + - "checkout" + - run: - name: "Install executable" - command: "stack --no-terminal install" - - save_cache: - name: "Cache Dependencies" - key: cci-demo-haskell-v1-{{ checksum "stack.yaml" }}-{{ checksum "PaymentServer.cabal" }} - paths: - - "/root/.stack" - - ".stack-work" - - store_artifacts: - # Upload executable - path: "~/.local/bin/PaymentServer-exe" - destination: "PaymentServer-exe" + name: "Run Tests" + command: | + stack test --coverage + +workflows: + version: 2 + everything: + jobs: + - "test"