Skip to content
Permalink
Browse files

Merge pull request #688 from input-output-hk/rvl/buildkite-stack-build

Buildkite Stack build
  • Loading branch information...
KtorZ committed Sep 11, 2019
2 parents f52aee8 + a8afc29 commit d96a7ac86bbd113690eb38ee9a3fc92a764e67d4
@@ -0,0 +1,7 @@
#!/usr/bin/env bash

set -euo pipefail

stylish-haskell -i `git ls-files -- '*.hs'`

git diff --exit-code
@@ -0,0 +1,26 @@
{ walletPackages ? import ./.. {}
, pkgs ? walletPackages.pkgs
}:

with pkgs.lib;
with pkgs;

let
buildTools = [
gnused coreutils git nix gnumake gnutar gzip lz4
stack walletPackages.iohkLib.stack-hpc-coveralls
haskellPackages.weeder
];
libs = ps: with ps; [turtle safe transformers extra async];

ghc' = haskellPackages.ghcWithPackages libs;
stackRebuild = runCommand "stack-rebuild" {
buildInputs = [ ghc' makeWrapper ];
} ''
mkdir -p $out/bin
ghc -Wall -threaded -o $out/bin/rebuild ${./rebuild.hs}
wrapProgram $out/bin/rebuild --set PATH "${lib.makeBinPath buildTools}"
'';

in
stackRebuild
@@ -21,3 +21,25 @@ steps:
timeout_in_minutes: 60
agents:
system: x86_64-linux

- label: 'Clean up CI cache'
env:
STACK_ROOT: "/build/cardano-wallet.stack"
command:
- "nix-build .buildkite/default.nix -o sr"
- "./sr/bin/rebuild cleanup-cache --build-dir=/build/cardano-wallet --cache-dir=/build/cardano-wallet.cache"
agents:
system: x86_64-linux

- block: 'Delete CI Caches'
- label: 'Purge CI cache'
env:
STACK_ROOT: "/build/cardano-wallet.stack"
command:
- "nix-build .buildkite/default.nix -o sr"
- "./sr/bin/rebuild purge-cache --build-dir=/build/cardano-wallet --cache-dir=/build/cardano-wallet.cache"
agents:
system: x86_64-linux
- wait
- label: "Rebuild master branch"
trigger: "cardano-wallet"
@@ -1,10 +1,35 @@
steps:
- label: 'Stack Rebuild'
env:
STACK_ROOT: "/build/cardano-wallet.stack"
command:
- "nix-build .buildkite/default.nix -o sr"
- "./sr/bin/rebuild --build-dir /build/cardano-wallet --cache-dir /build/cardano-wallet.cache"
timeout_in_minutes: 120
agents:
system: x86_64-linux

- label: Check Hydra evaluation of release.nix
command: 'nix-build -A iohkLib.check-hydra -o check-hydra.sh && ./check-hydra.sh'
agents:
system: x86_64-linux

- label: Check auto-generated Nix
command: 'nix-build -A checks.check-nix-tools -o check-nix-tools.sh && ./check-nix-tools.sh'
command: 'nix-build -A iohkLib.check-nix-tools -o check-nix-tools.sh && ./check-nix-tools.sh'
agents:
system: x86_64-linux

- label: 'Check Stylish Haskell'
command: 'nix-shell --run .buildkite/check-stylish.sh'
agents:
system: x86_64-linux

- label: 'HLint'
command: 'nix-shell --run "hlint exe lib"'
agents:
system: x86_64-linux

- label: 'Validate OpenAPI Specification'
command: 'nix-shell --run "openapi-spec-validator --schema 2.0 specifications/api/swagger.yaml"'
agents:
system: x86_64-linux

0 comments on commit d96a7ac

Please sign in to comment.
You can’t perform that action at this time.