From e2765f3d2d0f5132005361587f3d273a88699de3 Mon Sep 17 00:00:00 2001 From: Benjamin Summers Date: Tue, 10 Dec 2019 23:39:52 -0800 Subject: [PATCH] CI cleanup. --- .travis.yml | 73 +++++++++++------------------------------ Makefile | 5 +++ sh/ci-tests | 2 ++ sh/release | 7 ++++ sh/test | 2 ++ sh/travis-install-stack | 24 ++++++++++++++ 6 files changed, 59 insertions(+), 54 deletions(-) create mode 100755 sh/travis-install-stack diff --git a/.travis.yml b/.travis.yml index d95bf4058..e119ec29b 100644 --- a/.travis.yml +++ b/.travis.yml @@ -8,66 +8,31 @@ cache: - $HOME/.stack - $TRAVIS_BUILD_DIR/.stack-work -install: - before_install: - git lfs pull - - # King Haskell - # Using compiler above sets CC to an invalid value, so unset it - - unset CC - - CABALARGS="" - - export PATH=/opt/ghc/$GHCVER/bin:/opt/cabal/$CABALVER/bin:$HOME/.local/bin:/opt/alex/$ALEXVER/bin:/opt/happy/$HAPPYVER/bin:$HOME/.cabal/bin:$PATH - - | # Install stack - mkdir -p ~/.local/bin - # travis_retry curl -L https://get.haskellstack.org/stable/osx-x86_64.tar.gz | tar xz --strip-components=1 --include '*/stack' -C ~/.local/bin - mkdir -p tmp - travis_retry curl -L https://get.haskellstack.org/stable/linux-x86_64.tar.gz | tar xz -C tmp - mv tmp/stack-*/stack ~/.local/bin - # Use the more reliable S3 mirror of Hackage - mkdir -p $HOME/.cabal - echo 'remote-repo: hackage.haskell.org:http://hackage.fpcomplete.com/' > $HOME/.cabal/config - echo 'remote-repo-cache: $HOME/.cabal/packages' >> $HOME/.cabal/config + - sh/travis-install-stack install: - nix-env -iA cachix -f https://cachix.org/api/v1/install - - # King Haskell - - echo "$(ghc --version) [$(ghc --print-project-git-commit-id 2> /dev/null || echo '?')]" - - SAVED_OPTIONS=$(set +o) - - set -ex - - stack --no-terminal --install-ghc build lmdb-static - stack --no-terminal --install-ghc build king --only-dependencies - - eval "$SAVED_OPTIONS" script: - - echo hi - # - cachix use urbit2 - # - ./sh/cachix || true + - cachix use urbit2 + - ./sh/cachix || true + - make build-fast + - make release + - sh/ci-tests - # - make - # - make release - - # King Haskell - # - export PATH="${PATH}:$(pwd)/bin" - - stack build king --fast - - stack install king --local-bin-path ./bin - - stack test king --fast - # # otool -L ./bin/king-linux64-demo - # - mv bin/king release/king-linux64-demo - - # - sh/ci-tests - -# deploy: - # - skip_cleanup: true - # provider: gcs - # access_key_id: GOOGTADOPP55X5ZTH3IKAXQW - # secret_access_key: - # secure: rSPif0VHX3Q3QpWM9iUt/Z9sicCY8ABuwVFPeT3YUnAAmSXM46PIHKieoGs79kx9IelFyQsM8xS0XWyt4S/haR7VaTJY+zHJjf0AnA1sr5ZIV70t3K0SXzq4+E1ffOZRiC0VmHatPz10wjaIpHxpjcROqQV4M1dBCq2H/rpccIE= - # bucket: bootstrap.urbit.org - # local-dir: release/ - # acl: public-read - # on: - # condition: "-d release/" - # repo: urbit/urbit - # all_branches: true +deploy: + - skip_cleanup: true + provider: gcs + access_key_id: GOOGTADOPP55X5ZTH3IKAXQW + secret_access_key: + secure: rSPif0VHX3Q3QpWM9iUt/Z9sicCY8ABuwVFPeT3YUnAAmSXM46PIHKieoGs79kx9IelFyQsM8xS0XWyt4S/haR7VaTJY+zHJjf0AnA1sr5ZIV70t3K0SXzq4+E1ffOZRiC0VmHatPz10wjaIpHxpjcROqQV4M1dBCq2H/rpccIE= + bucket: bootstrap.urbit.org + local-dir: release/ + acl: public-read + on: + condition: "-d release/" + repo: urbit/urbit + all_branches: true diff --git a/Makefile b/Makefile index 6efade6af..a9f2349a2 100644 --- a/Makefile +++ b/Makefile @@ -2,6 +2,11 @@ build: nix-build -A urbit -A herb --no-out-link + stack build king + +build-fast: + nix-build -A urbit -A herb --no-out-link + stack build king --fast build-all: nix-build --no-out-link diff --git a/sh/ci-tests b/sh/ci-tests index 3a5372653..805b3e92c 100755 --- a/sh/ci-tests +++ b/sh/ci-tests @@ -2,6 +2,8 @@ set -ex +stack test king --fast + if [ "$TRAVIS_PULL_REQUEST" = false ] then diff --git a/sh/release b/sh/release index 4f38b8569..cb04be22c 100755 --- a/sh/release +++ b/sh/release @@ -14,6 +14,13 @@ fi mkdir -p release +stack clean # Make sure we optimize +stack install king --local-bin-path ./release +mv release/king release/king-linux64-$ver + +# OSX +# otool -L ./release/king-darwin-$ver + for plat in linux64 darwin do sh/cross urbit "$plat" diff --git a/sh/test b/sh/test index c3b7f3708..f94e5d285 100755 --- a/sh/test +++ b/sh/test @@ -2,6 +2,8 @@ set -e +stack test king --fast + pkg=$(nix-build nix/ops -A test --no-out-link "$@") hdr () { diff --git a/sh/travis-install-stack b/sh/travis-install-stack new file mode 100755 index 000000000..95b32465d --- /dev/null +++ b/sh/travis-install-stack @@ -0,0 +1,24 @@ +#!/usr/bin/env bash + +set -ex + +mkdir -p ~/.local/bin + +# OSX +# travis_retry curl -L https://get.haskellstack.org/stable/osx-x86_64.tar.gz | tar xz --strip-components=1 --include '*/stack' -C ~/.local/bin + +mkdir -p tmp + +pax="https://get.haskellstack.org/stable/linux-x86_64.tar.gz" + +travis_retry curl -L $pax | tar xz -C tmp + +mv tmp/stack-*/stack ~/.local/bin + +# Use the more reliable S3 mirror of Hackage +mkdir -p ~/.cabal + +cat > ~/.cabal/config <