This repository has been archived by the owner on Sep 3, 2024. It is now read-only.
-
Notifications
You must be signed in to change notification settings - Fork 11
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Bulk improvements, including: * Expanded gitignore * Replace deprecated error-handling functions by the recommended ones from the `exceptions` package * Updated changelog * Test suite and GIthub Actions-based continuous integration
- Loading branch information
1 parent
cabcecb
commit 06ce2e9
Showing
9 changed files
with
153 additions
and
53 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,57 @@ | ||
name: Continuous Integration | ||
|
||
on: [push, pull_request] | ||
|
||
jobs: | ||
continuous-integration: | ||
strategy: | ||
matrix: | ||
ghc-version: | ||
- "9.0.2" | ||
- "9.2.8" | ||
- "9.4.5" | ||
- "9.6.4" | ||
- "9.8.2" | ||
|
||
runs-on: ubuntu-latest | ||
|
||
steps: | ||
- uses: actions/checkout@v4 | ||
|
||
- name: Install cabal/ghc | ||
uses: haskell-actions/setup@v2 | ||
id: setup-haskell | ||
with: | ||
ghc-version: ${{ matrix.ghc-version }} | ||
cabal-version: '3.10.3.0' | ||
|
||
- name: Generate freeze file | ||
run: | | ||
cabal update | ||
cabal configure --disable-optimization | ||
cabal freeze | ||
# 'cabal freeze' will use the nearest index state which might not be exactly equal | ||
# to the index state specified in 'cabal.project' | ||
sed '/^index-state: /d' cabal.project.freeze > dependencies-versions | ||
- name: Cache cabal work | ||
uses: actions/cache@v4 | ||
with: | ||
path: | | ||
dist-newstyle | ||
${{ steps.setup-haskell.outputs.cabal-store }} | ||
# We are using the hash of 'cabal.project.local' so that different levels | ||
# of optimizations are cached separately | ||
key: ${{ runner.os }}-${{ hashFiles('dependencies-versions', 'cabal.project', 'cabal.project.local') }}-cabal-install | ||
|
||
- name: Build dependencies only | ||
run: | | ||
cabal build --enable-tests --only-dependencies | ||
- name: Build this package | ||
run: | | ||
cabal build --enable-tests | ||
- name: Run tests | ||
run: | | ||
cabal test |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,4 +1,23 @@ | ||
dist/ | ||
.cabal-sandbox | ||
dist | ||
dist-* | ||
cabal-dev | ||
*.o | ||
*.hi | ||
*.hie | ||
*.chi | ||
*.chs.h | ||
*.dyn_o | ||
*.dyn_hi | ||
.hpc | ||
.hsenv | ||
.cabal-sandbox/ | ||
cabal.sandbox.config | ||
.stack* | ||
*.prof | ||
*.aux | ||
*.hp | ||
*.eventlog | ||
.stack-work/ | ||
cabal.project.local | ||
cabal.project.local~ | ||
.HTF/ | ||
.ghc.environment.* |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,3 +1,8 @@ | ||
unreleased 0.3.0 | ||
|
||
* Breaking change: update dependency bounds to require network-3.0. | ||
* Use various functions from the `exceptions` package instead of the deprecated ones from `distributed-process`. | ||
|
||
2017-08-22 Facundo Domínguez <[email protected]> 0.2.4 | ||
|
||
* Update dependency bounds to build with ghc-8.2.1. | ||
|
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,12 @@ | ||
packages: *.cabal | ||
|
||
test-show-details: streaming | ||
tests: True | ||
|
||
-- We require a version of distributed-process which is | ||
-- support a wider range of dependency versions, notably for | ||
-- `hashable` | ||
source-repository-package | ||
type: git | ||
location: https://github.com/haskell-distributed/distributed-process | ||
tag: fe963293cd82afcbba61fc877ba2a6137cbaf469 |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,44 @@ | ||
|
||
|
||
import Control.Concurrent (forkIO, threadDelay) | ||
import qualified Control.Concurrent.MVar as MVar | ||
import Control.Distributed.Process (NodeId, Process, liftIO) | ||
import Control.Distributed.Process.Node (initRemoteTable) | ||
import Control.Distributed.Process.Backend.SimpleLocalnet | ||
import Control.Monad (forM_) | ||
import qualified Data.List as List | ||
import Test.Tasty (TestTree, defaultMain, testGroup) | ||
import Test.Tasty.HUnit (assertEqual, testCase) | ||
|
||
main :: IO () | ||
main = defaultMain | ||
$ testGroup "Test suite" | ||
[ testDiscoverNodes | ||
] | ||
|
||
testDiscoverNodes :: TestTree | ||
testDiscoverNodes = testCase "discover nodes" $ do | ||
|
||
-- Initialize slave nodes | ||
forM_ ["10000", "10001", "10002", "10003"] $ \port -> do | ||
backend <- initializeBackend "127.0.0.1" port initRemoteTable | ||
_ <- forkIO $ startSlave backend | ||
threadDelay 100000 | ||
|
||
-- initialize master node | ||
discoveredNodesSlot <- MVar.newEmptyMVar | ||
backend <- initializeBackend "127.0.0.1" "10004" initRemoteTable | ||
startMaster backend $ \nds -> do | ||
terminateAllSlaves backend | ||
liftIO $ MVar.putMVar discoveredNodesSlot nds | ||
|
||
discoveredNodes <- (List.sort . List.nub) <$> MVar.readMVar discoveredNodesSlot | ||
assertEqual "Discovered nodes" | ||
[ "nid://127.0.0.1:10000:0" | ||
, "nid://127.0.0.1:10001:0" | ||
, "nid://127.0.0.1:10002:0" | ||
, "nid://127.0.0.1:10003:0" | ||
] | ||
(map show discoveredNodes) | ||
|
||
|
This file was deleted.
Oops, something went wrong.
This file was deleted.
Oops, something went wrong.