Skip to content

Commit

Permalink
Merge pull request #21 from iconnect/build-status
Browse files Browse the repository at this point in the history
Improve build status and streamline stack configurations
  • Loading branch information
cdornan committed Feb 2, 2017
2 parents de42e95 + c502da8 commit 82857d4
Show file tree
Hide file tree
Showing 17 changed files with 133 additions and 47 deletions.
24 changes: 13 additions & 11 deletions README.md
Original file line number Diff line number Diff line change
@@ -1,8 +1,10 @@
[![Hackage](https://img.shields.io/hackage/v/regex.svg)](https://hackage.haskell.org/package/regex)
[![BSD3 License](http://img.shields.io/badge/license-BSD3-brightgreen.svg)](https://tldrlegal.com/license/bsd-3-clause-license-%28revised%29)
[![Un*x build](https://img.shields.io/travis/iconnect/regex.svg?label=Linux%2BmacOS)](https://travis-ci.org/iconnect/regex)
[![Windows build](https://img.shields.io/appveyor/ci/engineerirngirisconnectcouk/regex.svg?label=Windows)](https://ci.appveyor.com/project/engineerirngirisconnectcouk/regex/branch/master)
[![Coverage](https://img.shields.io/coveralls/iconnect/regex.svg)](https://coveralls.io/github/iconnect/regex?branch=master)
**[Build Status](https://iconnect.github.io/regex/build-status)**

[![Hackage](https://iconnect.github.io/regex/badges/hackage.svg)](https://hackage.haskell.org/package/regex)
[![BSD3 License](https://iconnect.github.io/regex/badges/license.svg)](https://tldrlegal.com/license/bsd-3-clause-license-%28revised%29)
[![Un*x build](https://iconnect.github.io/regex/badges/unix-build.svg)](https://travis-ci.org/iconnect/regex)
[![Windows build](https://iconnect.github.io/regex/badges/windows-build.svg)](https://ci.appveyor.com/project/engineerirngirisconnectcouk/regex/branch/master)
[![Coverage](https://iconnect.github.io/regex/badges/coverage.svg)](https://coveralls.io/github/iconnect/regex?branch=master)

# regex: A Regular Expression Toolkit for regex-base

Expand All @@ -25,17 +27,17 @@ regex extends regex-base with:
Schedule
--------

- [X] **2017-01-26**  0.0.0.1  Pre-release (I)
- [X] **2017-01-30**  0.0.0.2  Pre-release (II)
- [ ] **2017-02-06**  0.0.1.0  RFC
- [ ] **2017-02-20**  0.1.0.0  a candidate stable release
- [ ] **2017-03-20**  1.0.0.0  first stable release
- [X] **2017-01-26**&nbsp;&nbsp;0.0.0.1&nbsp;&nbsp;Pre-release (I)<br/>
- [X] **2017-01-30**&nbsp;&nbsp;0.0.0.2&nbsp;&nbsp;Pre-release (II)<br/>
- [ ] **2017-02-06**&nbsp;&nbsp;0.0.1.0&nbsp;&nbsp;RFC<br/>
- [ ] **2017-02-20**&nbsp;&nbsp;0.1.0.0&nbsp;&nbsp;a candidate stable release<br/>
- [ ] **2017-03-20**&nbsp;&nbsp;1.0.0.0&nbsp;&nbsp;first stable release<br/>


The Web Page
------------

We have a [web page](https://iconnect.github.io/regex/) with a tutorial,
We have a [web site](https://iconnect.github.io/regex/) with a tutorial,
a major example and and more examples than you can shake a stick at (most
of them used in the package itself).

Expand Down
5 changes: 4 additions & 1 deletion Text/RE/Parsers.hs
Original file line number Diff line number Diff line change
@@ -1,3 +1,5 @@
{-# OPTIONS_GHC -fno-warn-warnings-deprecations #-}

module Text.RE.Parsers
( parseInteger
, parseHex
Expand All @@ -24,6 +26,7 @@ import Data.Array
import qualified Data.HashMap.Strict as HM
import Data.Maybe
import Data.Time
import qualified Data.Time.Locale.Compat as LC
import Data.Word
import Text.Printf
import Text.Read
Expand Down Expand Up @@ -98,7 +101,7 @@ parse_time :: (ParseTime t,Replace s) => [String] -> s -> Maybe t
parse_time tpls = prs . unpack_
where
prs s = listToMaybe $ catMaybes
[ parseTimeM False defaultTimeLocale fmt s
[ parseTime LC.defaultTimeLocale fmt s
| fmt<-tpls
]

Expand Down
1 change: 1 addition & 0 deletions docs/badges/coverage.svg
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
1 change: 1 addition & 0 deletions docs/badges/hackage.svg
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
1 change: 1 addition & 0 deletions docs/badges/license.svg
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
1 change: 1 addition & 0 deletions docs/badges/unix-build.svg
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
1 change: 1 addition & 0 deletions docs/badges/windows-build.svg
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
17 changes: 17 additions & 0 deletions docs/build-status.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,17 @@
<a href='.' title='Home'>Home</a> &gt; **Build Status**

Build Status
============

| Service | O/S | Build | GHC | LTS | extra-deps | Status
| ------------ | ------- | ----- | ------ | ---- | ----------------------- | ------
| Hackage | | | | | | [![Hackage](https://img.shields.io/hackage/v/regex.svg)](https://hackage.haskell.org/package/regex)
| Licence | | | | | | [![BSD3 License](http://img.shields.io/badge/license-BSD3-brightgreen.svg)](https://tldrlegal.com/license/bsd-3-clause-license-%28revised%29)
| Travis CI | Linux | stack | 7.10.3 | 6.29 | | [![Un*x build](https://travis-ci.org/iconnect/regex.svg?branch=master)](https://travis-ci.org/iconnect/regex)
| | Linux | stack | 7.8.4 | 2.22 | regex-tdfa-text-1.0.0.3 |
| | Linux | stack | 8.0.1 | 7.18 | |
| | Linux | cabal | 7.10.3 | | |
| | macOS | stack | 7.8.4 | | |
| | macOS | stack | 8.0.1 | | |
| AppVeyor | Windows | stack | 8.0.1 | 7.18 | | [![Windows build](https://ci.appveyor.com/api/projects/status/9gqs37u3h1mlc02b?svg=true)](https://ci.appveyor.com/project/engineerirngirisconnectcouk/regex/branch/master)
| coveralls.io | | | | | | [![Coverage](https://coveralls.io/repos/github/iconnect/regex/badge.svg?branch=master)](https://coveralls.io/github/iconnect/regex?branch=master)
23 changes: 18 additions & 5 deletions docs/index.md
Original file line number Diff line number Diff line change
Expand Up @@ -22,11 +22,24 @@ regex extends regex-base with:
Schedule
--------

- [X] **2017-01-26**&nbsp;&nbsp;0.0.0.1&nbsp;&nbsp;Pre-release (I)
- [X] **2017-01-30**&nbsp;&nbsp;0.0.0.2&nbsp;&nbsp;Pre-release (II)
- [ ] **2017-02-06**&nbsp;&nbsp;0.0.1.0&nbsp;&nbsp;RFC
- [ ] **2017-02-20**&nbsp;&nbsp;0.1.0.0&nbsp;&nbsp;a candidate stable release
- [ ] **2017-03-20**&nbsp;&nbsp;1.0.0.0&nbsp;&nbsp;first stable release
&nbsp;&nbsp;&#9745;&nbsp;**2017-01-26**&nbsp;&nbsp;0.0.0.1&nbsp;&nbsp;Pre-release (I)<br/>
&nbsp;&nbsp;&#9745;&nbsp;**2017-01-30**&nbsp;&nbsp;0.0.0.2&nbsp;&nbsp;Pre-release (II)<br/>
&nbsp;&nbsp;&#9744;&nbsp;**2017-02-06**&nbsp;&nbsp;0.0.1.0&nbsp;&nbsp;RFC<br/>
&nbsp;&nbsp;&#9744;&nbsp;**2017-02-20**&nbsp;&nbsp;0.1.0.0&nbsp;&nbsp;a candidate stable release<br/>
&nbsp;&nbsp;&#9744;&nbsp;**2017-03-20**&nbsp;&nbsp;1.0.0.0&nbsp;&nbsp;first stable release<br/>


The Builds
----------

[![Hackage](badges/hackage.svg)](https://hackage.haskell.org/package/regex)
[![BSD3 License](badges/license.svg)](https://tldrlegal.com/license/bsd-3-clause-license-%28revised%29)
[![Un*x build](badges/unix-build.svg)](https://travis-ci.org/iconnect/regex)
[![Windows build](badges/windows-build.svg)](https://ci.appveyor.com/project/engineerirngirisconnectcouk/regex/branch/master)
[![Coverage](badges/coverage.svg)](https://coveralls.io/github/iconnect/regex?branch=master)

For details of the current release and the build pipelines see the
**[Build Status](build-status)** page.


Installation Instructions
Expand Down
21 changes: 21 additions & 0 deletions docs/re-pp.html
Original file line number Diff line number Diff line change
Expand Up @@ -65,6 +65,7 @@
<span class="kw">import </span><span class="dt">Data.Maybe</span>
<span class="kw">import </span><span class="dt">Data.Monoid</span>
<span class="kw">import qualified</span> <span class="dt">Data.Text</span> <span class="kw">as</span> <span class="dt">T</span>
<span class="kw">import </span><span class="dt">Network.HTTP.Simple</span>
<span class="kw">import qualified</span> <span class="dt">Shelly</span> <span class="kw">as</span> <span class="dt">SH</span>
<span class="kw">import </span><span class="dt">System.Directory</span>
<span class="kw">import </span><span class="dt">System.Environment</span>
Expand All @@ -83,6 +84,7 @@
[<span class="st">&quot;test&quot;</span>] <span class="ot">-&gt;</span> test
[<span class="st">&quot;doc&quot;</span>,fn,fn&#39;] <span class="fu">|</span> is_file fn <span class="ot">-&gt;</span> doc fn fn&#39;
[<span class="st">&quot;gen&quot;</span>,fn,fn&#39;] <span class="fu">|</span> is_file fn <span class="ot">-&gt;</span> gen fn fn&#39;
[<span class="st">&quot;badges&quot;</span>] <span class="ot">-&gt;</span> badges
[<span class="st">&quot;all&quot;</span>] <span class="ot">-&gt;</span> gen_all
_ <span class="ot">-&gt;</span> usage
<span class="kw">where</span>
Expand Down Expand Up @@ -178,6 +180,8 @@ <h2 id="the-sed-script">The Sed Script</h2>
<h2 id="script-to-generate-all-tutorial-tests-and-docs">Script to Generate All Tutorial Tests and Docs</h2>
<div class="sourceCode"><pre class="sourceCode literate haskell"><code class="sourceCode haskell"><span class="ot">gen_all ::</span> <span class="dt">IO</span> ()
gen_all <span class="fu">=</span> <span class="kw">do</span>
<span class="co">-- refresh the badges</span>
badges
<span class="co">-- prepare HTML docs for the (literate) tools</span>
pd <span class="st">&quot;re-gen-modules&quot;</span>
pd <span class="st">&quot;re-include&quot;</span>
Expand Down Expand Up @@ -362,6 +366,23 @@ <h2 id="extracting-a-literate-fragment-from-a-haskell-program-text">Extracting a
chk x mtchs <span class="fu">=</span> <span class="kw">case</span> anyMatches mtchs <span class="kw">of</span>
<span class="dt">True</span> <span class="ot">-&gt;</span> <span class="dt">Just</span> x
<span class="dt">False</span> <span class="ot">-&gt;</span> <span class="dt">Nothing</span></code></pre></div>
<h2 id="badges">badges</h2>
<div class="sourceCode"><pre class="sourceCode literate haskell"><code class="sourceCode haskell"><span class="ot">badges ::</span> <span class="dt">IO</span> ()
badges <span class="fu">=</span> mapM_ collect
[ (,) <span class="st">&quot;hackage&quot;</span> <span class="st">&quot;https://img.shields.io/hackage/v/regex.svg&quot;</span>
, (,) <span class="st">&quot;licence&quot;</span> <span class="st">&quot;https://img.shields.io/badge/license-BSD3-brightgreen.svg&quot;</span>
, (,) <span class="st">&quot;unix-build&quot;</span> <span class="st">&quot;https://img.shields.io/travis/iconnect/regex.svg?label=Linux%2BmacOS&quot;</span>
, (,) <span class="st">&quot;windows-build&quot;</span> <span class="st">&quot;https://img.shields.io/appveyor/ci/engineerirngirisconnectcouk/regex.svg?label=Windows&quot;</span>
, (,) <span class="st">&quot;coverage&quot;</span> <span class="st">&quot;https://img.shields.io/coveralls/iconnect/regex.svg&quot;</span>
]
<span class="kw">where</span>
collect (nm,url) <span class="fu">=</span>
wget url <span class="fu">&gt;&gt;=</span> LBS.writeFile (<span class="st">&quot;docs/badges/&quot;</span><span class="fu">++</span>nm<span class="fu">++</span><span class="st">&quot;.svg&quot;</span>)

<span class="ot">wget ::</span> <span class="dt">String</span> <span class="ot">-&gt;</span> <span class="dt">IO</span> <span class="dt">LBS.ByteString</span>
wget url <span class="fu">=</span> <span class="kw">do</span>
rq <span class="ot">&lt;-</span> parseRequest url
getResponseBody <span class="fu">&lt;$&gt;</span> httpLbs rq</code></pre></div>
<h2 id="pandoc">pandoc</h2>
<div class="sourceCode"><pre class="sourceCode literate haskell"><code class="sourceCode haskell"><span class="ot">pandoc ::</span> <span class="dt">T.Text</span> <span class="ot">-&gt;</span> <span class="dt">T.Text</span> <span class="ot">-&gt;</span> <span class="dt">T.Text</span> <span class="ot">-&gt;</span> <span class="dt">IO</span> ()
pandoc title in_file <span class="fu">=</span> pandoc&#39; title in_file in_file
Expand Down
2 changes: 2 additions & 0 deletions docs/re-tutorial.html
Original file line number Diff line number Diff line change
Expand Up @@ -579,6 +579,8 @@ <h2 id="example-filename-analysis">Example: filename analysis</h2>
<div class="includedcodeblock">
<div class="sourceCode"><pre class="sourceCode literate haskell"><code class="sourceCode haskell"><span class="ot">gen_all ::</span> <span class="dt">IO</span> ()
gen_all <span class="fu">=</span> <span class="kw">do</span>
<span class="co">-- refresh the badges</span>
badges
<span class="co">-- prepare HTML docs for the (literate) tools</span>
pd <span class="st">&quot;re-gen-modules&quot;</span>
pd <span class="st">&quot;re-include&quot;</span>
Expand Down
21 changes: 21 additions & 0 deletions examples/re-pp.lhs
Original file line number Diff line number Diff line change
Expand Up @@ -16,6 +16,7 @@ import Data.IORef
import Data.Maybe
import Data.Monoid
import qualified Data.Text as T
import Network.HTTP.Conduit
import qualified Shelly as SH
import System.Directory
import System.Environment
Expand All @@ -37,6 +38,7 @@ main = do
["test"] -> test
["doc",fn,fn'] | is_file fn -> doc fn fn'
["gen",fn,fn'] | is_file fn -> gen fn fn'
["badges"] -> badges
["all"] -> gen_all
_ -> usage
where
Expand Down Expand Up @@ -407,6 +409,25 @@ scan rex = grepScript
\end{code}
badges
------
\begin{code}
badges :: IO ()
badges = mapM_ collect
[ (,) "hackage" "https://img.shields.io/hackage/v/regex.svg"
, (,) "license" "https://img.shields.io/badge/license-BSD3-brightgreen.svg"
, (,) "unix-build" "https://img.shields.io/travis/iconnect/regex.svg?label=Linux%2BmacOS"
, (,) "windows-build" "https://img.shields.io/appveyor/ci/engineerirngirisconnectcouk/regex.svg?label=Windows"
, (,) "coverage" "https://img.shields.io/coveralls/iconnect/regex.svg"
]
where
collect (nm,url) = do
putStrLn $ "updating badge: " ++ nm
simpleHttp url >>= LBS.writeFile ("docs/badges/"++nm++".svg")
\end{code}
pandoc
------
Expand Down
Loading

0 comments on commit 82857d4

Please sign in to comment.