Skip to content

Commit

Permalink
Update packcheck commit-id, readme, stack resolver
Browse files Browse the repository at this point in the history
Also, reduce number of builds in default configs
  • Loading branch information
harendra-kumar committed Mar 15, 2018
1 parent 3be460b commit adbd153
Show file tree
Hide file tree
Showing 6 changed files with 56 additions and 36 deletions.
55 changes: 33 additions & 22 deletions .travis.yml
Original file line number Diff line number Diff line change
Expand Up @@ -6,13 +6,19 @@ env:
# Global options used for all CI tests
# ------------------------------------------------------------------------
- GHC_OPTIONS="-Werror"

# ------------------------------------------------------------------------
# Options for builds that need stack
# Options for builds that need stack (note, cabal builds can use stack)
# ------------------------------------------------------------------------
# Note requiring a specific version of stack using STACKVER may fail due to
# github API limit while checking and upgrading/downgrading to the specific
# version.
#- STACKVER="1.6.5"
- STACK_UPGRADE="y"

# ------------------------------------------------------------------------
# Other options: Normally you would not need to customize these
# Note - these are used by both stack and cabal builds
# ------------------------------------------------------------------------
- CABAL_REINIT_CONFIG=y
- CABAL_CHECK_RELAX=y
Expand All @@ -21,6 +27,7 @@ env:
- TEST_INSTALL=y
- PATH=/bin:/usr/bin
- LC_ALL=C.UTF-8

# ------------------------------------------------------------------------
# Location of packcheck.sh (the shell script invoked to perform CI tests ).
# ------------------------------------------------------------------------
Expand All @@ -32,15 +39,15 @@ env:
# If you have not committed packcheck.sh in your repo at PACKCHECK_LOCAL_PATH
# then it is automatically pulled from this URL.
- PACKCHECK_GITHUB_URL="https://raw.githubusercontent.com/harendra-kumar/packcheck"
- PACKCHECK_GITHUB_COMMIT="da9d6da3d18d6250c06617817f0879324c75c224"
- PACKCHECK_GITHUB_COMMIT="3be460b9c8d4cf53eeacf1ac319c97420f6345cc"

notifications:
email: false

# This matrix has total 11 builds enabled, 4 builds each (3 last major compiler
# versions and head) for stack and cabal, 2 OSX builds (stack and cabal for
# latest compiler version), and one hlint build. You may want to comment out
# some of the builds to be lighter on the CI infrastructure.
# This matrix has total of 6 builds enabled, we try to cover last three major
# GHC versions, stack, cabal, Linux and OSX with minimum number of builds
# possible. You can uncomment other disabled builds or comment out existing
# ones to your taste.
#
# We pre-install the cabal-install package to not incur the penalty of building
# it the first time in cached builds or every time in uncached builds.
Expand All @@ -51,13 +58,13 @@ matrix:
# (Linux) stack builds
# --------------------------------------------------------------------------

- env: BUILD=stack CABALVER=1.22 GHCVER=7.10.3 RESOLVER=lts-6
addons: {apt: {packages: [cabal-install-1.22,ghc-7.10.3], sources: [hvr-ghc]}}
#- env: BUILD=stack CABALVER=1.22 GHCVER=7.10.3 RESOLVER=lts-6
# addons: {apt: {packages: [cabal-install-1.22,ghc-7.10.3], sources: [hvr-ghc]}}

- env: BUILD=stack CABALVER=1.24 GHCVER=8.0.2 RESOLVER=lts-9
addons: {apt: {packages: [cabal-install-1.24,ghc-8.0.2], sources: [hvr-ghc]}}

- env: BUILD=stack CABALVER=2.0 GHCVER=8.2.2 RESOLVER=lts-10
- env: BUILD=stack CABALVER=2.0 GHCVER=8.2.2 RESOLVER=lts-11
addons: {apt: {packages: [cabal-install-2.0,ghc-8.2.2], sources: [hvr-ghc]}}

# Nightly
Expand All @@ -68,20 +75,24 @@ matrix:

# You can customize a stack build even without a custom stack-yaml
# using STACK_OPTIONS, STACK_BUILD_OPTIONS, GHC_OPTIONS etc.
#- env: BUILD=stack RESOLVER=lts-10.0 STACK_BUILD_OPTIONS="--flag packcheck:dev"
#- env: BUILD=stack RESOLVER=lts-11 STACK_BUILD_OPTIONS="--flag packcheck:dev"

# --------------------------------------------------------------------------
# (Linux) cabal builds require pre-installed cabal-install and ghc
# (Linux) cabal builds
# --------------------------------------------------------------------------

