Hook the Nix styling scripts into CI (#1504)

This commit is contained in:
Remo
2020-04-29 10:44:11 -05:00
committed by GitHub
parent 9134171b95
commit d4cf8e7abb
2 changed files with 40 additions and 32 deletions
+10 -27
View File
@@ -88,39 +88,22 @@ jobs:
style:
docker:
- image: circleci/buildpack-deps:trusty
- image: nixos/nix:2.3
steps:
- checkout
- restore_cache:
keys:
- v1-stack-style-dependencies-{{ checksum "stack.yaml" }}
- run:
name: install stack
name: Install linting and styling scripts
command: nix-env -f default.nix -iA lint style
- run:
name: Run linter
command: |
curl -L https://github.com/commercialhaskell/stack/releases/download/v2.1.3/stack-2.1.3-linux-x86_64.tar.gz | tar zx -C /tmp
sudo mv /tmp/stack-2.1.3-linux-x86_64/stack /usr/bin
stack setup
echo 'Note: For checking this locally, use `make lint`. Or, if using `nix`, run `nix-shell --run postgrest-lint`'
postgrest-lint
- run:
name: install linters
name: Run style check
command: |
# -fno-spec-constr may help with out-of-memory issues compiling
# haskell-src-exts. Compare stack.yaml.
stack install --ghc-options=-fno-spec-constr hlint stylish-haskell
- save_cache:
paths:
- "~/.stack"
- ".stack-work"
key: v1-stack-style-dependencies-{{ checksum "stack.yaml" }}
- run:
name: Add stack tools to $PATH
command: |
echo "export PATH=/home/circleci/.local/bin:$PATH" >> $BASH_ENV
- run:
name: run linter
command: make lint
- run:
name: run styler
command: make style
echo 'Note: For checking this locally, use `make style`. Or, if using `nix`, run `nix-shell --run postgrest-style`'
postgrest-style-check
build-test-9.4:
docker:
+30 -5
View File
@@ -1,6 +1,19 @@
{ mkDerivation, array, async, base, bytestring, containers, deepseq
, ghc-prim, hashable, mtl, mtl-compat, stdenv, stm, text
, transformers, transformers-compat
{ mkDerivation
, array
, async
, base
, bytestring
, containers
, deepseq
, ghc-prim
, hashable
, mtl
, mtl-compat
, stdenv
, stm
, text
, transformers
, transformers-compat
}:
mkDerivation {
pname = "protolude";
@@ -9,8 +22,20 @@ mkDerivation {
isLibrary = true;
isExecutable = true;
libraryHaskellDepends = [
array async base bytestring containers deepseq ghc-prim hashable
mtl mtl-compat stm text transformers transformers-compat
array
async
base
bytestring
containers
deepseq
ghc-prim
hashable
mtl
mtl-compat
stm
text
transformers
transformers-compat
];
homepage = "https://github.com/sdiehl/protolude";
description = "A small prelude";