Skip to content

Commit

Permalink
CI for frontend (#152)
Browse files Browse the repository at this point in the history
* Build frontend on CI

* make ci/build.sh executable
  • Loading branch information
hdgarrood authored Apr 25, 2020
1 parent 4341a0d commit 4a9c84d
Show file tree
Hide file tree
Showing 2 changed files with 27 additions and 4 deletions.
9 changes: 5 additions & 4 deletions .travis.yml
Original file line number Diff line number Diff line change
Expand Up @@ -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
Expand Down
22 changes: 22 additions & 0 deletions ci/build.sh
Original file line number Diff line number Diff line change
@@ -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

0 comments on commit 4a9c84d

Please sign in to comment.