From bcbc7674fc1e5c368e25c05f8065cff42edba735 Mon Sep 17 00:00:00 2001 From: Harry Garrood Date: Sat, 25 Apr 2020 20:04:12 +0100 Subject: [PATCH 1/2] Build frontend on CI --- .travis.yml | 9 +++++---- ci/build.sh | 22 ++++++++++++++++++++++ 2 files changed, 27 insertions(+), 4 deletions(-) create mode 100644 ci/build.sh diff --git a/.travis.yml b/.travis.yml index 7336dd02..f6039a30 100644 --- a/.travis.yml +++ b/.travis.yml @@ -14,16 +14,17 @@ addons: packages: - libgmp-dev +env: + - COMPONENT=client + - COMPONENT=server + before_install: - mkdir -p ~/.local/bin - export PATH=$HOME/.local/bin:$PATH - curl -L https://www.stackage.org/stack/linux-x86_64 | tar xz --wildcards --strip-components=1 -C ~/.local/bin '*/stack' script: - # Set a timeout of 35 minutes. We could use travis_wait here, but travis_wait - # doesn't produce any output until the command finishes, and also doesn't - # always show all of the command's output. - - timeout 35m stack --no-terminal -j1 --install-ghc build + ./ci/build.sh notifications: email: true diff --git a/ci/build.sh b/ci/build.sh new file mode 100644 index 00000000..d03185a0 --- /dev/null +++ b/ci/build.sh @@ -0,0 +1,22 @@ +#! /usr/bin/env bash + +set -ex + +case $COMPONENT in + server) + # Set a timeout of 35 minutes. We could use travis_wait here, but travis_wait + # doesn't produce any output until the command finishes, and also doesn't + # always show all of the command's output. + timeout 35m stack --no-terminal -j1 --install-ghc build + ;; + client) + cd client + npm install + npm run build + npm run bundle + ;; + *) + echo >&2 "Unrecognised component: $COMPONENT" + exit 1 + ;; +esac From 8b9e41e32d48df89d861a67ad1b8827c8e6acda2 Mon Sep 17 00:00:00 2001 From: Harry Garrood Date: Sat, 25 Apr 2020 20:10:17 +0100 Subject: [PATCH 2/2] make ci/build.sh executable --- ci/build.sh | 0 1 file changed, 0 insertions(+), 0 deletions(-) mode change 100644 => 100755 ci/build.sh diff --git a/ci/build.sh b/ci/build.sh old mode 100644 new mode 100755