on master help sign in
Add CI matrix with GHC 8.10 support; enable Cachix (#5)
152d2bbSridhar Ratnakumar
.github/workflows/ci.yaml+14−3
@@ -4,9 +4,20 @@ on:
4 push:
4 push:
5jobs:
5jobs:
6 build:
6 build:
7+ runs-on: ${{ matrix.os }}
8+ strategy:
9+ matrix:
10+ ghc: ['ghc884', 'ghc8101']
7− runs-on: ubuntu-latest
11+ os: [ubuntu-latest]
12+ name: GHC ${{ matrix.ghc }}
8 steps:
13 steps:
9 - uses: actions/checkout@v2
14 - uses: actions/checkout@v2
10 - uses: cachix/install-nix-action@v10
15 - uses: cachix/install-nix-action@v10
16+ - uses: cachix/cachix-action@v6
17+ with:
18+ name: juspay-nau
19+ signingKey: '${{ secrets.CACHIX_SIGNING_KEY }}'
20+ # Only needed for private caches
21+ authToken: '${{ secrets.CACHIX_AUTH_TOKEN }}'
11− - name: Build 🔧
22+ - name: Build and test 🔧
12− run: nix-build -j4
23+ run: nix-build -j4 --argstr compiler ${{ matrix.ghc }}
default.nix+27−17
@@ -3,25 +3,35 @@ let
3 url = "https://github.com/nixos/nixpkgs/archive/76f2e271a2ef.tar.gz";
3 url = "https://github.com/nixos/nixpkgs/archive/76f2e271a2ef.tar.gz";
4 sha256 = "1r4da3kyghqq7vzya5yb295jpnha1fgp755bi6wda4fmhyaynnsp";
4 sha256 = "1r4da3kyghqq7vzya5yb295jpnha1fgp755bi6wda4fmhyaynnsp";
5 };
5 };
6− pkgs = import nixpkgsSrc {};
6+ gitignoreSrc = builtins.fetchTarball {
7− gitignoreSrc = pkgs.fetchFromGitHub {
7+ url = "https://github.com/hercules-ci/gitignore/archive/c4662e6.tar.gz";
8− owner = "hercules-ci";
9− repo = "gitignore";
10− # put the latest commit sha of gitignore Nix library here:
11− rev = "c4662e6";
12− # use what nix suggests in the mismatch message here:
13− sha256 = "sha256:1npnx0h6bd0d7ql93ka7azhj40zgjp815fw2r6smg8ch9p7mzdlx";
8+ sha256 = "1npnx0h6bd0d7ql93ka7azhj40zgjp815fw2r6smg8ch9p7mzdlx";
14 };
9 };
15 inherit (import gitignoreSrc { inherit (pkgs); }) gitignoreSource;
10 inherit (import gitignoreSrc { inherit (pkgs); }) gitignoreSource;
16−in
11+in {
17− pkgs.haskellPackages.developPackage {
12+ compiler ? "default",
18− root = gitignoreSource ./.;
13+ pkgs ? import nixpkgsSrc {},
19− name = "jrec";
14+}:
20− modifier = drv:
15+ let
21− pkgs.haskell.lib.addBuildTools drv (with pkgs.haskellPackages;
16+ haskellPackages =
17+ if compiler == "default"
18+ then pkgs.haskellPackages
19+ else pkgs.haskell.packages.${compiler};
20+ projectDrv =
21+ haskellPackages.override {
22+ overrides = self: super: with pkgs.haskell.lib; {
23+ jrec = self.callCabal2nix "jrec" (gitignoreSource ./.) {};
24+ };
25+ };
26+ projectShell =
27+ projectDrv.shellFor {
28+ packages = p: [ p.jrec ];
29+ buildInputs = with projectDrv; [
22− [ cabal-install
30+ cabal-install
23 ormolu
31 ormolu
24 haskell-language-server
32 haskell-language-server
25 ghcid
33 ghcid
26− ]);
34+ ];
27− }
35+ };
36+ in
37+ if pkgs.lib.inNixShell then projectShell else projectDrv.jrec
jrec.cabal+1−1
@@ -57,7 +57,7 @@ library
57
57
58 build-depends:
58 build-depends:
59 aeson
59 aeson
60− , base >=4.13 && <4.14
60+ , base >=4.13 && <4.15
61 , constraints
61 , constraints
62 , deepseq
62 , deepseq
63 , generic-data
63 , generic-data