Skip to content

Commit

Permalink
update readme, cabal description and changelog
Browse files Browse the repository at this point in the history
  • Loading branch information
harendra-kumar committed Apr 5, 2018
1 parent 056265b commit 53545f1
Show file tree
Hide file tree
Showing 4 changed files with 45 additions and 49 deletions.
8 changes: 5 additions & 3 deletions Changelog.md
Original file line number Diff line number Diff line change
Expand Up @@ -3,11 +3,13 @@
### Enhancements
* Add cabal new-build support. Use `packcheck.sh cabal-new` to use it.
* Add knobs to disable tests or doc builds (`DISABLE_TEST`, `DISABLE_DOCS`)
* Now you can specify multiple versions of GHC in PATH and packcheck will
automatically find the right one based on GHCVER envvar.
* Now you can specify multiple versions of GHC in PATH and packcheck
automatically finds the right one based on GHCVER envvar.
* Add TOOLS_DIR option to specify hvr-ghc style installation of ghc and
cabal. A correct version of GHC is automatically picked from this directory.
* GHCVER and CABALVER variables are now optional in travis config if you
specify the cabal and ghc PPAs under apt sources.
* Run autoreconf if there is a configure.ac in the package dir
* Run `autoreconf` if there is a `configure.ac` in the package dir

### Deprecations
* TEST_INSTALL option is deprecated, use ENABLE_INSTALL instead
Expand Down
45 changes: 24 additions & 21 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -7,13 +7,13 @@

## TL; DR

* Just copy
* For CI, just copy
[.travis.yml](https://github.com/harendra-kumar/packcheck/blob/master/.travis.yml)
and
[appveyor.yml](https://github.com/harendra-kumar/packcheck/blob/master/appveyor.yml)
files to your package repo, add your repo to travis/appveyor and CI will just
work.
* Copy
* For local use, copy
[packcheck.sh](https://github.com/harendra-kumar/packcheck/blob/master/packcheck.sh)
to your local machine (Linux/OSX/Windows), put it in your PATH, and run it
from your package directory and watch all the CI tests being done locally.
Expand All @@ -23,11 +23,11 @@
$ packcheck.sh cabal-new
```
* If a CI build fails just copy and paste the command printed in the log and
the same build will run on the local machine so that you can debug quickly.
the same build runs on the local machine so that you can debug quickly.
* Want to send coverage info to coverall.io? Just uncomment a line in your
`.travis.yml`.
* If you are using `hvr-ghc` PPA, just say `TOOLS_DIR=/opt` or wherever it
is installed, and you can use all the ghc/cabal versions available,
* If you are using `hvr-ghc` PPA, just use `TOOLS_DIR=/opt` or the path where
it is installed, and you can use all the ghc/cabal versions available,
automatically.
* Conveniently control all aspects of build, including tool options or whether
to enable benchmarks, haddock, coverage, install test etc. It is a very
Expand Down Expand Up @@ -69,6 +69,8 @@ An invocation of packcheck performs a whole battery of tests:
* When using stack builds, stack and ghc are installed automatically, if needed
* for stack builds, if the package being tested does not have a `stack.yaml` it
is created automatically using `stack init`.
* Picks up the right version of GHC automatically if multiple versions are
available in the PATH or from hvr-ghc style ghc/cabal installation.
* build source
* build benchmarks
* build docs
Expand Down Expand Up @@ -110,22 +112,6 @@ cabal build:
$ ./packcheck.sh cabal GHCVER=8.0.2 COVERALLS_OPTIONS="test1 test2"
```

## Diagnostics

There may be issues due to some environment variables unknowingly set or some
command line parameters or env variables being misspelled and therefore
silently ignored. To avoid any such issues the robust way to invoke `packcheck`
is to use a clean environment using `env -i` and passing `CHECK_ENV=y`
parameter. When this parameter is set unwanted/misspelled variables are
detected and reported.

```
$ env -i CHECK_ENV=y ./packcheck.sh stack
```

For performance diagnostics `packcheck` prints the time elapsed from the
beginning at each build step performed.

## Full Reference

Options marked `DESTRUCTIVE!` are fine in a CI environment. But on a
Expand Down Expand Up @@ -233,3 +219,20 @@ Diagnostics options
--------------------------------------------------
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
```

## Diagnostics

There may be issues due to some environment variables unknowingly set or some
command line parameters or env variables being misspelled and therefore
silently ignored. To avoid any such issues the robust way to invoke `packcheck`
is to use a clean environment using `env -i` and passing `CHECK_ENV=y`
parameter. When this parameter is set unwanted/misspelled variables are
detected and reported.

```
$ env -i CHECK_ENV=y ./packcheck.sh stack
```

For performance diagnostics `packcheck` prints the time elapsed from the
beginning at each build step performed.
39 changes: 15 additions & 24 deletions packcheck.cabal
Original file line number Diff line number Diff line change
Expand Up @@ -2,34 +2,25 @@ name: packcheck
version: 0.2.0
synopsis: Universal build and CI testing for Haskell packages
description:
* Just copy @.travis.yml@ and @appveyor.yml@ to your package repo and your package is CI ready.
* Copy @packcheck.sh@ to your local machine and run it from your package directory (works on
Linux/OSX/Windows) to perform all the same tests that are done by CI, locally.
.
`packcheck` is a minimal yet complete "hello world" Haskell package with
`travis` and `appveyor` config files that can be used unmodified in any Haskell
package. The CI configs can be modified `declaratively` to adapt to `any`
kind of build scenario you can imagine.
.
The package includes @packcheck.sh@, a high level universal super build script
to uniformly, consistently build and comprehensively sanity test a Haskell
package across build tools (stack/cabal) and across all platforms
(Linux\/MacOS\/Windows). You do not need to be familiar with any of the build
tools to use it.
.
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,
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.
This package contains a universal CI/build script @packcheck.sh@ and config
files designed such that you can just copy over @.travis.yml@ and
@appveyor.yml@ to your package repo and your package is CI ready in a jiffy.
For local testing, copy @packcheck.sh@ to your local machine, put it in your
PATH, and run it from your package directory:
.
> $ packcheck.sh stack
> $ packcheck.sh cabal
> $ packcheck.sh cabal-new
.
You can try it on this package itself. @packcheck.sh@ uniformly, consistently
builds and comprehensively sanity tests a Haskell package across build tools
(stack/cabal) and across all platforms (Linux\/MacOS\/Windows). You do not
need to be familiar with any of the build tools to use it.
.
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, benchmarks, tests, CI configs etc.
This is also a minimal yet complete model package (with tests, benchmarks, 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, 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-11.0
resolver: lts-11.3
packages:
- '.'

0 comments on commit 53545f1

Please sign in to comment.