-
Notifications
You must be signed in to change notification settings - Fork 563
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Browse files
Browse the repository at this point in the history
* Switch to stack for CI, resolves #1974 * Remove the stack-nightly.yaml, since it always needs updating. Instead, we pass --resolver=nightly in one of the build jobs to ensure we always have the latest nightly. As an added bonus we no longer have to set the STACK_YAML environment variable on Windows, because stack.yaml is no longer a symlink. * Remove use of cabal-install, which drastically simplifies the CI scripts :) * Use the 'compiler' key in the build matrix as a hack to ensure each build job gets a separate cache. * Add OSX tests. * Add haddock tests, on a separate build job (for speed). * Use separate build jobs for sdist tests (for speed). * Fix binary bundle uploading on Travis * Add binary bundle uploading for OSX. * Update appveyor CI * No longer need to set STACK_YAML on AppVeyor * We should not attempt to run 'strip' on Windows executables * Fix path to bundle creation script
- Loading branch information
Showing
12 changed files
with
151 additions
and
130 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,73 +1,80 @@ | ||
language: c | ||
dist: trusty | ||
dist: trusty # because of perf issues | ||
sudo: required | ||
matrix: | ||
include: | ||
- env: GHCVER=7.10.3 CABALVER=1.22 STACKAGE=lts-5.4 RUNSDISTTESTS=YES | ||
compiler: ": #GHC 7.10.3 lts-5.4" | ||
addons: {apt: {packages: [cabal-install-1.22,ghc-7.10.3,happy-1.19.5,alex-3.1.4], sources: [hvr-ghc]}} | ||
- env: GHCVER=7.10.3 CABALVER=1.22 STACKAGE=nightly-2016-02-25 | ||
compiler: ": #GHC 7.10.3 nightly-2016-02-25" | ||
addons: {apt: {packages: [cabal-install-1.22,ghc-7.10.3,happy-1.19.5,alex-3.1.4], sources: [hvr-ghc]}} | ||
- env: GHCVER=7.10.3 CABALVER=1.22 DEPLOY=yes | ||
compiler: ": #GHC 7.10.3" | ||
addons: {apt: {packages: [cabal-install-1.22,ghc-7.10.3,happy-1.19.5,alex-3.1.4], sources: [hvr-ghc]}} | ||
before_install: | ||
- unset CC | ||
- export PATH="/opt/ghc/$GHCVER/bin:$PATH" | ||
- export PATH="/opt/cabal/$CABALVER/bin:$PATH" | ||
- export PATH="$HOME/.cabal/bin:$PATH" | ||
- export PATH="/opt/happy/1.19.5/bin:/$PATH" | ||
- export PATH="/opt/alex/3.1.4/bin:/$PATH" | ||
- export PATH="$HOME/build/purescript/purescript/dist/build/psc:/$PATH" | ||
- export PATH="$HOME/build/purescript/purescript/dist/build/psc-ide-server:/$PATH" | ||
- export PATH="$HOME/build/purescript/purescript/dist/build/psc-ide-client:/$PATH" | ||
# The 'compiler' key is a hack to get Travis to use different caches for | ||
# each job in a build, in order to avoid the separate jobs stomping on each | ||
# other's caches. See https://github.com/travis-ci/travis-ci/issues/4393 | ||
# | ||
# We use trusty boxes because they seem to be a bit faster. | ||
- compiler: cc-linux-lts-normal | ||
os: linux | ||
dist: trusty | ||
sudo: required | ||
env: BUILD_TYPE=normal COVERAGE=true DEPLOY=true | ||
|
||
- compiler: cc-linux-nightly-normal | ||
os: linux | ||
dist: trusty | ||
sudo: required | ||
env: BUILD_TYPE=normal STACKAGE_NIGHTLY=true | ||
allow_failures: true | ||
|
||
- compiler: cc-linux-lts-sdist | ||
os: linux | ||
dist: trusty | ||
sudo: required | ||
env: BUILD_TYPE=sdist | ||
|
||
- compiler: cc-linux-lts-haddock | ||
os: linux | ||
dist: trusty | ||
sudo: required | ||
env: BUILD_TYPE=haddock | ||
|
||
- compiler: cc-osx-lts-normal | ||
os: osx | ||
env: BUILD_TYPE=normal DEPLOY=true | ||
|
||
- compiler: cc-osx-lts-sdist | ||
os: osx | ||
env: BUILD_TYPE=sdist | ||
addons: | ||
apt: | ||
packages: | ||
- libgmp-dev | ||
cache: | ||
directories: | ||
- $HOME/.local/bin | ||
- $HOME/.stack | ||
install: | ||
- cabal --version | ||
- echo "$(ghc --version) [$(ghc --print-project-git-commit-id 2> /dev/null || echo '?')]" | ||
- travis_retry cabal update | ||
# Run sequentially | ||
# Travis container infrastructure seems to expose all host CPUs (16?), thus | ||
# cabal and ghc tries to use them all. Which is bad idea on a shared box. | ||
# See also: https://ghc.haskell.org/trac/ghc/ticket/9221 | ||
- sed -i 's/^jobs:/-- jobs:/' ${HOME}/.cabal/config | ||
# Cache sandboxes in ~/cabal-sandboxes | ||
# Move right sandbox to .cabal-sandbox if exists | ||
- if [ -d ~/cabal-sandboxes/$GHCVER-${STACKAGE:-none} ]; then | ||
mv ~/cabal-sandboxes/$GHCVER-${STACKAGE:-none} .cabal-sandbox; | ||
fi | ||
- mkdir -p .cabal-sandbox | ||
- cabal sandbox init --sandbox .cabal-sandbox | ||
# Download stackage cabal.config. Filter this package and 'extra deps' | ||
- if [ -n "$STACKAGE" ]; then curl https://www.stackage.org/$STACKAGE/cabal.config | egrep -v 'purescript|language-javascript|bower-json' > cabal.config; fi | ||
- cabal install --only-dependencies --enable-tests | ||
- cabal install hpc-coveralls | ||
# Snapshot state of the sandbox now, so we don't need to make new one for test install | ||
- rm -rf ~/cabal-sandboxes/$GHCVER-${STACKAGE:-none} | ||
- cp -r .cabal-sandbox ~/cabal-sandboxes/$GHCVER-${STACKAGE:-none} | ||
# Install bower globally (for psc-docs/psc-publish tests) | ||
- npm install -g bower | ||
- | # Install stack. | ||
if test ! -f "$HOME/.local/bin/stack" | ||
then | ||
URL="https://www.stackage.org/stack/$TRAVIS_OS_NAME-x86_64" | ||
curl --location "$URL" > stack.tar.gz | ||
gunzip stack.tar.gz | ||
tar -x -f stack.tar --strip-components 1 | ||
mkdir -p "$HOME/.local/bin" | ||
mv stack "$HOME/.local/bin/" | ||
fi | ||
- npm install -g bower # for psc-docs / psc-publish tests | ||
# Fix the CC environment variable, because Travis changes it | ||
- export CC=gcc | ||
- export OS_NAME=$(./travis/convert-os-name.sh) | ||
script: | ||
- ./travis/configure.sh | ||
- cabal build --ghc-options="-Werror" | ||
- cabal test | ||
- ./travis/test-install.sh | ||
after_script: | ||
- ./travis/after.sh | ||
notifications: | ||
email: true | ||
before_deploy: "./bundle/build.sh linux64" | ||
- travis/build.sh | ||
before_deploy: | ||
- ./bundle/build.sh $OS_NAME | ||
deploy: | ||
provider: releases | ||
api_key: $RELEASE_KEY | ||
file: | ||
- bundle/linux64.tar.gz | ||
- bundle/linux64.sha | ||
- bundle/$OS_NAME.tar.gz | ||
- bundle/$OS_NAME.sha | ||
skip_cleanup: true | ||
on: | ||
all_branches: true | ||
tags: true | ||
condition: "$DEPLOY = yes" | ||
cache: | ||
directories: | ||
- ~/cabal-sandboxes | ||
condition: "$DEPLOY = true" |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file was deleted.
Oops, something went wrong.
This file was deleted.
Oops, something went wrong.
This file was deleted.
Oops, something went wrong.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,7 @@ | ||
resolver: lts-5.4 | ||
packages: | ||
- '.' | ||
extra-deps: | ||
- bower-json-0.8.0 | ||
- language-javascript-0.6.0.4 | ||
flags: {} |
This file was deleted.
Oops, something went wrong.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,59 @@ | ||
#!/bin/bash | ||
set -e | ||
|
||
STACK="stack --no-terminal --jobs=1" | ||
$STACK setup | ||
|
||
# Set up configuration | ||
STACK_EXTRA_FLAGS="" | ||
if [ -z "$TRAVIS_TAG" ] | ||
then | ||
# On non-release builds, disable optimizations. | ||
STACK_EXTRA_FLAGS="--fast" | ||
fi | ||
|
||
if [ "$STACKAGE_NIGHTLY" = "true" ] | ||
then | ||
STACK_EXTRA_FLAGS="$STACK_EXTRA_FLAGS --resolver=nightly" | ||
fi | ||
|
||
if [ "$COVERAGE" = "true" ] | ||
then | ||
STACK_EXTRA_FLAGS="$STACK_EXTRA_FLAGS --coverage" | ||
fi | ||
|
||
echo "STACK_EXTRA_FLAGS=\"$STACK_EXTRA_FLAGS\"" | ||
BUILD_COMMAND="$STACK build --pedantic --test $STACK_EXTRA_FLAGS" | ||
|
||
if [ "$BUILD_TYPE" = "normal" ] | ||
then | ||
echo ">>> Building & testing..." | ||
echo "> $BUILD_COMMAND" | ||
$BUILD_COMMAND | ||
|
||
elif [ "$BUILD_TYPE" = "sdist" ] | ||
then | ||
echo ">>> Testing the source distribution..." | ||
$STACK sdist | ||
mkdir sdist-test | ||
tar -xzf $(stack path --dist-dir)/purescript-*.tar.gz -C sdist-test --strip-components=1 | ||
pushd sdist-test | ||
echo "> $BUILD_COMMAND" | ||
$BUILD_COMMAND | ||
popd | ||
|
||
elif [ "$BUILD_TYPE" = "haddock" ] | ||
then | ||
echo ">>> Checking haddock documentation..." | ||
$STACK haddock | ||
else | ||
echo "Unrecognised BUILD_TYPE: $BUILD_TYPE" | ||
exit 1 | ||
fi | ||
|
||
if [ "$COVERAGE" = "true" ] | ||
then | ||
echo ">>> Uploading test coverage report..." | ||
which shc || $STACK install stack-hpc-coveralls | ||
shc purescript tests || echo "Failed to upload coverage" | ||
fi |
This file was deleted.
Oops, something went wrong.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,14 @@ | ||
#!/bin/bash | ||
# This script converts the Travis OS name into the format used for PureScript | ||
# binary bundles. | ||
set -e | ||
|
||
case "$TRAVIS_OS_NAME" in | ||
"linux") | ||
echo linux64;; | ||
"osx") | ||
echo macos;; | ||
*) | ||
echo "Unknown TRAVIS_OS_NAME: $TRAVIS_OS_NAME"; | ||
exit 1;; | ||
esac |
This file was deleted.
Oops, something went wrong.