Skip to content

Commit ab26598

Browse files
author
Mitsutoshi Aoe
authored
Merge pull request #64 from maoe/ci
Enable Travis CI (Linux) and AppVeyor (Windows) builds
2 parents daf0988 + 299546b commit ab26598

File tree

10 files changed

+144
-14
lines changed

10 files changed

+144
-14
lines changed

.travis.yml

Lines changed: 87 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,87 @@
1+
# This Travis job script has been generated by a script via
2+
#
3+
# make_travis_yml_2.hs 'threadscope.cabal' 'libgtk2.0-dev'
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+
matrix:
28+
include:
29+
- compiler: "ghc-7.6.3"
30+
# env: TEST=--disable-tests BENCH=--disable-benchmarks
31+
addons: {apt: {packages: [ghc-ppa-tools,cabal-install-head,ghc-7.6.3,libgtk2.0-dev], sources: [hvr-ghc]}}
32+
- compiler: "ghc-7.8.3"
33+
# env: TEST=--disable-tests BENCH=--disable-benchmarks
34+
addons: {apt: {packages: [ghc-ppa-tools,cabal-install-head,ghc-7.8.3,libgtk2.0-dev], sources: [hvr-ghc]}}
35+
- compiler: "ghc-7.10.2"
36+
# env: TEST=--disable-tests BENCH=--disable-benchmarks
37+
addons: {apt: {packages: [ghc-ppa-tools,cabal-install-head,ghc-7.10.2,libgtk2.0-dev], sources: [hvr-ghc]}}
38+
- compiler: "ghc-8.0.2"
39+
# env: TEST=--disable-tests BENCH=--disable-benchmarks
40+
addons: {apt: {packages: [ghc-ppa-tools,cabal-install-head,ghc-8.0.2,libgtk2.0-dev], sources: [hvr-ghc]}}
41+
- compiler: "ghc-8.2.1"
42+
# env: TEST=--disable-tests BENCH=--disable-benchmarks
43+
addons: {apt: {packages: [ghc-ppa-tools,cabal-install-head,ghc-8.2.1,libgtk2.0-dev], sources: [hvr-ghc]}}
44+
45+
before_install:
46+
- HC=${CC}
47+
- unset CC
48+
- PATH=/opt/ghc/bin:/opt/ghc-ppa-tools/bin:$PATH
49+
- PKGNAME='threadscope'
50+
51+
install:
52+
- cabal --version
53+
- echo "$(${HC} --version) [$(${HC} --print-project-git-commit-id 2> /dev/null || echo '?')]"
54+
- BENCH=${BENCH---enable-benchmarks}
55+
- TEST=${TEST---enable-tests}
56+
- travis_retry cabal update -v
57+
- sed -i 's/^jobs:/-- jobs:/' ${HOME}/.cabal/config
58+
- rm -fv cabal.project.local
59+
- "echo 'packages: .' > cabal.project"
60+
- rm -f cabal.project.freeze
61+
- cabal new-build -w ${HC} ${TEST} ${BENCH} --dep -j2 all
62+
- cabal new-build -w ${HC} --disable-tests --disable-benchmarks --dep -j2 all
63+
64+
# Here starts the actual work to be performed for the package under test;
65+
# any command which exits with a non-zero exit code causes the build to fail.
66+
script:
67+
- if [ -f configure.ac ]; then autoreconf -i; fi
68+
- rm -rf .ghc.environment.* dist/
69+
- cabal sdist # test that a source-distribution can be generated
70+
- cd dist/
71+
- SRCTAR=(${PKGNAME}-*.tar.gz)
72+
- SRC_BASENAME="${SRCTAR/%.tar.gz}"
73+
- tar -xvf "./$SRC_BASENAME.tar.gz"
74+
- cd "$SRC_BASENAME/"
75+
## from here on, CWD is inside the extracted source-tarball
76+
- rm -fv cabal.project.local
77+
- "echo 'packages: .' > cabal.project"
78+
# this builds all libraries and executables (without tests/benchmarks)
79+
- rm -f cabal.project.freeze
80+
- cabal new-build -w ${HC} --disable-tests --disable-benchmarks all
81+
# this builds all libraries and executables (including tests/benchmarks)
82+
# - rm -rf ./dist-newstyle
83+
84+
# build & run tests
85+
- cabal new-build -w ${HC} ${TEST} ${BENCH} all
86+
87+
# EOF

