Skip to content

Upgrade to LTS 13.12 and remove lingering JWT package #46

New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Merged
merged 1 commit into from
Mar 24, 2019
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
73 changes: 48 additions & 25 deletions .circleci/config.yml
Original file line number Diff line number Diff line change
Expand Up @@ -4,35 +4,55 @@
#
version: 2
jobs:
build-test-and-publish:
publish:
docker:
- image: fpco/stack-build-small:lts
- image: postgres:11-alpine
environment:
POSTGRES_DB: postgres_ws_test
POSTGRES_USER: root
steps:
- checkout
- restore_cache:
name: Restore Cached Dependencies
keys:
- postgres-websockets-v1-{{ checksum "postgres-websockets.cabal" }}
- attach_workspace:
at: ws
- run:
name: Install curl
command: apt-get update && apt-get -qq -y install curl libpq-dev
- run:
name: Download and run hlint
command: curl -sSL https://raw.github.com/ndmitchell/hlint/master/misc/run.sh | sh -s .
- run:
name: Download ghr
command: |
curl -sSLO https://github.com/tcnksm/ghr/releases/download/v0.12.0/ghr_v0.12.0_linux_386.tar.gz
curl -sSLO https://github.com/tcnksm/ghr/releases/download/v0.12.0/v0.12.0_SHASUMS
sha256sum --check --ignore-missing v0.12.0_SHASUMS
tar --strip-components=1 -zxvf ghr_v0.12.0_linux_386.tar.gz ghr_v0.12.0_linux_386/ghr
- run:
name: Publish Release on GitHub
command: |
mkdir result
cp ws/postgres-websockets.sha256 ws/postgres-websockets ./result/
VERSION=$(awk '/^version: / { print $2 };' < ws/postgres-websockets.cabal)
./ghr -t ${GITHUB_TOKEN} -u ${CIRCLE_PROJECT_USERNAME} -r ${CIRCLE_PROJECT_REPONAME} -c ${CIRCLE_SHA1} -delete ${VERSION} ./result/

build-test:
docker:
- image: fpco/stack-build:lts-13.14
- image: postgres:11-alpine
environment:
POSTGRES_DB: postgres_ws_test
POSTGRES_USER: root
steps:
- checkout
- restore_cache:
name: Restore Cached Dependencies
keys:
- postgres-websockets-v2-{{ checksum "stack.yaml" }}
- run:
name: Resolve and update dependencies
command: stack setup
- run:
name: Install Cabal and hlint
command: stack install --system-ghc --resolver=lts-13.14 Cabal hlint
- save_cache:
name: Cache Dependencies
key: postgres-websockets-v2-{{ checksum "stack.yaml" }}
paths:
- ".stack"
- ".stack-work"
- run:
name: Build the dependencies and the library
command: stack --silent build
Expand All @@ -44,28 +64,31 @@ jobs:
command: stack --silent install
- run:
name: Calculate and save checksum
command: sha256sum ~/.local/bin/postgres-websockets > /root/postgres-websockets.sha256
command: sha256sum ~/.local/bin/postgres-websockets > ~/.local/bin/postgres-websockets.sha256
- run:
name: Save cabal file to preserve version
command: cp postgres-websockets.cabal ~/.local/bin/
- save_cache:
name: Cache Dependencies
key: postgres-websockets-v1-{{ checksum "postgres-websockets.cabal" }}
key: postgres-websockets-v2-{{ checksum "stack.yaml" }}
paths:
- ".stack"
- ".stack-work"
- run:
name: Publish Release on GitHub
command: |
mkdir /root/result/
cp /root/postgres-websockets.sha256 /root/.local/bin/postgres-websockets /root/result/
VERSION=$(awk '/^version: / { print $2 };' < postgres-websockets.cabal)
./ghr -t ${GITHUB_TOKEN} -u ${CIRCLE_PROJECT_USERNAME} -r ${CIRCLE_PROJECT_REPONAME} -c ${CIRCLE_SHA1} -delete ${VERSION} /root/result/
- persist_to_workspace:
root: ~/.local/bin/
paths:
- "postgres-websockets"
- "postgres-websockets.sha256"
- "postgres-websockets.cabal"

workflows:
version: 2
main:
jobs:
- build-test-and-publish:
- build-test
- publish:
requires:
- build-test
filters:
branches:
only: master
tags:
only: /^[\d.]+$/
3 changes: 1 addition & 2 deletions postgres-websockets.cabal
Original file line number Diff line number Diff line change
Expand Up @@ -36,10 +36,9 @@ library
, postgresql-libpq >= 0.9 && < 1.0
, aeson >= 0.11
, protolude >= 0.2
, jwt >= 0.7.2 && < 0.8
, hasql >= 0.19
, either
, stm-containers == 0.2.16
, stm-containers
, stm
, retry
, stringsearch
Expand Down
2 changes: 1 addition & 1 deletion src/PostgresWebsockets/Broadcast.hs
Original file line number Diff line number Diff line change
Expand Up @@ -18,7 +18,7 @@ module PostgresWebsockets.Broadcast ( Multiplexer (src)
) where

import Protolude
import qualified STMContainers.Map as M
import qualified StmContainers.Map as M
import Control.Concurrent.STM.TChan
import Control.Concurrent.STM.TQueue

Expand Down
9 changes: 6 additions & 3 deletions stack.yaml
Original file line number Diff line number Diff line change
@@ -1,6 +1,9 @@
resolver: lts-12.14
resolver: lts-13.14
extra-deps:
- envparse-0.4.1@sha256:989902e6368532548f61de1fa245ad2b39176cddd8743b20071af519a709ce30
- envparse-0.4.1@sha256:989902e6368532548f61de1fa245ad2b39176cddd8743b20071af519a709ce30
- stm-containers-1.1.0.2@sha256:8976df591e61f378ef29dc0443dbe2d5d34818c898093af3ca138ea1d013b5eb
- stm-hamt-1.2.0.2@sha256:18126db7bf2d9c967a6020c677b3005dd957a4c39d69aeaea3c29c90de8f6124
- primitive-extras-0.7.1@sha256:23905c57089418b1a2d324cfee3e81bbd5a344a0fa56a827867b2dce275fdb5e

ghc-options:
postgres-websockets: -O2 -Wall -fwarn-identities -fno-warn-redundant-constraints
postgres-websockets: -Wall -fwarn-identities -fno-warn-redundant-constraints