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: style:
docker: docker:
- image: circleci/buildpack-deps:trusty - image: nixos/nix:2.3
steps: steps:
- checkout - checkout
- restore_cache:
keys:
- v1-stack-style-dependencies-{{ checksum "stack.yaml" }}
- run: - run:
name: install stack name: Install linting and styling scripts
command: nix-env -f default.nix -iA lint style
- run:
name: Run linter
command: | 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 echo 'Note: For checking this locally, use `make lint`. Or, if using `nix`, run `nix-shell --run postgrest-lint`'
sudo mv /tmp/stack-2.1.3-linux-x86_64/stack /usr/bin postgrest-lint
stack setup
- run: - run:
name: install linters name: Run style check
command: | command: |
# -fno-spec-constr may help with out-of-memory issues compiling echo 'Note: For checking this locally, use `make style`. Or, if using `nix`, run `nix-shell --run postgrest-style`'
# haskell-src-exts. Compare stack.yaml. postgrest-style-check
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
build-test-9.4: build-test-9.4:
docker: docker:
+30 -5
View File
@@ -1,6 +1,19 @@
{ mkDerivation, array, async, base, bytestring, containers, deepseq { mkDerivation
, ghc-prim, hashable, mtl, mtl-compat, stdenv, stm, text , array
, transformers, transformers-compat , async
, base
, bytestring
, containers
, deepseq
, ghc-prim
, hashable
, mtl
, mtl-compat
, stdenv
, stm
, text
, transformers
, transformers-compat
}: }:
mkDerivation { mkDerivation {
pname = "protolude"; pname = "protolude";
@@ -9,8 +22,20 @@ mkDerivation {
isLibrary = true; isLibrary = true;
isExecutable = true; isExecutable = true;
libraryHaskellDepends = [ libraryHaskellDepends = [
array async base bytestring containers deepseq ghc-prim hashable array
mtl mtl-compat stm text transformers transformers-compat async
base
bytestring
containers
deepseq
ghc-prim
hashable
mtl
mtl-compat
stm
text
transformers
transformers-compat
]; ];
homepage = "https://github.com/sdiehl/protolude"; homepage = "https://github.com/sdiehl/protolude";
description = "A small prelude"; description = "A small prelude";