Browse Source

Test against GHC 8.4.1

master
Peter J. Jones 1 year ago
parent
commit
5e94810f24
Signed by: Peter Jones <pjones@devalot.com> GPG Key ID: 9DAFAA8D01941E49
8 changed files with 129 additions and 29 deletions
  1. 0
    4
      .gitignore
  2. 0
    3
      .gitmodules
  3. 105
    0
      .travis.yml
  4. 1
    1
      LICENSE
  5. 20
    0
      default.nix
  6. 3
    3
      playlists.cabal
  7. 0
    14
      stack.nix
  8. 0
    4
      stack.yaml

+ 0
- 4
.gitignore View File

@@ -1,6 +1,2 @@
1 1
 /.stack-work
2
-/build/.stack-work
3
-/cabal.project.local
4
-/default.nix
5
-/dist-newstyle/
6 2
 /dist

+ 0
- 3
.gitmodules View File

@@ -1,3 +0,0 @@
1
-[submodule "util"]
2
-	path = util
3
-	url = git://pmade.com/haskell-util

+ 105
- 0
.travis.yml View File

@@ -0,0 +1,105 @@
1
+# This Travis job script has been generated by a script via
2
+#
3
+#   runghc make_travis_yml_2.hs 'playlists.cabal'
4
+#
5
+# For more information, see https://github.com/hvr/multi-ghc-travis
6
+#
7
+language: c
8
+sudo: false
9
+
10
+git:
11
+  submodules: false  # whether to recursively clone submodules
12
+
13
+cache:
14
+  directories:
15
+    - $HOME/.cabal/packages
16
+    - $HOME/.cabal/store
17
+
18
+before_cache:
19
+  - rm -fv $HOME/.cabal/packages/hackage.haskell.org/build-reports.log
20
+  # remove files that are regenerated by 'cabal update'
21
+  - rm -fv $HOME/.cabal/packages/hackage.haskell.org/00-index.*
22
+  - rm -fv $HOME/.cabal/packages/hackage.haskell.org/*.json
23
+  - rm -fv $HOME/.cabal/packages/hackage.haskell.org/01-index.cache
24
+  - rm -fv $HOME/.cabal/packages/hackage.haskell.org/01-index.tar
25
+  - rm -fv $HOME/.cabal/packages/hackage.haskell.org/01-index.tar.idx
26
+
27
+  - rm -rfv $HOME/.cabal/packages/head.hackage
28
+
29
+matrix:
30
+  include:
31
+    - compiler: "ghc-7.10.3"
32
+    # env: TEST=--disable-tests BENCH=--disable-benchmarks
33
+      addons: {apt: {packages: [ghc-ppa-tools,cabal-install-head,ghc-7.10.3], sources: [hvr-ghc]}}
34
+    - compiler: "ghc-8.0.2"
35
+    # env: TEST=--disable-tests BENCH=--disable-benchmarks
36
+      addons: {apt: {packages: [ghc-ppa-tools,cabal-install-head,ghc-8.0.2], sources: [hvr-ghc]}}
37
+    - compiler: "ghc-8.2.2"
38
+    # env: TEST=--disable-tests BENCH=--disable-benchmarks
39
+      addons: {apt: {packages: [ghc-ppa-tools,cabal-install-head,ghc-8.2.2], sources: [hvr-ghc]}}
40
+    - compiler: "ghc-8.4.1"
41
+    # env: TEST=--disable-tests BENCH=--disable-benchmarks
42
+      addons: {apt: {packages: [ghc-ppa-tools,cabal-install-head,ghc-8.4.1], sources: [hvr-ghc]}}
43
+
44
+before_install:
45
+  - HC=${CC}
46
+  - HCPKG=${HC/ghc/ghc-pkg}
47
+  - unset CC
48
+  - ROOTDIR=$(pwd)
49
+  - mkdir -p $HOME/.local/bin
50
+  - "PATH=/opt/ghc/bin:/opt/ghc-ppa-tools/bin:$HOME/local/bin:$PATH"
51
+  - HCNUMVER=$(( $(${HC} --numeric-version|sed -E 's/([0-9]+)\.([0-9]+)\.([0-9]+).*/\1 * 10000 + \2 * 100 + \3/') ))
52
+  - echo $HCNUMVER
53
+
54
+install:
55
+  - cabal --version
56
+  - echo "$(${HC} --version) [$(${HC} --print-project-git-commit-id 2> /dev/null || echo '?')]"
57
+  - BENCH=${BENCH---enable-benchmarks}
58
+  - TEST=${TEST---enable-tests}
59
+  - HADDOCK=${HADDOCK-true}
60
+  - INSTALLED=${INSTALLED-true}
61
+  - GHCHEAD=${GHCHEAD-false}
62
+  - travis_retry cabal update -v
63
+  - "sed -i.bak 's/^jobs:/-- jobs:/' ${HOME}/.cabal/config"
64
+  - rm -fv cabal.project cabal.project.local
65
+  - grep -Ev -- '^\s*--' ${HOME}/.cabal/config | grep -Ev '^\s*$'
66
+  - "printf 'packages: \".\"\\n' > cabal.project"
67
+  - cat cabal.project
68
+  - if [ -f "./configure.ac" ]; then
69
+      (cd "." && autoreconf -i);
70
+    fi
71
+  - rm -f cabal.project.freeze
72
+  - cabal new-build -w ${HC} ${TEST} ${BENCH} --project-file="cabal.project" --dep -j2 all
73
+  - cabal new-build -w ${HC} --disable-tests --disable-benchmarks --project-file="cabal.project" --dep -j2 all
74
+  - rm -rf .ghc.environment.* "."/dist
75
+  - DISTDIR=$(mktemp -d /tmp/dist-test.XXXX)
76
+
77
+# Here starts the actual work to be performed for the package under test;
78
+# any command which exits with a non-zero exit code causes the build to fail.
79
+script:
80
+  # test that source-distributions can be generated
81
+  - (cd "." && cabal sdist)
82
+  - mv "."/dist/playlists-*.tar.gz ${DISTDIR}/
83
+  - cd ${DISTDIR} || false
84
+  - find . -maxdepth 1 -name '*.tar.gz' -exec tar -xvf '{}' \;
85
+  - "printf 'packages: playlists-*/*.cabal\\n' > cabal.project"
86
+  - cat cabal.project
87
+  # this builds all libraries and executables (without tests/benchmarks)
88
+  - cabal new-build -w ${HC} --disable-tests --disable-benchmarks all
89
+
90
+  # Build with installed constraints for packages in global-db
91
+  - if $INSTALLED; then echo cabal new-build -w ${HC} --disable-tests --disable-benchmarks $(${HCPKG} list --global --simple-output --names-only | sed 's/\([a-zA-Z0-9-]\{1,\}\) */--constraint="\1 installed" /g') all | sh; else echo "Not building with installed constraints"; fi
92
+
93
+  # build & run tests, build benchmarks
94
+  - cabal new-build -w ${HC} ${TEST} ${BENCH} all
95
+  - if [ "x$TEST" = "x--enable-tests" ]; then cabal new-test -w ${HC} ${TEST} ${BENCH} all; fi
96
+
97
+  # cabal check
98
+  - (cd playlists-* && cabal check)
99
+
100
+  # haddock
101
+  - rm -rf ./dist-newstyle
102
+  - if $HADDOCK; then cabal new-haddock -w ${HC} ${TEST} ${BENCH} all; else echo "Skipping haddock generation";fi
103
+
104
+# REGENDATA ["playlists.cabal"]
105
+# EOF

+ 1
- 1
LICENSE View File

@@ -1,4 +1,4 @@
1
-Copyright (c) 2013-2017 Peter Jones <pjones@devalot.com>
1
+Copyright (c) 2013-2018 Peter Jones <pjones@devalot.com>
2 2
 
3 3
 All rights reserved.
4 4
 

+ 20
- 0
default.nix View File

@@ -0,0 +1,20 @@
1
+{ pkgs ? (import <nixpkgs> {}).pkgs }:
2
+
3
+let
4
+  # List any extra packages you want available while your package is
5
+  # building or while in a nix shell:
6
+  extraPackages = with pkgs; [ ];
7
+
8
+  # Helpful if you want to override any Haskell packages:
9
+  haskell = pkgs.haskellPackages;
10
+in
11
+
12
+# Load the local nix file and use the overrides from above:
13
+haskell.callPackage ./playlists.nix {
14
+  mkDerivation = { buildTools ? []
15
+                 , ...
16
+                 }@args:
17
+    haskell.mkDerivation (args // {
18
+      buildTools = buildTools ++ extraPackages;
19
+    });
20
+}

+ 3
- 3
playlists.cabal View File

@@ -6,11 +6,11 @@ license:       BSD3
6 6
 license-file:  LICENSE
7 7
 author:        Peter Jones <pjones@devalot.com>
8 8
 maintainer:    Peter Jones <pjones@devalot.com>
9
-copyright:     Copyright (c) 2013-2016 Peter Jones
9
+copyright:     Copyright (c) 2013-2018 Peter Jones
10 10
 category:      Text
11 11
 build-type:    Simple
12
-cabal-version: >= 1.18
13
-tested-with:   GHC==7.10.3, GHC==8.0.2
12
+cabal-version: 1.18
13
+tested-with:   GHC == 7.10.3, GHC == 8.0.2, GHC == 8.2.2, GHC == 8.4.1
14 14
 description:
15 15
   Playlists is a library for working with media playlist files.  The
16 16
   original motivation for the library was extracting URLs for

+ 0
- 14
stack.nix View File

@@ -1,14 +0,0 @@
1
-{ nixpkgs ? import <nixpkgs> { }
2
-, ghc ? nixpkgs.ghc
3
-}:
4
-
5
-with nixpkgs;
6
-
7
-haskell.lib.buildStackProject {
8
-  name = "playlists";
9
-
10
-  buildInputs = [
11
-  ];
12
-
13
-  inherit ghc;
14
-}

+ 0
- 4
stack.yaml View File

@@ -3,10 +3,6 @@ resolver: lts-9.14
3 3
 packages:
4 4
 - ./
5 5
 
6
-nix:
7
-  enable: false
8
-  shell-file: stack.nix
9
-
10 6
 flags:
11 7
   playlists:
12 8
     maintainer: true

Loading…
Cancel
Save