- Put
ci.yaml
into.github/workflows/
- Follow https://github.com/cachix/cachix-action#usage to setup Cachix and benefit from quick CI build times.
Created
June 23, 2020 08:18
-
-
Save domenkozar/42311c302da74c10089a8ac28afd7bbc to your computer and use it in GitHub Desktop.
Haskell + GitHub Actions + Cachix
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
name: "CI" | |
on: | |
pull_request: | |
push: | |
jobs: | |
tests: | |
runs-on: ubuntu-latest | |
steps: | |
- uses: actions/[email protected] | |
- uses: cachix/install-nix-action@v10 | |
with: | |
skip_adding_nixpkgs_channel: true | |
- uses: cachix/cachix-action@v6 | |
with: | |
name: mycache | |
signingKey: '${{ secrets.CACHIX_SIGNING_KEY }}' | |
- run: cachix use iohk | |
- run: nix-build -A mypackage.components.all |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
{ haskellNix ? import (builtins.fetchTarball "https://github.com/input-output-hk/haskell.nix/archive/dc7acfeb7628032d5109747a8b330d58817b953f.tar.gz") {} | |
, nixpkgsSrc ? haskellNix.sources.nixpkgs-2003 | |
, nixpkgsArgs ? haskellNix.nixpkgsArgs | |
, pkgs ? import nixpkgsSrc nixpkgsArgs | |
}: | |
pkgs.haskell-nix.project { | |
src = pkgs.haskell-nix.haskellLib.cleanGit { | |
name = "haskell-nix-project"; | |
src = ./.; | |
}; | |
} |
@commandodev I think that's one of the top issues people hit with GHC core libraries: input-output-hk/haskell.nix#481
Ah right - what to do here then? (Sorry - haven't messed around with haskell.nix too much)
Pass the following to project
function:
modules = [{
nonReinstallablePkgs =
[ "rts"
"ghc-heap"
"ghc-prim"
"integer-gmp"
"integer-simple"
"base"
"deepseq"
"array"
"ghc-boot-th"
"pretty"
"template-haskell"
"ghcjs-prim"
"ghcjs-th"
"ghc-boot"
"ghc"
"Cabal"
"Win32"
"array"
"binary"
"bytestring"
"containers"
"directory"
"filepath"
"ghc-boot"
"ghc-compact"
"ghc-prim"
"ghci"
"haskeline"
"hpc"
"mtl"
"parsec"
"process"
"text"
"time"
"transformers"
"unix"
"xhtml"
"stm"
"terminfo"
];
}];
With the list of all module options at https://input-output-hk.github.io/haskell.nix/reference/modules/
Ah yep, that seems to work better :-)
This is outdated because the iohk
cachix cache is no longer updated.
https://input-output-hk.github.io/haskell.nix/tutorials/getting-started/#setting-up-the-binary-cache
Yeah, you need to use hydra.iohk.io
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
This didn't work for me
I was trying to add this to an existing project: cdodev/reanimate@e7f7790