Skip to content

Commit

Permalink
[ actions ] Relaxing build constraints (#8)
Browse files Browse the repository at this point in the history
We are now building the project with all of the versions of ghc made available
to us by https://github.com/actions/setup-haskell

To make the builds as fast as possible, we are caching `.cabal` and `.ghc`
for each one of the versions. So far that should take around 1G (5*200M)
which is way below the 5G allowance we have.
  • Loading branch information
gallais authored Mar 2, 2020
1 parent 399e178 commit cc0f0db
Show file tree
Hide file tree
Showing 6 changed files with 61 additions and 15 deletions.
37 changes: 35 additions & 2 deletions .github/workflows/haskell.yml
Original file line number Diff line number Diff line change
Expand Up @@ -6,21 +6,54 @@ jobs:
build:

runs-on: ubuntu-latest
strategy:
matrix:
ghc: ['8.8.1', '8.6.5', '8.4.4', '8.2.2', '8.0.2']
include:
- ghc: '8.8.1'
cabal: '3.0'
- ghc: '8.6.5'
cabal: '3.0'
- ghc: '8.4.4'
cabal: '2.2'
- ghc: '8.2.2'
cabal: '2.0'
- ghc: '8.0.2'
cabal: '2.0'

steps:
- uses: actions/checkout@v2

- uses: actions/setup-haskell@v1
with:
ghc-version: '8.6.5'
cabal-version: '3.0'
ghc-version: ${{ matrix.ghc }}
cabal-version: ${{ matrix.cabal }}

- uses: actions/cache@v1
name: Cache ~/.cabal/
with:
path: ~/.cabal/
key: ${{ runner.os }}-ghc-${{ matrix.ghc }}-cabal-${{ matrix.cabal }}-cabal

- uses: actions/cache@v1
name: Cache ~/.ghc/
with:
path: ~/.ghc/
key: ${{ runner.os }}-ghc-${{ matrix.ghc }}-cabal-${{ matrix.cabal }}-ghc

- name: Remove existing mary binary
run: rm -f ~/.cabal/bin/mary

- name: Install dependencies
run: |
cabal update
cabal install --only-dependencies
- name: Build
run: |
cabal configure --enable-tests
cabal build
# no tests yet
# - name: Run tests
# run: cabal test
20 changes: 13 additions & 7 deletions mary.cabal
Original file line number Diff line number Diff line change
Expand Up @@ -18,6 +18,12 @@ synopsis: Content delivery system for CIS
-- A longer description of the package.
-- description:

tested-with: GHC == 8.0.2
GHC == 8.2.2
GHC == 8.4.4
GHC == 8.6.5
GHC == 8.8.1

-- URL for the project homepage or repository.
homepage: https://github.com/msp-strath/Mary

Expand Down Expand Up @@ -68,13 +74,13 @@ executable mary
-- other-extensions:

-- Other library packages from which modules are imported.
build-depends: base >=4.12 && <4.13
build-depends: attoparsec >=0.13 && <0.14
, base >=4.9.1.0 && <4.14
, containers >=0.6 && <0.7
, attoparsec >=0.13 && <0.14
, text >=1.2 && <1.3
, prettyprinter >=1.6 && <1.7
, pandoc-types >=1.19 && <1.21
, mtl >=2 && <3
, pandoc-types >=1.19 && <1.21
, prettyprinter >=1.6 && <1.7
, text >=1.2 && <1.3

-- Directories containing source files.
hs-source-dirs: src
Expand All @@ -85,12 +91,12 @@ executable mary
-- LANGUAGE extensions used by modules in this package.
default-extensions: DeriveTraversable
, LambdaCase
, OverloadedStrings
, PatternSynonyms
, TupleSections
, OverloadedStrings

ghc-options: -Wincomplete-patterns
-Woverlapping-patterns
-Wmissing-signatures
-Woverlapping-patterns
-Wtabs
-fwarn-unused-imports
1 change: 1 addition & 0 deletions src/Shonkier/Examples.hs
Original file line number Diff line number Diff line change
@@ -1,6 +1,7 @@
module Shonkier.Examples where

import Data.Map (singleton)
import Data.Semigroup ((<>)) -- needed for ghc versions <= 8.2.2

import Data.Bwd
import Shonkier.Syntax
Expand Down
1 change: 1 addition & 0 deletions src/Shonkier/Pretty.hs
Original file line number Diff line number Diff line change
Expand Up @@ -9,6 +9,7 @@ import Shonkier.Semantics
import Data.Char
import Data.Foldable
import Data.Ratio
import Data.Semigroup ((<>)) -- needed for ghc versions <= 8.2.2
import qualified Data.Text as T
import Data.Text.Prettyprint.Doc

Expand Down
1 change: 1 addition & 0 deletions src/Shonkier/Semantics.hs
Original file line number Diff line number Diff line change
Expand Up @@ -10,6 +10,7 @@ import Data.Either
import Data.Map (Map, singleton, (!?))
import Data.List (sortBy, groupBy, nub)
import Data.Maybe (fromMaybe)
import Data.Semigroup ((<>)) -- needed for ghc versions <= 8.2.2
import Data.Text (Text)
import qualified Data.Text as T

Expand Down
16 changes: 10 additions & 6 deletions src/mary.hs
Original file line number Diff line number Diff line change
Expand Up @@ -2,17 +2,21 @@

module Main where

import Text.Pandoc.Definition
import Text.Pandoc.Walk
import Text.Pandoc.JSON
import Control.Monad.Writer (Writer, runWriter, tell)

import Data.Attoparsec.Text
import Data.Semigroup ((<>)) -- needed for ghc versions <= 8.2.2
import qualified Data.Text as T
import Data.Text.IO as TIO
import System.Environment
import Control.Monad.Writer
import Data.Attoparsec.Text
import Data.Text.Prettyprint.Doc
import Data.Text.Prettyprint.Doc.Render.Text

import System.Environment

import Text.Pandoc.Definition
import Text.Pandoc.Walk
import Text.Pandoc.JSON

import Data.Bwd
import Shonkier.Examples
import Shonkier.Parser
Expand Down

0 comments on commit cc0f0db

Please sign in to comment.