Compare commits

..

No commits in common. "master" and "v0.3.1" have entirely different histories.

7 changed files with 31 additions and 126 deletions

View file

@ -1,69 +0,0 @@
# 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

View file

@ -1,14 +1,10 @@
# This Travis job script has been generated by a script via # This Travis job script has been generated by a script via
# #
# haskell-ci 'servant-ekg.cabal' # haskell-ci '--output=.travis.yml' '--config=cabal.haskell-ci' 'cabal.project'
#
# To regenerate the script (for example after adjusting tested-with) run
#
# haskell-ci regenerate
# #
# For more information, see https://github.com/haskell-CI/haskell-ci # For more information, see https://github.com/haskell-CI/haskell-ci
# #
# version: 0.10.2 # version: 0.9.20200121
# #
version: ~> 1.0 version: ~> 1.0
language: c language: c
@ -17,6 +13,9 @@ dist: xenial
git: git:
# whether to recursively clone submodules # whether to recursively clone submodules
submodules: false submodules: false
branches:
only:
- master
cache: cache:
directories: directories:
- $HOME/.cabal/packages - $HOME/.cabal/packages
@ -33,23 +32,17 @@ before_cache:
- rm -rfv $CABALHOME/packages/head.hackage - rm -rfv $CABALHOME/packages/head.hackage
jobs: jobs:
include: include:
- compiler: ghc-8.10.2
addons: {"apt":{"sources":[{"sourceline":"deb http://ppa.launchpad.net/hvr/ghc/ubuntu xenial main","key_url":"https://keyserver.ubuntu.com/pks/lookup?op=get&search=0x063dab2bdc0b3f9fcebc378bff3aeacef6f88286"}],"packages":["ghc-8.10.2","cabal-install-3.2"]}}
os: linux
- compiler: ghc-8.8.4
addons: {"apt":{"sources":[{"sourceline":"deb http://ppa.launchpad.net/hvr/ghc/ubuntu xenial main","key_url":"https://keyserver.ubuntu.com/pks/lookup?op=get&search=0x063dab2bdc0b3f9fcebc378bff3aeacef6f88286"}],"packages":["ghc-8.8.4","cabal-install-3.2"]}}
os: linux
- compiler: ghc-8.6.5 - compiler: ghc-8.6.5
addons: {"apt":{"sources":[{"sourceline":"deb http://ppa.launchpad.net/hvr/ghc/ubuntu xenial main","key_url":"https://keyserver.ubuntu.com/pks/lookup?op=get&search=0x063dab2bdc0b3f9fcebc378bff3aeacef6f88286"}],"packages":["ghc-8.6.5","cabal-install-3.2"]}} addons: {"apt":{"sources":[{"sourceline":"deb http://ppa.launchpad.net/hvr/ghc/ubuntu xenial main","key_url":"https://keyserver.ubuntu.com/pks/lookup?op=get&search=0x063dab2bdc0b3f9fcebc378bff3aeacef6f88286"}],"packages":["ghc-8.6.5","cabal-install-3.0"]}}
os: linux os: linux
- compiler: ghc-8.4.4 - compiler: ghc-8.4.4
addons: {"apt":{"sources":[{"sourceline":"deb http://ppa.launchpad.net/hvr/ghc/ubuntu xenial main","key_url":"https://keyserver.ubuntu.com/pks/lookup?op=get&search=0x063dab2bdc0b3f9fcebc378bff3aeacef6f88286"}],"packages":["ghc-8.4.4","cabal-install-3.2"]}} addons: {"apt":{"sources":[{"sourceline":"deb http://ppa.launchpad.net/hvr/ghc/ubuntu xenial main","key_url":"https://keyserver.ubuntu.com/pks/lookup?op=get&search=0x063dab2bdc0b3f9fcebc378bff3aeacef6f88286"}],"packages":["ghc-8.4.4","cabal-install-3.0"]}}
os: linux os: linux
- compiler: ghc-8.2.2 - compiler: ghc-8.2.2
addons: {"apt":{"sources":[{"sourceline":"deb http://ppa.launchpad.net/hvr/ghc/ubuntu xenial main","key_url":"https://keyserver.ubuntu.com/pks/lookup?op=get&search=0x063dab2bdc0b3f9fcebc378bff3aeacef6f88286"}],"packages":["ghc-8.2.2","cabal-install-3.2"]}} addons: {"apt":{"sources":[{"sourceline":"deb http://ppa.launchpad.net/hvr/ghc/ubuntu xenial main","key_url":"https://keyserver.ubuntu.com/pks/lookup?op=get&search=0x063dab2bdc0b3f9fcebc378bff3aeacef6f88286"}],"packages":["ghc-8.2.2","cabal-install-3.0"]}}
os: linux os: linux
- compiler: ghc-8.0.2 - compiler: ghc-8.0.2
addons: {"apt":{"sources":[{"sourceline":"deb http://ppa.launchpad.net/hvr/ghc/ubuntu xenial main","key_url":"https://keyserver.ubuntu.com/pks/lookup?op=get&search=0x063dab2bdc0b3f9fcebc378bff3aeacef6f88286"}],"packages":["ghc-8.0.2","cabal-install-3.2"]}} addons: {"apt":{"sources":[{"sourceline":"deb http://ppa.launchpad.net/hvr/ghc/ubuntu xenial main","key_url":"https://keyserver.ubuntu.com/pks/lookup?op=get&search=0x063dab2bdc0b3f9fcebc378bff3aeacef6f88286"}],"packages":["ghc-8.0.2","cabal-install-3.0"]}}
os: linux os: linux
before_install: before_install:
- HC=$(echo "/opt/$CC/bin/ghc" | sed 's/-/\//') - HC=$(echo "/opt/$CC/bin/ghc" | sed 's/-/\//')
@ -99,8 +92,6 @@ install:
- touch cabal.project - touch cabal.project
- | - |
echo "packages: ." >> cabal.project echo "packages: ." >> cabal.project
- if [ $HCNUMVER -ge 80200 ] ; then echo 'package servant-ekg' >> cabal.project ; fi
- "if [ $HCNUMVER -ge 80200 ] ; then echo ' ghc-options: -Werror=missing-methods' >> cabal.project ; fi"
- | - |
- "for pkg in $($HCPKG list --simple-output); do echo $pkg | sed 's/-[^-]*$//' | (grep -vE -- '^(servant-ekg)$' || true) | sed 's/^/constraints: /' | sed 's/$/ installed/' >> cabal.project.local; done" - "for pkg in $($HCPKG list --simple-output); do echo $pkg | sed 's/-[^-]*$//' | (grep -vE -- '^(servant-ekg)$' || true) | sed 's/^/constraints: /' | sed 's/$/ installed/' >> cabal.project.local; done"
- cat cabal.project || true - cat cabal.project || true
@ -109,8 +100,8 @@ install:
- ${CABAL} v2-freeze $WITHCOMPILER ${TEST} ${BENCH} - ${CABAL} v2-freeze $WITHCOMPILER ${TEST} ${BENCH}
- "cat cabal.project.freeze | sed -E 's/^(constraints: *| *)//' | sed 's/any.//'" - "cat cabal.project.freeze | sed -E 's/^(constraints: *| *)//' | sed 's/any.//'"
- rm cabal.project.freeze - rm cabal.project.freeze
- travis_wait 40 ${CABAL} v2-build $WITHCOMPILER ${TEST} ${BENCH} --dep -j2 all - ${CABAL} v2-build $WITHCOMPILER ${TEST} ${BENCH} --dep -j2 all
- travis_wait 40 ${CABAL} v2-build $WITHCOMPILER --disable-tests --disable-benchmarks --dep -j2 all - ${CABAL} v2-build $WITHCOMPILER --disable-tests --disable-benchmarks --dep -j2 all
script: script:
- DISTDIR=$(mktemp -d /tmp/dist-test.XXXX) - DISTDIR=$(mktemp -d /tmp/dist-test.XXXX)
# Packaging... # Packaging...
@ -126,8 +117,6 @@ script:
- touch cabal.project - touch cabal.project
- | - |
echo "packages: ${PKGDIR_servant_ekg}" >> cabal.project echo "packages: ${PKGDIR_servant_ekg}" >> cabal.project
- if [ $HCNUMVER -ge 80200 ] ; then echo 'package servant-ekg' >> cabal.project ; fi
- "if [ $HCNUMVER -ge 80200 ] ; then echo ' ghc-options: -Werror=missing-methods' >> cabal.project ; fi"
- | - |
- "for pkg in $($HCPKG list --simple-output); do echo $pkg | sed 's/-[^-]*$//' | (grep -vE -- '^(servant-ekg)$' || true) | sed 's/^/constraints: /' | sed 's/$/ installed/' >> cabal.project.local; done" - "for pkg in $($HCPKG list --simple-output); do echo $pkg | sed 's/-[^-]*$//' | (grep -vE -- '^(servant-ekg)$' || true) | sed 's/^/constraints: /' | sed 's/$/ installed/' >> cabal.project.local; done"
- cat cabal.project || true - cat cabal.project || true
@ -147,6 +136,14 @@ script:
# Building without installed constraints for packages in global-db... # Building without installed constraints for packages in global-db...
- rm -f cabal.project.local - rm -f cabal.project.local
- ${CABAL} v2-build $WITHCOMPILER --disable-tests --disable-benchmarks all - ${CABAL} v2-build $WITHCOMPILER --disable-tests --disable-benchmarks all
# Constraint sets
- rm -rf cabal.project.local
# Constraint set servant-0.15
- ${CABAL} v2-build $WITHCOMPILER --disable-tests --disable-benchmarks --constraint='servant ==0.15.*' all
# Constraint set servant-0.16
- ${CABAL} v2-build $WITHCOMPILER --disable-tests --disable-benchmarks --constraint='servant ==0.16.*' all
# Constraint set servant-0.17
- ${CABAL} v2-build $WITHCOMPILER --disable-tests --disable-benchmarks --constraint='servant ==0.17.*' all
# REGENDATA ("0.10.2",["servant-ekg.cabal"]) # REGENDATA ("0.9.20200121",["--output=.travis.yml","--config=cabal.haskell-ci","cabal.project"])
# EOF # EOF