- env: BUILD=cabal CABALVER=1.22 GHCVER=7.10.3
addons: {apt: {packages: [cabal-install-1.22,ghc-7.10.3], sources: [hvr-ghc]}}
#- env: BUILD=cabal CABALVER=1.22 GHCVER=7.10.3
# addons: {apt: {packages: [cabal-install-1.22,ghc-7.10.3], sources: [hvr-ghc]}}

- env: BUILD=cabal CABALVER=1.24 GHCVER=8.0.2
addons: {apt: {packages: [cabal-install-1.24,ghc-8.0.2], sources: [hvr-ghc]}}
#- env: BUILD=cabal CABALVER=1.24 GHCVER=8.0.2
# addons: {apt: {packages: [cabal-install-1.24,ghc-8.0.2], sources: [hvr-ghc]}}

- env: BUILD=cabal CABALVER=2.0 GHCVER=8.2.2
addons: {apt: {packages: [cabal-install-2.0,ghc-8.2.2], sources: [hvr-ghc]}}
# Consider that we do an 8.2.2 cabal build for OSX, see below
#- env: BUILD=cabal CABALVER=2.0 GHCVER=8.2.2
# addons: {apt: {packages: [cabal-install-2.0,ghc-8.2.2], sources: [hvr-ghc]}}

- env: BUILD=cabal CABALVER=2.2 GHCVER=8.4.1
addons: {apt: {packages: [cabal-install-2.2,ghc-8.4.1], sources: [hvr-ghc]}}

- env: BUILD=cabal CABALVER=head GHCVER=head
addons: {apt: {packages: [cabal-install-head,ghc-head], sources: [hvr-ghc]}}
Expand All @@ -91,18 +102,18 @@ matrix:
# --------------------------------------------------------------------------

# GHC 8.2.2/cabal build via stack
- env: BUILD=cabal RESOLVER=lts-10
- env: BUILD=cabal RESOLVER=lts-11
os: osx

# GHC 8.2.2/stack
- env: BUILD=stack RESOLVER=lts-10
os: osx
#- env: BUILD=stack RESOLVER=lts-11
# os: osx

# --------------------------------------------------------------------------
# Lint
# --------------------------------------------------------------------------

- env: BUILD=stack RESOLVER=lts-10 HLINT_COMMANDS="hlint lint ."
#- env: BUILD=stack RESOLVER=lts-11 HLINT_COMMANDS="hlint lint ."

# --------------------------------------------------------------------------
# Build and send coverage report to coveralls.io using hpc-coveralls
Expand All @@ -120,7 +131,7 @@ matrix:
allow_failures:
- env: BUILD=stack RESOLVER=nightly
- env: BUILD=cabal CABALVER=head GHCVER=head
- env: BUILD=stack RESOLVER=lts-10 HLINT_COMMANDS="hlint lint ."
- env: BUILD=stack RESOLVER=lts-11 HLINT_COMMANDS="hlint lint ."

# ------------------------------------------------------------------------
# Settings beyond this point are advanced and normally not tweaked
Expand Down
3 changes: 2 additions & 1 deletion Changelog.md
Original file line number Diff line number Diff line change
@@ -1,13 +1,14 @@
## 0.1.2

### Breaking Changes
* STACK_BUILD_OPTIONS and CABAL_CONFIGURE_OPTIONS now append to the existing
* Make STACK_BUILD_OPTIONS and CABAL_CONFIGURE_OPTIONS append to the existing
options instead of overriding them.
* Do not enforce specific stack version in CI configs - to avoid failures due
to github API limits when upgrading or downgrading.

### Enhancements
* Better documentation in travis and appveyor configs
* Reduce the number of builds in default config from 11 to 6

## 0.1.1

Expand Down
16 changes: 9 additions & 7 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -162,7 +162,8 @@ For pure cabal builds i.e. when `BUILD=cabal` and `RESOLVER` is not specified,
`cabal` and `ghc` must be pre-installed on the system before building.

