Commit 9428d246 authored by Ben Gamari's avatar Ben Gamari 🐢

Factor out run-ci script

parent ce62c07a
......@@ -94,26 +94,10 @@ build-8.8:
--argstr url $GHC_TARBALL \
--out-link ghc \
ghcHEAD
- GHC=`pwd`/ghc/bin/ghc
- |
source ci/broken-packages.sh
EXTRA_OPTS="$EXTRA_OPTS $BROKEN_ARGS"
- rm -Rf $HOME/.cabal/pacakages/local tmp; mkdir -p tmp; cd tmp
- |
EXTRA_OPTS="--cabal-option=-j$CPUS" # Use cabal's build parallelism
if [ -n "$EXTRA_HC_OPTS" ]; then
EXTRA_OPTS="$EXTRA_OPTS --ghc-option=\"$EXTRA_HC_OPTS\""
fi
nix eval --raw -f ../ci cabalDepsSrc > deps.cabal.project
nix run -f ../ci -c \
head-hackage-ci \
test-patches \
--extra-cabal-fragment=$(pwd)/deps.cabal.project \
--patches=../patches \
--with-compiler=$GHC \
$EXTRA_OPTS
- nix run -f ../ci -c xz results.json
- export GHC=`pwd`/ghc/bin/ghc
- rm -Rf $HOME/.cabal/packages/local ci/run
- nix run -f ./ci -c run-ci
- nix run -f ./ci -c xz results.json
artifacts:
when: always
......
......@@ -30,6 +30,7 @@ function ghc_version() {
# broken "lens" 17988
version="$(ghc_version)"
echo "Found GHC $version."
case $version in
8.8.*)
;;
......
......@@ -48,6 +48,11 @@ let
makeWrapper ${./build-repo.sh} $out/bin/build-repo.sh \
--prefix PATH : ${stdenv.lib.makeBinPath deps}:$out/bin
makeWrapper ${../run-ci} $out/bin/run-ci \
--prefix PATH : ${stdenv.lib.makeBinPath deps}:$out/bin \
--set USE_NIX 1 \
--set BROKEN_LIST ${./broken-packages.sh}
makeWrapper ${xz}/bin/xz $out/bin/xz
'';
in
......
#!/usr/bin/env bash
set -e
cd ci
if [ -z "$GHC" ]; then
echo "The \$GHC variable is un-set. Defaulting to 'ghc'."
GHC="ghc"
fi
if [ -z "$BROKEN_LIST" ]; then
BROKEN_LIST=broken-packages.sh
fi
if [ -f "$BROKEN_LIST" ]; then
source $BROKEN_LIST
EXTRA_OPTS="$EXTRA_OPTS $BROKEN_ARGS"
else
echo "Couldn't find broken package list"
fi
EXTRA_OPTS="--cabal-option=-j$CPUS" # Use cabal's build parallelism
if [ -n "$EXTRA_HC_OPTS" ]; then
EXTRA_OPTS="$EXTRA_OPTS --ghc-option=\"$EXTRA_HC_OPTS\""
fi
mkdir -p run
cd run
echo "" > deps.cabal.project
if [ -n "$USE_NIX" ]; then
# Generate native library dependency mapping
nix eval --raw -f ../. cabalDepsSrc >> deps.cabal.project
run="nix run -f ../. -c head-hackage-ci"
else
run="cabal new-run head-hackage-ci --"
fi
set -x
$run \
test-patches \
--extra-cabal-fragment=$(pwd)/deps.cabal.project \
--patches=../../patches \
--with-compiler=$GHC \
$EXTRA_OPTS
Markdown is supported
0%
or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment