Skip to content

Commit 9b2cbd3

Browse files
authored
Merge pull request #1 from sorki/srk/chores
Chores, CI
2 parents fc4db4e + bd5cb6a commit 9b2cbd3

File tree

8 files changed

+96
-4
lines changed

8 files changed

+96
-4
lines changed

.github/workflows/ci.yaml

Lines changed: 53 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,53 @@
1+
# Code generated by dhall-to-yaml. DO NOT EDIT.
2+
jobs:
3+
build:
4+
name: "GHC ${{ matrix.ghc }}, Cabal ${{ matrix.cabal }}, OS ${{ matrix.os }}"
5+
"runs-on": "${{ matrix.os }}"
6+
steps:
7+
- name: "Install libzrmq3-dev"
8+
run: "sudo apt install libzmq3-dev"
9+
- uses: "actions/checkout@v4"
10+
with:
11+
submodules: recursive
12+
- id: "setup-haskell-cabal"
13+
uses: "haskell-actions/setup@v2"
14+
with:
15+
"cabal-version": "${{ matrix.cabal }}"
16+
"ghc-version": "${{ matrix.ghc }}"
17+
- name: Update Hackage repository
18+
run: cabal update
19+
- name: cabal.project.local.ci
20+
run: |
21+
if [ -e cabal.project.local.ci ]; then
22+
cp cabal.project.local.ci cabal.project.local
23+
fi
24+
- name: freeze
25+
run: "cabal freeze --enable-tests --enable-benchmarks"
26+
- uses: "actions/cache@v3"
27+
with:
28+
key: "${{ matrix.os }}-${{ matrix.ghc }}-${{ matrix.cabal}}-${{ hashFiles('cabal.project.freeze') }}"
29+
path: |
30+
${{ steps.setup-haskell-cabal.outputs.cabal-store }}
31+
dist-newstyle
32+
- name: Install dependencies
33+
run: "cabal build all --enable-tests --enable-benchmarks --only-dependencies"
34+
- name: build all
35+
run: "cabal build all --enable-tests --enable-benchmarks"
36+
- name: test all
37+
run: "cabal test all --enable-tests"
38+
- name: haddock all
39+
run: cabal haddock all
40+
strategy:
41+
matrix:
42+
cabal:
43+
- '3.10'
44+
ghc:
45+
- '9.6.3'
46+
os:
47+
- "ubuntu-latest"
48+
name: Haskell CI
49+
'on':
50+
pull_request: {}
51+
push: {}
52+
schedule:
53+
- cron: "4 20 10 * *"

CHANGELOG.md

Lines changed: 4 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1,3 +1,7 @@
1+
# Version [0.1.5.1](https://github.com/sorki/haskell-zre/compare/0.1.5.0...0.1.5.1) (2023-11-28)
2+
3+
* Fix missing `void` import for GHC9.6.3
4+
15
# Version [0.1.5.0](https://github.com/sorki/haskell-zre/compare/0.1.4.0...0.1.5.0) (2022-02-28)
26

37
* Use `attoparsec 0.14`

ci.dhall

Lines changed: 17 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,17 @@
1+
let haskellCi =
2+
https://raw.githubusercontent.com/sorki/github-actions-dhall/main/haskell-ci.dhall
3+
4+
let defSteps = haskellCi.defaultCabalSteps
5+
6+
in haskellCi.generalCi
7+
( defSteps
8+
with extraSteps.pre
9+
=
10+
defSteps.extraSteps.pre
11+
# [ haskellCi.BuildStep.Name
12+
{ name = "Install libzrmq3-dev"
13+
, run = "sudo apt install libzmq3-dev"
14+
}
15+
]
16+
)
17+
haskellCi.DhallMatrix::{=}

ci.sh

Lines changed: 13 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,13 @@
1+
#!/usr/bin/env bash
2+
# Script by @fisx
3+
4+
set -eo pipefail
5+
6+
# cd into the dir where this script is placed
7+
cd "$( dirname "${BASH_SOURCE[0]}" )"
8+
9+
echo "regenerating .github/workflows/ci.yaml..."
10+
11+
mkdir -p .github/workflows/
12+
which dhall-to-yaml-ng || cabal install dhall-yaml
13+
dhall-to-yaml-ng --generated-comment --file ci.dhall > .github/workflows/ci.yaml

src/Network/ZRE.hs

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -91,7 +91,7 @@ runIface s port (iface, ipv4, ipv6) = do
9191
runZre :: ZRE a -> IO ()
9292
runZre app = runZreParse (pure ()) (const app)
9393

94-
-- | Run with config file loaded from the enviornment variable ENVCFG
94+
-- | Run with config file loaded from the environment variable ENVCFG
9595
-- (@/etc/zre.conf@ or @~/.zre.conf@), possibly overriden by command-line options.
9696
--
9797
-- Accepts another `optparse-applicative` `Parser` for extending

src/Network/ZRE/Parse.hs

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -25,6 +25,7 @@ parseCmd :: Parser API
2525
parseCmd =
2626
DoJoin . mkGroup <$> (string "join" *> lskip *> word)
2727
<|> DoLeave . mkGroup <$> (string "leave" *> lskip *> word)
28+
-- TODO quoted shouts
2829
<|> DoShout <$> (string "shout" *> lskip *> (mkGroup <$> word)) <*> (lskip *> word)
2930
<|> DoWhisper <$> (string "whisper" *> uuid) <*> lw
3031
<|> DoDebug <$> (string "debug" *> pure True)

src/Network/ZRE/Types.hs

Lines changed: 6 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1,9 +1,9 @@
11
{-# LANGUAGE OverloadedStrings #-}
22
{-# LANGUAGE GeneralizedNewtypeDeriving #-}
3-
43
{-# LANGUAGE MultiParamTypeClasses #-}
54
{-# LANGUAGE TypeFamilies #-}
65
{-# OPTIONS_GHC -fno-warn-orphans #-}
6+
77
module Network.ZRE.Types where
88

99
import Control.Monad.Reader
@@ -20,6 +20,7 @@ import Data.Default
2020
import Data.ZRE hiding (Shout, Whisper) -- (Name, Seq, Group, Groups, GroupSeq, Headers, Content, ZRECmd, ZREMsg)
2121
import System.ZMQ4.Endpoint
2222

23+
import qualified Control.Monad
2324

2425
isec :: (Num a) => a -> a
2526
isec = (*1000000)
@@ -153,7 +154,10 @@ readZ = do
153154
unReadZ :: Event -> ZRE ()
154155
unReadZ x = do
155156
(e, _) <- ask
156-
void $ liftIO $ atomically $ unGetTBQueue e x
157+
Control.Monad.void
158+
$ liftIO
159+
$ atomically
160+
$ unGetTBQueue e x
157161

158162
writeZ :: API -> ZRE ()
159163
writeZ x = do

zre.cabal

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,5 @@
11
name: zre
2-
version: 0.1.5.0
2+
version: 0.1.5.1
33
synopsis: ZRE protocol implementation
44
description: Peer-to-peer local area networking with reliable group messaging
55
and automatic peer discovery.

0 commit comments

Comments
 (0)