Events/HECs.hs

Lines changed: 9 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -16,9 +16,14 @@ import Events.SparkTree
1616
import GHC.RTS.Events
1717

1818
import Data.Array
19-
import qualified Data.IntMap as IM
2019
import qualified Data.List as L
2120

21+
#if MIN_VERSION_containers(0,5,0)
22+
import qualified Data.IntMap.Strict as IM
23+
#else
24+
import qualified Data.IntMap as IM
25+
#endif
26+
2227
-----------------------------------------------------------------------------
2328

2429
-- all the data from a .eventlog file
@@ -78,7 +83,9 @@ fromListWith' :: (a -> a -> a) -> [(Int, a)] -> IM.IntMap a
7883
fromListWith' f xs =
7984
L.foldl' ins IM.empty xs
8085
where
81-
#if MIN_VERSION_containers(0,4,1)
86+
#if MIN_VERSION_containers(0,5,0)
87+
ins t (k,x) = IM.insertWith f k x t
88+
#elif MIN_VERSION_containers(0,4,1)
8289
ins t (k,x) = IM.insertWith' f k x t
8390
#else
8491
ins t (k,x) =

GUI/App.hs

Lines changed: 1 addition & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -8,11 +8,9 @@
88

99
module GUI.App (initApp) where
1010

11-
-- Imports for GTK
12-
import qualified Graphics.UI.Gtk as Gtk
13-
1411
-- Mac OS X-specific GTK imports
1512
#if defined(darwin_HOST_OS)
13+
import qualified Graphics.UI.Gtk as Gtk
1614
import qualified Graphics.UI.Gtk.OSX as OSX
1715
#endif
1816

GUI/GtkExtras.hs

Lines changed: 6 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -6,17 +6,20 @@ module GUI.GtkExtras where
66

77
import Graphics.UI.GtkInternals
88
import Graphics.UI.Gtk (Rectangle)
9-
import System.Glib.GError
109
import System.Glib.MainLoop
1110
import Graphics.Rendering.Pango.Types
1211
import Graphics.Rendering.Pango.BasicTypes
1312
import Graphics.UI.Gtk.General.Enums (StateType, ShadowType)
1413

1514
import Foreign
1615
import Foreign.C
17-
import Control.Monad
1816
import Control.Concurrent.MVar
1917

18+
#if !(mingw32_HOST_OS || mingw32_TARGET_OS)
19+
import System.Glib.GError
20+
import Control.Monad
21+
#endif
22+
2023
waitGUI :: IO ()
2124
waitGUI = do
2225
resultVar <- newEmptyMVar
@@ -91,7 +94,7 @@ launchProgramForURI uri = do
9194
1 -- SW_SHOWNORMAL
9295
return True
9396

94-
foreign import stdcall unsafe "shlobj.h ShellExecuteA"
97+
foreign import ccall unsafe "shlobj.h ShellExecuteA"
9598
c_ShellExecuteA :: Ptr () -- HWND hwnd
9699
-> CString -- LPCTSTR lpOperation
97100
-> CString -- LPCTSTR lpFile

GUI/Main.hs

Lines changed: 0 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -7,14 +7,12 @@ import System.Glib.GError (failOnGError)
77

88
-- Imports from Haskell library
99
import Text.Printf
10-
import Control.Monad
1110
#ifndef mingw32_HOST_OS
1211
import System.Posix
1312
#endif
1413
import Control.Concurrent
1514
import qualified Control.Concurrent.Chan as Chan
1615
import Control.Exception
17-
import Prelude hiding (catch)
1816
import Data.Array
1917
import Data.Maybe
2018