```
cueball $ packcheck.sh --help
$ packcheck.sh --help
--------------------------------------------------
Usage
--------------------------------------------------
Expand Down Expand Up @@ -193,7 +194,7 @@ CABALVER : [a.b.c.d] Cabal version (prefix) to use
STACKVER : [a.b.c.d] Stack version (prefix) to use
GHC_OPTIONS : Specify GHC options to use
SDIST_OPTIONS : Arguments to stack/cabal sdist command (e.g. --pvp-bounds)
DISABLE_SDIST_BUILD : Do not build from source distribution
DISABLE_SDIST_BUILD : [y] Do not build from source distribution
DISABLE_BENCH : [y] Do not build benchmarks, default is to build but not run
PATH : [path] Set PATH explicitly for predictable builds
TEST_INSTALL : [y] DESTRUCTIVE! Install the package after building (force install with cabal)
Expand All @@ -202,15 +203,15 @@ TEST_INSTALL : [y] DESTRUCTIVE! Install the package after building (f
Advanced stack build parameters or env variables
--------------------------------------------------
STACK_YAML : Alternative stack config, cannot be a path, just the file name
STACK_OPTIONS : Provide additional stack global options (e.g. -v)
STACK_BUILD_OPTIONS : Override the default stack build command options
STACK_UPGRADE : DESTRUCTIVE! Upgrades stack to latest version
STACK_OPTIONS : ADDITIONAL stack global options (e.g. -v) to append
STACK_BUILD_OPTIONS : ADDITIONAL stack build command options to append
STACK_UPGRADE : [y] DESTRUCTIVE! Upgrades stack to latest version
--------------------------------------------------
Advanced cabal build parameters or env variables
--------------------------------------------------
CABAL_USE_STACK_SDIST : [y] Use stack sdist (to use --pvp-bounds)
CABAL_CONFIGURE_OPTIONS : Override the default cabal configure options
CABAL_CONFIGURE_OPTIONS : ADDITIONAL default cabal configure options to append
CABAL_CHECK_RELAX : [y] Do not fail if cabal check fails on the package.
CABAL_NO_SANDBOX : [y] DESTRUCTIVE! Clobber (force install) global cabal ghc package db
CABAL_HACKAGE_MIRROR : [y] DESTRUCTIVE! Specify an alternative mirror, will modify the cabal user config file.
Expand All @@ -230,4 +231,5 @@ HLINT_COMMANDS : hlint commands e.g.'hlint lint src; hlint lint test'
--------------------------------------------------
Diagnostics parameters or env variables
--------------------------------------------------
CHECK_ENV : Treat unknown env variables as error, used with env -i
CHECK_ENV : [y] Treat unknown env variables as error, used with env -i
BASE_TIME : System time to be used as base for timeline reporting
12 changes: 9 additions & 3 deletions appveyor.yml
Original file line number Diff line number Diff line change
Expand Up @@ -6,12 +6,17 @@ environment:
# Global options used for all CI tests
# ------------------------------------------------------------------------
GHC_OPTIONS: "-Werror"

# ------------------------------------------------------------------------
# Options for builds that need stack
# Options for builds that need stack (note, cabal builds can use stack)
# ------------------------------------------------------------------------
# Note requiring a specific version of stack using STACKVER may fail due to
# github API limit while checking and upgrading/downgrading to the specific
# version.
#STACKVER: "1.6.5"
STACK_UPGRADE: "y"
RESOLVER: "lts-10.0"
RESOLVER: "lts-11.0"

# ------------------------------------------------------------------------
# Normally you would not need to customize these params
# ------------------------------------------------------------------------
Expand All @@ -24,6 +29,7 @@ environment:
PATH: "%PATH%;%APPDATA%\\local\\bin"
STACK_ROOT: "c:\\sr"
LOCAL_BIN: "%APPDATA%\\local\\bin"

# ------------------------------------------------------------------------
# Location of packcheck.sh (the shell script invoked to perform CI tests ).
# ------------------------------------------------------------------------
Expand All @@ -35,7 +41,7 @@ environment:
# If you have not committed packcheck.sh in your repo at PACKCHECK_LOCAL_PATH
# then it is automatically pulled from this URL.
PACKCHECK_GITHUB_URL: "https://raw.githubusercontent.com/harendra-kumar/packcheck"
PACKCHECK_GITHUB_COMMIT: "da9d6da3d18d6250c06617817f0879324c75c224"
PACKCHECK_GITHUB_COMMIT: "3be460b9c8d4cf53eeacf1ac319c97420f6345cc"

cache:
- "%STACK_ROOT%"
Expand Down
4 changes: 2 additions & 2 deletions packcheck.cabal
Original file line number Diff line number Diff line change
Expand Up @@ -15,7 +15,7 @@ description:
.
To use it for CI, simply copy the @.travis.yml@, @appveyor.yml@ config files from this
package to your package and that's it. It should work without modification,
of course you can edit them to customize. For use on local host, just copy
and of course you can customize the configs. For use on local host, just copy
over the @packcheck.sh@ script and put it in your `PATH`. Run the script from
the package directory of the package you want to build.
.
Expand All @@ -25,7 +25,7 @@ description:
This is also a minimal yet complete model package (with tests, benchmarks,
Linux\/MacOS\/Windows CI already working) that can be used as a starting point to
develop a new package. Beginners can use it to learn about haskell package
metadata structure.
metadata structure, benchmarks, tests, CI configs etc.
.
See the README for comprehensive documentation.

Expand Down
2 changes: 1 addition & 1 deletion stack.yaml
Original file line number Diff line number Diff line change
@@ -1,3 +1,3 @@
resolver: lts-10.3
resolver: lts-11.0
packages:
- '.'

0 comments on commit adbd153

Please sign in to comment.