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
[![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
[`libdill`](http://libdill.org/), [`trio`](https://github.com/python-trio/trio),
and [`golang.org/pkg/context`](https://golang.org/pkg/context/).

View File

@ -6,12 +6,23 @@ common component
default-language: Haskell2010
ghc-options:
-Weverything
-fno-warn-all-missed-specialisations
-fno-warn-implicit-prelude
-fno-warn-missed-specialisations
-fno-warn-missing-import-lists
-fno-warn-safe
-fno-warn-unsafe
-Wno-all-missed-specialisations
-Wno-implicit-prelude
-Wno-missed-specialisations
-Wno-missing-import-lists
-Wno-safe
-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
import: component
@ -21,7 +32,12 @@ library
library ki-mtl
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
exposed-modules: Ki.Mtl
visibility: public

View File

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