From 41ec90c3fe1128ec07b4e96647609bc4e552cb28 Mon Sep 17 00:00:00 2001 From: odanoburu Date: Wed, 31 Oct 2018 09:03:42 -0300 Subject: [PATCH] (travis) refactor travis CI - add ubuntu, mac, and windows builds add travis build with mac and ubuntu - fix signature in Make.hs for compatibility with ghc<8 add windows build to travis using haskell and bash scripts (travis) use env variable Make.bat works (Make.bar) [temporary] comment some Langs merge upstream and uncomment langs --- .travis.yml | 25 ++++++++++++++++++------- Make.hs | 2 +- 2 files changed, 19 insertions(+), 8 deletions(-) diff --git a/.travis.yml b/.travis.yml index 7f2c3d43..1e4a560b 100644 --- a/.travis.yml +++ b/.travis.yml @@ -1,14 +1,25 @@ sudo: required - language: c -services: - - docker +os: + - linux + - osx + - windows + +addons: + apt: + packages: + - ghc before_install: - - docker pull odanoburu/haskell-gf:3.9 - - mkdir rgl + - if [[ "$TRAVIS_OS_NAME" == "osx" ]]; then brew update && brew install ghc@8.2 && export PATH="/usr/local/opt/ghc@8.2/bin:$PATH" ; fi + - if [[ "$TRAVIS_OS_NAME" == "osx" ]]; then curl http://www.grammaticalframework.org/download/gf-3.9-bin-intel-mac.tar.gz > gf.tar.gz && sudo tar --no-same-owner --no-same-permissions -C /usr/local -zxf gf.tar.gz && rm gf.tar.gz; fi + - if [[ "$TRAVIS_OS_NAME" == "linux" ]]; then curl http://www.grammaticalframework.org/download/gf_3.9.1-1_amd64-trusty.deb > gf.deb && sudo dpkg -i gf.deb && rm gf.deb ; fi + - if [[ "$TRAVIS_OS_NAME" == "windows" ]]; then choco install ghc --version=8.4.4 && export PATH="/c/ProgramData/chocolatey/lib/ghc/tools/ghc-8.4.4/bin:$PATH"; fi + - if [[ "$TRAVIS_OS_NAME" == "windows" ]]; then curl http://www.grammaticalframework.org/download/gf-3.9-bin-windows.zip > gf.zip && unzip gf.zip && rm gf.zip && export PATH="$TRAVIS_BUILD_DIR/gf-3.9/bin:$PATH"; fi + - if [[ "$TRAVIS_OS_NAME" == "windows" ]]; then alias gf='gf.exe' && alias runghc='runghc.exe' ; fi script: - - docker run --mount src="$(pwd)",target=/home,type=bind odanoburu/haskell-gf:3.9 /bin/bash -c "cd /home/; export GF_LIB_PATH=/home/rgl ; runghc Make.hs build prelude all --verbose ;" - - docker run --mount src="$(pwd)",target=/home,type=bind odanoburu/haskell-gf:3.9 /bin/bash -c "cd /home/; export GF_LIB_PATH=/home/rgl; bash Make.sh --dest=rgl --verbose ;" + - runghc Make.hs build prelude all --verbose ; rm -rf dist + - bash Make.sh --dest=dist-bash --verbose ; rm -rf dist + - if [[ "$TRAVIS_OS_NAME" == "windows" ]]; then cmd //c Make.bat --dest=dist-bat --verbose ; fi diff --git a/Make.hs b/Make.hs index 2a40e398..434040bd 100644 --- a/Make.hs +++ b/Make.hs @@ -444,7 +444,7 @@ execute command args = do -- | For parallel RGL module compilation -- Unfortunately, this has no effect unless compiled with -threaded -parallel_ :: (Foldable t, Monad m) => t (m a) -> m () +--parallel_ :: (Foldable t, Monad m) => t (m a) -> m () parallel_ ms = sequence_ ms -- do c <- newChan -- ts <- sequence [ forkIO (m >> writeChan c ()) | m <- ms]