Skip to content

Commit 1d7a594

Browse files
authored
Merge pull request #82 from tweag/mk/use-new-buildkite-setup
Use the new buildkite setup for CI
2 parents 81e71b9 + f6d3097 commit 1d7a594

File tree

12 files changed

+65
-185
lines changed

12 files changed

+65
-185
lines changed

.buildkite/pipeline.yml

Lines changed: 5 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,5 @@
1+
steps:
2+
- label: Build and test
3+
command: |
4+
nix-build -A capability --no-out-link
5+
timeout: 100

.circleci/config.yml

Lines changed: 0 additions & 67 deletions
This file was deleted.

LICENSE renamed to LICENSE.md

File renamed without changes.

README.md

Lines changed: 2 additions & 11 deletions
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,7 @@
11
# capability: effects, extensionally
22

3+
[![Build status](https://badge.buildkite.com/a44574059e13fc443caa437226af5ae5e67b6a5ae012534712.svg?branch=master)](https://buildkite.com/tweag-1/capability)
4+
35
A capability is a type class that says explicitly which effects
46
a function is allowed to use. The [`mtl`][mtl] works like this too.
57
But unlike the `mtl`, this library decouples effects from their
@@ -136,17 +138,6 @@ These patches are defined in
136138
A development environment with all patched dependencies in scope is defined in
137139
[`shell.nix`](shell.nix).
138140

139-
### Cachix Nix Cache
140-
141-
A Nix cache for this package's dependencies is provided via [cachix][cachix].
142-
If you have [cachix][cachix] installed, then you can activate it by executing
143-
144-
```
145-
$ cachix use tweag
146-
```
147-
148-
[cachix]: https://cachix.org/
149-
150141
### Build
151142

152143
The build instructions assume that you have [Nix][nix] installed.

capability.cabal

Lines changed: 20 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -2,7 +2,7 @@ name: capability
22
version: 0.2.0.0
33
homepage: https://github.com/tweag/capability
44
license: BSD3
5-
license-file: LICENSE
5+
license-file: LICENSE.md
66
maintainer: [email protected]
77
copyright: 2018 EURL Tweag
88
category: Control
@@ -29,6 +29,11 @@ flag hspec-jenkins
2929
This package allows JUnit formatted test reporting for CI.
3030
default: False
3131

32+
flag dev
33+
description: Turn on development settings.
34+
manual: True
35+
default: False
36+
3237
library
3338
exposed-modules:
3439
Capability
@@ -70,7 +75,13 @@ library
7075
, transformers >= 0.5.5 && < 0.6
7176
, unliftio >= 0.2 && < 0.3
7277
, unliftio-core >= 0.1 && < 0.2
73-
ghc-options: -Wall
78+
if flag(dev)
79+
ghc-options: -Wall -Werror -Wcompat
80+
-Wincomplete-record-updates
81+
-Wincomplete-uni-patterns
82+
-Wnoncanonical-monad-instances
83+
else
84+
ghc-options: -Wall
7485
hs-source-dirs: src
7586
default-language: Haskell2010
7687

@@ -100,6 +111,12 @@ test-suite examples
100111
, unliftio >= 0.2 && < 0.3
101112
if flag(hspec-jenkins)
102113
build-depends: hspec-jenkins
103-
ghc-options: -Wall
114+
if flag(dev)
115+
ghc-options: -Wall -Werror -Wcompat
116+
-Wincomplete-record-updates
117+
-Wincomplete-uni-patterns
118+
-Wnoncanonical-monad-instances
119+
else
120+
ghc-options: -Wall
104121
hs-source-dirs: examples
105122
default-language: Haskell2010

default.nix

Lines changed: 29 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,29 @@
1+
{ pkgs ? (import ./nix/nixpkgs) }:
2+
3+
let
4+
compiler = "ghc865";
5+
source = pkgs.lib.sourceByRegex ./. [
6+
"^.*\.md$"
7+
"^capability\.cabal$"
8+
"^examples.*$"
9+
"^src.*$"
10+
];
11+
haskellPackages = pkgs.haskell.packages.${compiler}.override {
12+
overrides = capabilityOverlay;
13+
};
14+
capabilityOverlay = self: super: {
15+
"capability" = pkgs.haskell.lib.enableCabalFlag
16+
(super.callCabal2nix "capability" source { }) "dev";
17+
};
18+
in {
19+
capability = haskellPackages.capability;
20+
shell = haskellPackages.shellFor {
21+
packages = ps: [
22+
ps.capability
23+
];
24+
buildInputs = [
25+
haskellPackages.cabal-install
26+
haskellPackages.ghcid
27+
];
28+
};
29+
}

nix/default.nix

Lines changed: 0 additions & 5 deletions
This file was deleted.

nix/haskell/default.nix

Lines changed: 0 additions & 64 deletions
This file was deleted.

nix/nixpkgs/default.nix

Lines changed: 7 additions & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -1,9 +1,9 @@
11
let
2-
spec = builtins.fromJSON (builtins.readFile ./src.json);
3-
src = {
4-
url = "https://github.com/${spec.owner}/${spec.repo}/archive/${spec.rev}.tar.gz";
5-
inherit (spec) sha256;
2+
rev = "19.09";
3+
sha256 = "0mhqhq21y5vrr1f30qd2bvydv4bbbslvyzclhw0kdxmkgg3z4c92";
4+
nixpkgs = builtins.fetchTarball {
5+
url = "https://github.com/NixOS/nixpkgs/archive/${rev}.tar.gz";
6+
inherit sha256;
67
};
7-
8-
in
9-
builtins.fetchTarball src
8+
pkgs = import nixpkgs { config.allowUnfree = true; };
9+
in pkgs

nix/nixpkgs/src.json

Lines changed: 0 additions & 7 deletions
This file was deleted.

shell.nix

Lines changed: 2 additions & 13 deletions
Original file line numberDiff line numberDiff line change
@@ -1,14 +1,3 @@
1-
with (import ./nix {});
1+
{ pkgs ? (import ./nix/nixpkgs) }:
22

3-
{ ghc ? "ghc861" # One of ghc843, ghc861.
4-
, haskellPackages ? haskell.packages.${ghc}
5-
}:
6-
7-
mkShell {
8-
inputsFrom = [
9-
haskellPackages.capability.env
10-
];
11-
nativeBuildInputs = [
12-
cabal-install
13-
];
14-
}
3+
(import ./default.nix { inherit pkgs; }).shell

stack.yaml

Lines changed: 0 additions & 8 deletions
This file was deleted.

0 commit comments

Comments
 (0)