on master help sign in
Add CI matrix with GHC 8.10 support; enable Cachix (#5)
commit152d2bbfdf7b0d04b22d63b59d6ce0b0d962ea18 authorSridhar Ratnakumar <srid@srid.ca> dateTue 4 Aug 2020, 22:55 (6 years ago) parentaa02e13
3 files changed+42−21
.github/workflows/ci.yaml+14−3 default.nix+27−17 jrec.cabal+1−1
.github/workflows/ci.yaml+14−3
@@ -4,9 +4,20 @@ on:
44 push:
55jobs:
66 build:
7− runs-on: ubuntu-latest
7+ runs-on: ${{ matrix.os }}
8+ strategy:
9+ matrix:
10+ ghc: ['ghc884', 'ghc8101']
11+ os: [ubuntu-latest]
12+ name: GHC ${{ matrix.ghc }}
813 steps:
914 - uses: actions/checkout@v2
1015 - uses: cachix/install-nix-action@v10
11− - name: Build 🔧
12− run: nix-build -j4
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 }}'
22+ - name: Build and test 🔧
23+ run: nix-build -j4 --argstr compiler ${{ matrix.ghc }}
default.nix+27−17
@@ -3,25 +3,35 @@ let
33 url = "https://github.com/nixos/nixpkgs/archive/76f2e271a2ef.tar.gz";
44 sha256 = "1r4da3kyghqq7vzya5yb295jpnha1fgp755bi6wda4fmhyaynnsp";
55 };
6− pkgs = import nixpkgsSrc {};
7− gitignoreSrc = pkgs.fetchFromGitHub {
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";
6+ gitignoreSrc = builtins.fetchTarball {
7+ url = "https://github.com/hercules-ci/gitignore/archive/c4662e6.tar.gz";
8+ sha256 = "1npnx0h6bd0d7ql93ka7azhj40zgjp815fw2r6smg8ch9p7mzdlx";
149 };
1510 inherit (import gitignoreSrc { inherit (pkgs); }) gitignoreSource;
16−in
17− pkgs.haskellPackages.developPackage {
18− root = gitignoreSource ./.;
19− name = "jrec";
20− modifier = drv:
21− pkgs.haskell.lib.addBuildTools drv (with pkgs.haskellPackages;
22− [ cabal-install
11+in {
12+ compiler ? "default",
13+ pkgs ? import nixpkgsSrc {},
14+}:
15+ let
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; [
30+ cabal-install
2331 ormolu
2432 haskell-language-server
2533 ghcid
26− ]);
27− }
34+ ];
35+ };
36+ in
37+ if pkgs.lib.inNixShell then projectShell else projectDrv.jrec
jrec.cabal+1−1
@@ -57,7 +57,7 @@ library
5757
5858 build-depends:
5959 aeson
60− , base >=4.13 && <4.14
60+ , base >=4.13 && <4.15
6161 , constraints
6262 , deepseq
6363 , generic-data