Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Using nix on the CI #60

Open
wants to merge 3 commits into
base: master
Choose a base branch
from
Open
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
37 changes: 16 additions & 21 deletions .circleci/config.yml
Original file line number Diff line number Diff line change
Expand Up @@ -2,32 +2,27 @@ version: 2
jobs:
build:
docker:
- image: fpco/stack-build
- image: nixos/nix:2.3
steps:
- checkout
- run:
name: Compute cache key
name: Setup Cachix
command: |
find . -name "*.cabal" -o -name "stack.yaml" -type f | sort | xargs cat > /tmp/stack-deps
- restore_cache:
keys:
- porcupine-stack-deps-{{arch}}-{{checksum "/tmp/stack-deps"}}
- run:
name: Setup build toolchain
command: stack setup
- run:
name: Building dependencies
command: stack test -j1 --only-snapshot --prefetch
- save_cache:
paths:
- "~/.stack"
key: porcupine-stack-deps-{{arch}}-{{checksum "/tmp/stack-deps"}}
apk --no-progress update
apk --no-progress add ca-certificates
nix-channel --update
# Install cachix and activate project cache
nix-env -iA cachix -f https://github.com/NixOS/nixpkgs/tarball/1d4de0d552ae9aa66a5b8dee5fb0650a4372d148
USER=dummy cachix use tweag
- run:
name: Building
command: stack build --pedantic
- run:
name: Building tests
command: stack test --pedantic --no-run-tests
command: nix-shell --run 'cabal new-build all' | cachix push tweag
- run:
name: Running tests
command: stack test
command: nix-shell --run 'cabal new-test all' | cachix push tweag
workflows:
version: 2
build:
jobs:
- build:
context: org-global
2 changes: 1 addition & 1 deletion default.nix
Original file line number Diff line number Diff line change
Expand Up @@ -63,7 +63,7 @@ overlayHaskell = _:pkgs:
owner = "tweag";
repo = "funflow";
rev = "v1.5.0";
sha256 = "05k4icz3lls135aasvf7f7riniw5cmyg8y6phcz4qiikhswlbs0x";
sha256 = "1bldpi1fcr6l7qcr7kkwycvp1i9jgpd6b8m4190z9lsiddz0pkav";
};
monadBayesSource = pkgs.fetchFromGitHub {
owner = "tweag"; # Using our fork until https://github.com/adscib/monad-bayes/pull/54 is merged
Expand Down