Skip to content

Commit 6be6274

Browse files
authored
Merge pull request #2 from alphaHeavy/copilot/fix-6f1a3533-c195-482a-9a98-d87869da03e5
Add GitHub Actions CI and fix build compatibility issues
2 parents 7fcfbc0 + 5f9c439 commit 6be6274

File tree

7 files changed

+48
-3
lines changed

7 files changed

+48
-3
lines changed

.github/workflows/ci.yml

Lines changed: 42 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,42 @@
1+
name: CI
2+
3+
on:
4+
push:
5+
branches: [ master ]
6+
pull_request:
7+
branches: [ master ]
8+
9+
jobs:
10+
build:
11+
runs-on: ubuntu-latest
12+
13+
steps:
14+
- uses: actions/checkout@v4
15+
16+
- name: Install QuickFIX C++ library
17+
run: |
18+
sudo apt-get update
19+
sudo apt-get install -y libquickfix-dev
20+
21+
- name: Setup Haskell
22+
uses: haskell-actions/setup@v2
23+
with:
24+
ghc-version: '9.4'
25+
cabal-version: '3.10'
26+
27+
- name: Cache Cabal packages
28+
uses: actions/cache@v4
29+
with:
30+
path: |
31+
~/.cabal/packages
32+
~/.cabal/store
33+
dist-newstyle
34+
key: ${{ runner.os }}-cabal-${{ hashFiles('**/*.cabal') }}
35+
restore-keys: |
36+
${{ runner.os }}-cabal-
37+
38+
- name: Update Cabal package list
39+
run: cabal update
40+
41+
- name: Build
42+
run: cabal build

.gitignore

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -5,6 +5,7 @@
55

66
# GHC build goo
77
dist/
8+
dist-newstyle/
89
docs/
910
out/
1011
*.dump-*

alphaheavy-quickfix.cabal

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -34,7 +34,7 @@ Library
3434

3535
HS-Source-Dirs: src
3636

37-
GHC-Options: -Wall
37+
GHC-Options: -Wall -optcxx-std=c++11
3838
CC-Options: -O2 -ggdb
3939

4040
C-Sources: cbits/QuickFIXThunks.cpp

cbits/QuickFIXThunks.cpp

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -277,5 +277,5 @@ char* sessionDisconnect(const FIX::SessionID& sid)
277277
extern "C"
278278
char* sessionString(const FIX::SessionID& sid)
279279
{
280-
strdup(sid.toStringFrozen().c_str());
280+
return strdup(sid.toStringFrozen().c_str());
281281
}

src/AlphaHeavy/QuickFIX/GReceive.hs

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -4,6 +4,7 @@
44
{-# LANGUAGE KindSignatures #-}
55
{-# LANGUAGE ScopedTypeVariables #-}
66
{-# LANGUAGE TypeOperators #-}
7+
{-# LANGUAGE UndecidableInstances #-}
78

89
module AlphaHeavy.QuickFIX.GReceive where
910

src/AlphaHeavy/QuickFIX/GSend.hs

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -4,6 +4,7 @@
44
{-# LANGUAGE KindSignatures #-}
55
{-# LANGUAGE ScopedTypeVariables #-}
66
{-# LANGUAGE TypeOperators #-}
7+
{-# LANGUAGE UndecidableInstances #-}
78

89
module AlphaHeavy.QuickFIX.GSend where
910

src/AlphaHeavy/QuickFIX/GetMessageField.hs

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -56,7 +56,7 @@ instance GetMessageField ByteString where
5656
instance GetMessageField Data.Time.UTCTime where
5757
getMessageField msg fid = do
5858
txt <- getMessageField msg fid
59-
case parseTime defaultTimeLocale "%Y%m%d-%H:%M:%S" txt of
59+
case parseTimeM True defaultTimeLocale "%Y%m%d-%H:%M:%S" txt of
6060
Just val -> return $! val
6161
Nothing -> throwIO . IncorrectTagValue fid $ txt
6262

0 commit comments

Comments
 (0)