GUI/ProgressView.hs

Lines changed: 0 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -17,9 +17,6 @@ import qualified Control.Concurrent as Concurrent
1717
import Control.Exception
1818
import Data.Typeable
1919

20-
import Prelude hiding (catch)
21-
22-
2320
data ProgressView = ProgressView {
2421
progressWindow :: Gtk.Window,
2522
progressLabel :: Gtk.Label,

README.md

Lines changed: 4 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,4 @@
1+
# ThreadScope
2+
[![Hackage](https://img.shields.io/hackage/v/threadscope.svg)](https://hackage.haskell.org/package/threadscope)
3+
[![Hackage-Deps](https://img.shields.io/hackage-deps/v/threadscope.svg)](http://packdeps.haskellers.com/feed?needle=threadscope)
4+
[![Build Status](https://travis-ci.org/haskell/ThreadScope.svg?branch=master)](https://travis-ci.org/haskell/ThreadScope)

appveyor.yml

Lines changed: 23 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,23 @@
1+
platform: x64
2+
shallow_clone: true
3+
environment:
4+
global:
5+
STACK_ROOT: "c:\\sr"
6+
cache:
7+
- "c:\\sr -> appveyor.yml"
8+
install:
9+
- set HOME=.
10+
- set "PATH=C:\msys64\usr\bin;%PATH%"
11+
- curl -ostack.zip -LsS --insecure https://www.stackage.org/stack/windows-x86_64
12+
- 7z x stack.zip stack.exe
13+
- stack setup > nul
14+
- stack exec -- pacman --noconfirm --needed -Sy bash pacman pacman-mirrors msys2-runtime msys2-runtime-devel
15+
- stack exec -- pacman --noconfirm -Syu
16+
- stack exec -- pacman --noconfirm -Syuu
17+
- stack exec -- pacman --noconfirm -S base-devel mingw-w64-x86_64-toolchain mingw-w64-x86_64-gtk2
18+
build_script:
19+
- stack --no-terminal build --only-dependencies
20+
test_script:
21+
- stack --no-terminal build --ghc-options -Werror
22+
- stack sdist
23+
version: '{build}'

stack.yaml

Lines changed: 7 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,7 @@
1+
resolver: lts-8.22
2+
packages:
3+
- .
4+
extra-deps:
5+
- ghc-events-0.6.0
6+
- gtk-mac-integration-0.3.3.1
7+
flags: {}

threadscope.cabal

Lines changed: 7 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -33,6 +33,11 @@ Bug-reports: https://github.com/haskell/ThreadScope/issues
3333
Build-Type: Simple
3434
Cabal-version: >= 1.6
3535
Data-files: threadscope.ui, threadscope.png
36+
Tested-with: GHC == 7.6.3,
37+
GHC == 7.8.3,
38+
GHC == 7.10.2,
39+
GHC == 8.0.2,
40+
GHC == 8.2.1
3641

3742
source-repository head
3843
type: git
@@ -43,7 +48,7 @@ Executable threadscope
4348
Build-Depends: base >= 4.0 && < 5,
4449
gtk >= 0.12, cairo, glib, pango,
4550
binary, array, mtl, filepath,
46-
ghc-events >= 0.5,
51+
ghc-events >= 0.5 && < 0.7,
4752
containers >= 0.2 && < 0.6,
4853
deepseq >= 1.1,
4954
text,
@@ -86,6 +91,7 @@ Executable threadscope
8691
GUI.Timeline.Types,
8792
GUI.Timeline.Render.Constants,
8893
GUI.GtkExtras
94+
Paths_threadscope
8995

9096
ghc-options: -Wall -fwarn-tabs -rtsopts
9197
-fno-warn-type-defaults -fno-warn-name-shadowing

0 commit comments

Comments
 (0)