Add ci.yaml

This commit is contained in:
Mitchell Rosen 2020-05-16 23:23:44 -04:00
parent 7f84fa9616
commit e46a493bcc
4 changed files with 86 additions and 8 deletions

60
.github/workflows/ci.yaml vendored Normal file
View File

@ -0,0 +1,60 @@
name: CI
on:
pull_request:
push:
branches: [master]
jobs:
build:
name: ${{ matrix.os }} / ghc ${{ matrix.ghc }}
runs-on: ${{ matrix.os }}
strategy:
matrix:
os: [ubuntu-latest, macOS-latest, windows-latest]
cabal: [latest]
ghc: ["8.6", "8.8", "8.10"]
exclude:
- os: macOS-latest
ghc: "8.8"
- os: macOS-latest
ghc: "8.6"
- os: windows-latest
ghc: "8.6"
- os: windows-latest
ghc: "8.8"
steps:
- uses: actions/checkout@v2
if: github.event.action == 'opened' || github.event.action == 'synchronize' || github.event.ref == 'refs/heads/master'
- uses: actions/setup-haskell@v1.1
id: setup-haskell
name: Setup Haskell
with:
ghc-version: ${{ matrix.ghc }}
cabal-version: ${{ matrix.cabal }}
- uses: actions/cache@v1
name: Cache ~/.cabal/store
with:
path: ${{ steps.setup-haskell.outputs.cabal-store }}
key: ${{ runner.os }}-${{ matrix.ghc }}-cabal-store
- uses: actions/cache@v1
name: Cache ./dist-newstyle
with:
path: dist-newstyle
key: ${{ runner.os }}-${{ matrix.ghc }}-dist-newstyle
- name: cabal update
run: |
cabal update
- name: cabal build
run: |
cabal build all --enable-tests
- name: cabal test
run: |
cabal test all

View File

@ -1,5 +1,7 @@
# ki # ki
[![GitHub CI](https://github.com/mitchellwrosen/ki/workflows/CI/badge.svg)](https://github.com/mitchellwrosen/ki/actions)
`ki` is a lightweight structured-concurrency library inspired by `ki` is a lightweight structured-concurrency library inspired by
[`libdill`](http://libdill.org/), [`trio`](https://github.com/python-trio/trio), [`libdill`](http://libdill.org/), [`trio`](https://github.com/python-trio/trio),
and [`golang.org/pkg/context`](https://golang.org/pkg/context/). and [`golang.org/pkg/context`](https://golang.org/pkg/context/).

View File

@ -6,12 +6,23 @@ common component
default-language: Haskell2010 default-language: Haskell2010
ghc-options: ghc-options:
-Weverything -Weverything
-fno-warn-all-missed-specialisations -Wno-all-missed-specialisations
-fno-warn-implicit-prelude -Wno-implicit-prelude
-fno-warn-missed-specialisations -Wno-missed-specialisations
-fno-warn-missing-import-lists -Wno-missing-import-lists
-fno-warn-safe -Wno-safe
-fno-warn-unsafe -Wno-unsafe
if impl(ghc >= 8.10)
ghc-options:
-Wno-missing-safe-haskell-mode
-Wno-prepositive-qualified-module
ghc-options:
-Werror
-- Putting this after -Werror because of a false positive - I still want to
-- see these
if impl(ghc >= 8.10)
ghc-options:
-Wno-unused-packages
library library
import: component import: component
@ -21,7 +32,12 @@ library
library ki-mtl library ki-mtl
import: component import: component
build-depends: base, generic-lens, ki, mtl, unliftio-core build-depends:
base,
generic-lens,
ki,
mtl,
unliftio-core
hs-source-dirs: src/ki-mtl hs-source-dirs: src/ki-mtl
exposed-modules: Ki.Mtl exposed-modules: Ki.Mtl
visibility: public visibility: public

View File

@ -13,7 +13,7 @@ import Control.Exception (Exception (fromException), MaskingState (..), SomeAsyn
import Control.Monad import Control.Monad
import Data.Foldable import Data.Foldable
import Data.Function import Data.Function
import Data.List import Data.List (intercalate)
import Data.Maybe (isJust) import Data.Maybe (isJust)
import GHC.Clock import GHC.Clock
import Ki import Ki