From b9c1b9fdd15da28fb66200fcd36f4a0359667008 Mon Sep 17 00:00:00 2001 From: Peter Becich Date: Sat, 22 Jan 2022 15:19:49 -0800 Subject: [PATCH 1/4] basic GitHub Actions --- .github/workflows/ci.yml | 69 ++++++++++++++++++++++++++++++++++++++++ README.md | 1 + 2 files changed, 70 insertions(+) create mode 100644 .github/workflows/ci.yml diff --git a/.github/workflows/ci.yml b/.github/workflows/ci.yml new file mode 100644 index 0000000..4f8cf4c --- /dev/null +++ b/.github/workflows/ci.yml @@ -0,0 +1,69 @@ +# modified from https://github.com/jgm/pandoc/blob/master/.github/workflows/ci.yml +name: CI + +on: + push: + branches: + - '**' + paths-ignore: [] + pull_request: + paths-ignore: [] + +jobs: + linux: + + runs-on: ubuntu-20.04 + strategy: + fail-fast: false + matrix: + versions: + - ghc: '8.6.5' + cabal: '3.6' + - ghc: '8.8.4' + cabal: '3.6' + - ghc: '8.10.7' + cabal: '3.6' + - ghc: '9.0.2' + cabal: '3.6' + + steps: + - uses: actions/checkout@v2 + + # need to install older cabal/ghc versions from ppa repository + + - name: Install recent cabal/ghc + uses: haskell/actions/setup@v1 + with: + ghc-version: ${{ matrix.versions.ghc }} + cabal-version: ${{ matrix.versions.cabal }} + + # declare/restore cached things + # caching doesn't work for scheduled runs yet + # https://github.com/actions/cache/issues/63 + + - name: Cache cabal global package db + id: cabal-global + uses: actions/cache@v2 + with: + path: | + ~/.cabal + key: ${{ runner.os }}-${{ matrix.versions.ghc }}-${{ matrix.versions.cabal }}-cabal-global-${{ hashFiles('cabal.project') }} + + - name: Cache cabal work + id: cabal-local + uses: actions/cache@v2 + with: + path: | + dist-newstyle + key: ${{ runner.os }}-${{ matrix.versions.ghc }}-${{ matrix.versions.cabal }}-cabal-local + + - name: Install dependencies + run: | + cabal update + cabal build all --dependencies-only --enable-tests --disable-optimization + - name: Build + run: | + cabal build all --enable-tests --disable-optimization 2>&1 | tee build.log + - name: Test + run: | + cabal test all --disable-optimization diff --git a/README.md b/README.md index a9e17dd..74bfbab 100644 --- a/README.md +++ b/README.md @@ -1,6 +1,7 @@ # servant-ekg [![Build Status](https://travis-ci.org/haskell-servant/servant-ekg.png)](https://travis-ci.org/haskell-servant/servant-ekg) +[![Build status](https://github.com/haskell-servant/servant-ekg/actions/workflows/ci.yml/badge.svg)](https://github.com/haskell-servant/servant-ekg/actions/workflows/ci.yml) # Servant Performance Counters From 655dd49ed17042614cb06abf92d8afcb7c8070fe Mon Sep 17 00:00:00 2001 From: Peter Becich Date: Sun, 23 Jan 2022 23:38:30 -0800 Subject: [PATCH 2/4] fix tests --- cabal.project.local | 1 + 1 file changed, 1 insertion(+) create mode 100644 cabal.project.local diff --git a/cabal.project.local b/cabal.project.local new file mode 100644 index 0000000..0718abb --- /dev/null +++ b/cabal.project.local @@ -0,0 +1 @@ +tests: True \ No newline at end of file From 149dbf8e337d34acf0b3ce3563ef07df70dc88b9 Mon Sep 17 00:00:00 2001 From: Peter Becich Date: Sat, 29 Jan 2022 16:36:48 -0800 Subject: [PATCH 3/4] provide missing instance to fix tests --- lib/Servant/Ekg.hs | 4 ++++ 1 file changed, 4 insertions(+) diff --git a/lib/Servant/Ekg.hs b/lib/Servant/Ekg.hs index 31c074a..5676aa5 100644 --- a/lib/Servant/Ekg.hs +++ b/lib/Servant/Ekg.hs @@ -117,6 +117,10 @@ instance HasEndpoint (sub :: *) => HasEndpoint (Header' mods h a :> sub) where getEndpoint _ = getEndpoint (Proxy :: Proxy sub) enumerateEndpoints _ = enumerateEndpoints (Proxy :: Proxy sub) +instance HasEndpoint (sub :: *) => HasEndpoint (Fragment a :> sub) where + getEndpoint _ = getEndpoint (Proxy :: Proxy sub) + enumerateEndpoints _ = enumerateEndpoints (Proxy :: Proxy sub) + instance HasEndpoint (sub :: *) => HasEndpoint (QueryParam' mods (h :: Symbol) a :> sub) where getEndpoint _ = getEndpoint (Proxy :: Proxy sub) enumerateEndpoints _ = enumerateEndpoints (Proxy :: Proxy sub) From 638f67facdcc8cb55f56cfcca9071e9d420bf974 Mon Sep 17 00:00:00 2001 From: Peter Becich Date: Mon, 31 Jan 2022 22:43:07 -0800 Subject: [PATCH 4/4] no CI coverage for GHC 8.0, 8.2, 8.4, 9.0 --- .github/workflows/ci.yml | 4 ++-- servant-ekg.cabal | 2 +- 2 files changed, 3 insertions(+), 3 deletions(-) diff --git a/.github/workflows/ci.yml b/.github/workflows/ci.yml index 4f8cf4c..54d9550 100644 --- a/.github/workflows/ci.yml +++ b/.github/workflows/ci.yml @@ -23,8 +23,8 @@ jobs: cabal: '3.6' - ghc: '8.10.7' cabal: '3.6' - - ghc: '9.0.2' - cabal: '3.6' + # - ghc: '9.0.2' + # cabal: '3.6' steps: - uses: actions/checkout@v2 diff --git a/servant-ekg.cabal b/servant-ekg.cabal index 44c18ef..e9402bb 100644 --- a/servant-ekg.cabal +++ b/servant-ekg.cabal @@ -13,7 +13,7 @@ maintainer: category: Servant, Web, System build-type: Simple -tested-with: GHC ==8.0.2 || ==8.2.2 || ==8.4.4 || ==8.6.5 || ==8.8.4 || ==8.10.2 +tested-with: GHC ==8.6.5 || ==8.8.4 || ==8.10.7 extra-source-files: README.md CHANGELOG.md source-repository HEAD