-
Notifications
You must be signed in to change notification settings - Fork 0
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
Set up some GHA CI #4
Merged
Merged
Changes from all commits
Commits
Show all changes
4 commits
Select commit
Hold shift + click to select a range
File filter
Filter by extension
Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
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,4 @@ | ||
# Note: later rules override earlier rules. | ||
|
||
# Default | ||
* @dcoutts @jorisdral |
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,101 @@ | ||
name: Haskell CI | ||
|
||
on: | ||
push: | ||
branches: [ "main" ] | ||
pull_request: | ||
merge_group: | ||
|
||
concurrency: | ||
group: ${{ github.workflow }}-${{ github.event.pull_request.number || github.ref }} | ||
cancel-in-progress: true | ||
|
||
|
||
permissions: | ||
contents: read | ||
|
||
jobs: | ||
# Build and test | ||
build: | ||
runs-on: ${{ matrix.os }} | ||
|
||
strategy: | ||
fail-fast: false | ||
matrix: | ||
ghc: ["9.2.8", "9.4.8", "9.6.4", "9.8.2"] | ||
cabal: ["3.10.2.1"] | ||
os: [ubuntu-latest] | ||
|
||
steps: | ||
- name: Checkout repository | ||
uses: actions/checkout@v3 | ||
|
||
- name: Setup Haskell | ||
id: setup-haskell | ||
uses: haskell-actions/setup@v2 | ||
with: | ||
ghc-version: ${{ matrix.ghc }} | ||
cabal-version: ${{ matrix.cabal }} | ||
cabal-update: true | ||
|
||
- name: Install liburing (on Linux) | ||
id: setup-liburing | ||
run: | | ||
sudo apt-get update | ||
sudo apt-get -y install pkg-config | ||
echo "PKG_CONFIG_PATH=$PKG_CONFIG_PATH" | ||
mkdir tmp | ||
cd tmp | ||
git clone https://github.com/axboe/liburing.git | ||
cd liburing | ||
git checkout liburing-2.5 | ||
./configure --cc=gcc --cxx=g++ | ||
make -j$(nproc) | ||
sudo make install | ||
cd ../.. | ||
sudo rm -rf ./tmp | ||
pkg-config --modversion liburing | ||
|
||
- name: Configure the build | ||
run: | | ||
cabal configure --enable-test --enable-benchmark --ghc-options="-Werror" --ghc-options="-fno-ignore-asserts" | ||
cat cabal.project.local | ||
|
||
- name: Record cabal dependencies | ||
id: record-deps | ||
run: | | ||
cabal build all --dry-run | ||
|
||
- name: "Restore cache" | ||
uses: actions/cache/restore@v4 | ||
id: restore-cabal-cache | ||
env: | ||
cache-name: cache-cabal-build | ||
with: | ||
path: ${{ steps.setup-haskell.outputs.cabal-store }} | ||
key: ${{ runner.os }}-${{ matrix.ghc }}-${{ env.cache-name }}-${{ hashFiles('**/*.cabal') }}-${{ hashFiles('**/cabal.project') }} | ||
restore-keys: | | ||
${{ runner.os }}-${{ matrix.ghc }}-${{ env.cache-name }}-${{ hashFiles('**/*.cabal') }}-${{ hashFiles('**/cabal.project') }} | ||
${{ runner.os }}-${{ matrix.ghc }}-${{ env.cache-name }}-${{ hashFiles('**/*.cabal') }}- | ||
${{ runner.os }}-${{ matrix.ghc }}-${{ env.cache-name }}- | ||
|
||
- name: Install cabal dependencies | ||
id: build-dependencies | ||
run: cabal build --only-dependencies --enable-tests --enable-benchmarks all | ||
|
||
- name: "Save cache" | ||
uses: actions/cache/save@v4 | ||
id: save-cabal-cache | ||
# Note: cache-hit will be set to true only when cache hit occurs for the | ||
# exact key match. For a partial key match via restore-keys or a cache | ||
# miss, it will be set to false. | ||
if: steps.build-dependencies.outcome == 'success' && steps.restore-cabal-cache.outputs.cache-hit != 'true' | ||
with: | ||
path: ${{ steps.setup-haskell.outputs.cabal-store }} | ||
key: ${{ steps.restore-cabal-cache.outputs.cache-primary-key }} | ||
|
||
- name: Build | ||
run: cabal build all | ||
|
||
- name: Run tests | ||
run: cabal test -j1 --test-show-details=direct all |
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 |
---|---|---|
@@ -1,51 +1,71 @@ | ||
cabal-version: >=1.10 | ||
|
||
name: blockio-uring | ||
version: 0.1.0.0 | ||
synopsis: Perform batches of asynchronous disk IO operations. | ||
description: Support for disk I/O operations using the Linux io_uring | ||
API. The library supports submitting large batches of I/O | ||
operations in one go. It also supports submitting batches | ||
from multiple Haskell threads concurrently. The I/O only | ||
blocks the calling thread, not all other Haskell threads. | ||
In this style, using a combination of batching and | ||
concurrency, it is possible to saturate modern SSDs, thus | ||
achieving maximum I/O throughput. This is particularly | ||
helpful for performing lots of random reads. | ||
|
||
The library only supports recent versions of Linux, because | ||
it uses the io_uring kernel API. It only supports disk | ||
operations, not socket operations. | ||
|
||
-- bug-reports: | ||
license: MIT | ||
license-file: LICENSE | ||
author: Duncan Coutts | ||
maintainer: [email protected] | ||
copyright: (c) Well-Typed LLP 2022 | ||
category: System | ||
build-type: Simple | ||
extra-source-files: CHANGELOG.md | ||
cabal-version: 3.4 | ||
name: blockio-uring | ||
version: 0.1.0.0 | ||
synopsis: Perform batches of asynchronous disk IO operations. | ||
description: | ||
Support for disk I/O operations using the Linux io_uring | ||
API. The library supports submitting large batches of I/O | ||
operations in one go. It also supports submitting batches | ||
from multiple Haskell threads concurrently. The I/O only | ||
blocks the calling thread, not all other Haskell threads. | ||
In this style, using a combination of batching and | ||
concurrency, it is possible to saturate modern SSDs, thus | ||
achieving maximum I/O throughput. This is particularly | ||
helpful for performing lots of random reads. | ||
|
||
The library only supports recent versions of Linux, because | ||
it uses the io_uring kernel API. It only supports disk | ||
operations, not socket operations. | ||
|
||
license: MIT | ||
license-file: LICENSE | ||
author: Duncan Coutts | ||
maintainer: [email protected] | ||
copyright: (c) Well-Typed LLP 2022 - 2024 | ||
category: System | ||
build-type: Simple | ||
tested-with: GHC ==9.2 || ==9.4 || ==9.6 || ==9.8 | ||
extra-doc-files: | ||
CHANGELOG.md | ||
README.md | ||
|
||
source-repository head | ||
type: git | ||
location: https://github.com/well-typed/blockio-uring | ||
|
||
library | ||
exposed-modules: System.IO.BlockIO | ||
other-modules: System.IO.BlockIO.URing | ||
System.IO.BlockIO.URingFFI | ||
-- other-extensions: | ||
build-depends: base, array, unix | ||
pkgconfig-depends: liburing | ||
default-language: Haskell2010 | ||
ghc-options: -Wall | ||
exposed-modules: System.IO.BlockIO | ||
other-modules: | ||
System.IO.BlockIO.URing | ||
System.IO.BlockIO.URingFFI | ||
|
||
build-depends: | ||
, array ^>=0.5 | ||
, base >=4.16 && <4.20 | ||
, unix ^>=2.8 | ||
|
||
pkgconfig-depends: liburing | ||
default-language: Haskell2010 | ||
ghc-options: -Wall | ||
|
||
benchmark bench | ||
default-language: Haskell2010 | ||
type: exitcode-stdio-1.0 | ||
hs-source-dirs: benchmark, . | ||
main-is: Bench.hs | ||
build-depends: base, array, unix, random, time, containers, async | ||
pkgconfig-depends: liburing | ||
other-modules: System.IO.BlockIO | ||
System.IO.BlockIO.URing | ||
System.IO.BlockIO.URingFFI | ||
ghc-options: -Wall -threaded | ||
default-language: Haskell2010 | ||
type: exitcode-stdio-1.0 | ||
hs-source-dirs: benchmark . | ||
main-is: Bench.hs | ||
build-depends: | ||
, array | ||
, async | ||
, base | ||
, containers | ||
, random | ||
, time | ||
, unix | ||
|
||
pkgconfig-depends: liburing | ||
other-modules: | ||
System.IO.BlockIO | ||
System.IO.BlockIO.URing | ||
System.IO.BlockIO.URingFFI | ||
|
||
ghc-options: -Wall -threaded |
Oops, something went wrong.
Add this suggestion to a batch that can be applied as a single commit.
This suggestion is invalid because no changes were made to the code.
Suggestions cannot be applied while the pull request is closed.
Suggestions cannot be applied while viewing a subset of changes.
Only one suggestion per line can be applied in a batch.
Add this suggestion to a batch that can be applied as a single commit.
Applying suggestions on deleted lines is not supported.
You must change the existing code in this line in order to create a valid suggestion.
Outdated suggestions cannot be applied.
This suggestion has been applied or marked resolved.
Suggestions cannot be applied from pending reviews.
Suggestions cannot be applied on multi-line comments.
Suggestions cannot be applied while the pull request is queued to merge.
Suggestion cannot be applied right now. Please check back later.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
@dcoutts I formatted the file using
cabal-fmt
in the last commit. If you prefer I undo the formatting, then I can remove just the last commit. If you want to see just the changes to the cabal file sans formatting, then you can disable showing the last commit in the diff