View file

@ -1,7 +1,6 @@
# servant-ekg # servant-ekg
[![Build Status](https://travis-ci.org/haskell-servant/servant-ekg.png)](https://travis-ci.org/haskell-servant/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 # Servant Performance Counters

View file

@ -11,7 +11,3 @@ constraint-set servant-0.16
constraint-set servant-0.17 constraint-set servant-0.17
ghc: >= 8.0 && <8.10 ghc: >= 8.0 && <8.10
constraints: servant ==0.17.* constraints: servant ==0.17.*
constraint-set servant-0.18
ghc: >= 8.0 && <9.0
constraints: servant ==0.18.*

View file

@ -1 +0,0 @@
tests: True

View file

@ -117,12 +117,6 @@ instance HasEndpoint (sub :: *) => HasEndpoint (Header' mods h a :> sub) where
getEndpoint _ = getEndpoint (Proxy :: Proxy sub) getEndpoint _ = getEndpoint (Proxy :: Proxy sub)
enumerateEndpoints _ = enumerateEndpoints (Proxy :: Proxy sub) enumerateEndpoints _ = enumerateEndpoints (Proxy :: Proxy sub)
#if MIN_VERSION_servant(0,18,2)
instance HasEndpoint (sub :: *) => HasEndpoint (Fragment a :> sub) where
getEndpoint _ = getEndpoint (Proxy :: Proxy sub)
enumerateEndpoints _ = enumerateEndpoints (Proxy :: Proxy sub)
#endif
instance HasEndpoint (sub :: *) => HasEndpoint (QueryParam' mods (h :: Symbol) a :> sub) where instance HasEndpoint (sub :: *) => HasEndpoint (QueryParam' mods (h :: Symbol) a :> sub) where
getEndpoint _ = getEndpoint (Proxy :: Proxy sub) getEndpoint _ = getEndpoint (Proxy :: Proxy sub)
enumerateEndpoints _ = enumerateEndpoints (Proxy :: Proxy sub) enumerateEndpoints _ = enumerateEndpoints (Proxy :: Proxy sub)
@ -185,17 +179,6 @@ instance ReflectMethod method => HasEndpoint (NoContentVerb method) where
where method = reflectMethod (Proxy :: Proxy method) where method = reflectMethod (Proxy :: Proxy method)
#endif #endif
#if MIN_VERSION_servant(0,18,1)
instance ReflectMethod method => HasEndpoint (UVerb method contentType as) where
getEndpoint _ req = case pathInfo req of
[] | requestMethod req == method -> Just (APIEndpoint [] method)
_ -> Nothing
where method = reflectMethod (Proxy :: Proxy method)
enumerateEndpoints _ = [APIEndpoint mempty method]
where method = reflectMethod (Proxy :: Proxy method)
#endif
instance ReflectMethod method => HasEndpoint (Stream method status framing ct a) where instance ReflectMethod method => HasEndpoint (Stream method status framing ct a) where
getEndpoint _ req = case pathInfo req of getEndpoint _ req = case pathInfo req of
[] | requestMethod req == method -> Just (APIEndpoint [] method) [] | requestMethod req == method -> Just (APIEndpoint [] method)

View file

@ -1,6 +1,6 @@
cabal-version: >=1.10 cabal-version: >=1.10
name: servant-ekg name: servant-ekg
version: 0.3.2 version: 0.3.1
synopsis: Helpers for using ekg with servant synopsis: Helpers for using ekg with servant
description: Helpers for using ekg with servant, e.g.. counters per endpoint. description: Helpers for using ekg with servant, e.g.. counters per endpoint.
license: BSD3 license: BSD3
@ -13,7 +13,7 @@ maintainer:
category: Servant, Web, System category: Servant, Web, System
build-type: Simple build-type: Simple
tested-with: GHC ==8.6.5 || ==8.8.4 || ==8.10.7 tested-with: GHC ==8.0.2 || ==8.2.2 || ==8.4.4 || ==8.6.5
extra-source-files: README.md CHANGELOG.md extra-source-files: README.md CHANGELOG.md
source-repository HEAD source-repository HEAD
@ -25,15 +25,15 @@ library
other-modules: Servant.Ekg.Internal other-modules: Servant.Ekg.Internal
hs-source-dirs: lib hs-source-dirs: lib
build-depends: build-depends:
base >=4.9 && <4.16 base >=4.9 && <4.13
, ekg-core >=0.1.1.4 && <0.2 , ekg-core >=0.1.1.4 && <0.2
, http-types >=0.12.2 && <0.13 , http-types >=0.12.2 && <0.13
, hashable >=1.2.7.0 && <1.4 , hashable >=1.2.7.0 && <1.4
, servant >=0.14 && <0.20 , servant >=0.14 && <0.18
, text >=1.2.3.0 && <1.3 , text >=1.2.3.0 && <1.3
, time >=1.6.0.1 && <1.12 , time >=1.6.0.1 && <1.9
, unordered-containers >=0.2.9.0 && <0.3 , unordered-containers >=0.2.9.0 && <0.3
, wai >=3.2.0 && <3.3 , wai >=3.2.0 && <3.3
default-language: Haskell2010 default-language: Haskell2010