Skip to content

Commit

Permalink
Add sanity checks for wrappers to CI
Browse files Browse the repository at this point in the history
  • Loading branch information
fendor committed Jun 14, 2020
1 parent c252cd7 commit e07b9ae
Show file tree
Hide file tree
Showing 4 changed files with 14 additions and 5 deletions.
8 changes: 5 additions & 3 deletions .travis.yml
Original file line number Diff line number Diff line change
Expand Up @@ -6,6 +6,7 @@
#
# version: 0.3
#
# Additional changes included a shellcheck step
language: c
dist: xenial

Expand Down Expand Up @@ -86,6 +87,10 @@ install:
# Here starts the actual work to be performed for the package under test;
# any command which exits with a non-zero exit code causes the build to fail.
script:
# Sanity checks for wrapper scripts
- shellcheck wrappers/cabal
- (cd wrappers && ${HC} -hide-all-packages -package base -package directory -package process -Wall -Werror cabal.hs -o CabalWrapper)

# test that source-distributions can be generated
- ${CABAL} new-sdist all
- mv dist-newstyle/sdist/*.tar.gz ${DISTDIR}/
Expand Down Expand Up @@ -114,6 +119,3 @@ script:

# Build without installed constraints for packages in global-db
- rm -f cabal.project.local; ${CABAL} new-build -w ${HC} --disable-tests --disable-benchmarks all

# REGENDATA ["hie-bios.cabal"]
# EOF
6 changes: 6 additions & 0 deletions appveyor.yml
Original file line number Diff line number Diff line change
Expand Up @@ -10,8 +10,10 @@ install:
- choco install -y haskell-stack
- choco install -y cabal
- choco install ghc --version %GHCVER%
- choco install -y shellcheck
- refreshenv
- "set PATH=C:\\ProgramData\\chocolatey\\lib\\ghc\\tools\\ghc-%GHCVER%\\bin;C:\\msys64\\mingw64\\bin;C:\\msys64\\usr\\bin;%PATH%"
- shellcheck --version
- stack --version
- cabal --version
- ghc --version
Expand All @@ -30,6 +32,10 @@ build_script:

before_test:
- cabal v2-build --enable-tests -w ghc-%GHCVER%.exe tests
# sanity check the wrappers
- shellcheck wrappers/cabal
- ghc -hide-all-packages -package base -package directory -package process -Wall -Werror wrappers/cabal.hs -o CabalWrapper -odir %TMP%


test_script:
- cabal v2-test -w ghc-%GHCVER%.exe
2 changes: 1 addition & 1 deletion wrappers/cabal
Original file line number Diff line number Diff line change
@@ -1,7 +1,7 @@
#!/usr/bin/env bash

function out(){
echo "$1" >> $HIE_BIOS_OUTPUT
echo "$1" >> "$HIE_BIOS_OUTPUT"
}

if [ "$1" == "--interactive" ]; then
Expand Down
3 changes: 2 additions & 1 deletion wrappers/cabal.hs
Original file line number Diff line number Diff line change
@@ -1,11 +1,12 @@
module Main (main) where

import System.Directory (getCurrentDirectory)
import System.Environment (getArgs, getEnv, lookupEnv)
import System.Environment (getArgs, getEnv)
import System.Exit (exitWith)
import System.Process (spawnProcess, waitForProcess)
import System.IO (openFile, hClose, hPutStrLn, IOMode(..))

main :: IO ()
main = do
args <- getArgs
output_file <- getEnv "HIE_BIOS_OUTPUT"
Expand Down

0 comments on commit e07b9ae

Please sign in to comment.