Skip to content

Commit 078c383

Browse files
authored
Merge pull request #789 from IntersectMBO/jdral/bloomfilter-blocked-0.1.0.0
Release `bloomfilter-blocked-0.1.0.0`
2 parents aada742 + da68e15 commit 078c383

File tree

12 files changed

+198
-100
lines changed

12 files changed

+198
-100
lines changed

.github/workflows/check-release-builds.yml

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,4 +1,4 @@
1-
name: Check release builds
1+
name: CI - Check release builds
22

33
on:
44
push:

.github/workflows/ci.yml

Lines changed: 6 additions & 68 deletions
Original file line numberDiff line numberDiff line change
@@ -53,9 +53,6 @@ jobs:
5353
echo 'matrix.cabal-version: ${{ matrix.os || env.DEFAULT_CABAL_VERSION }}'
5454
echo 'matrix.cabal-flags: ${{ matrix.cabal-flags }}'
5555
echo 'matrix.cabal-project-file: ${{ matrix.cabal-project-file || env.DEFAULT_CABAL_PROJECT_FILE }}'
56-
echo 'matrix.cabal-skip-tests: ${{ matrix.cabal-skip-tests || false }}'
57-
echo 'matrix.cabal-skip-benchmarks: ${{ matrix.cabal-skip-benchmarks || false}}'
58-
echo 'matrix.cabal-documentation: ${{ matrix.cabal-documentation || false }}'
5956
echo 'toJSON(matrix): ${{ toJSON(matrix) }}'
6057
6158
- name: 🗄️ Print CPU info
@@ -78,9 +75,9 @@ jobs:
7875
run: |
7976
cabal configure \
8077
--project-file="${{ matrix.cabal-project-file || env.DEFAULT_CABAL_PROJECT_FILE }}" \
81-
${{ matrix.cabal-skip-tests && '--disable-tests' || '--enable-tests' }} \
82-
${{ matrix.cabal-skip-benchmarks && '--disable-benchmarks' || '--enable-benchmarks' }} \
83-
${{ matrix.cabal-documentation && '--enable-documentation' || '--disable-documentation' }} \
78+
--enable-tests \
79+
--enable-benchmarks \
80+
--disable-documentation \
8481
--ghc-options="-Werror" \
8582
--flag="${{ matrix.cabal-flags }}"
8683
cat "${{ matrix.cabal-project-file || env.DEFAULT_CABAL_PROJECT_FILE }}.local"
@@ -116,14 +113,12 @@ jobs:
116113
key: ${{ steps.cache-cabal.outputs.cache-primary-key }}
117114

118115
- name: 🏗️ Build
119-
if: ${{ !matrix.cabal-skip-tests }}
120116
run: |
121117
cabal build all \
122118
--project-file="${{ matrix.cabal-project-file || env.DEFAULT_CABAL_PROJECT_FILE }}"
123119
124120
- name: 🧪 Test
125121
id: test
126-
if: ${{ !matrix.cabal-skip-tests }}
127122
run: |
128123
cabal test all \
129124
-j1 \
@@ -137,7 +132,7 @@ jobs:
137132
# directory containing the golden files after running the goldens tests
138133
# allows us to diff the expected and actual golden file contents.
139134
- name: 📦 Upload golden files
140-
if: ${{ !matrix.cabal-skip-tests && steps.test.outcome != 'success' && always() }}
135+
if: ${{ steps.test.outcome != 'success' && always() }}
141136
uses: actions/upload-artifact@v4
142137
with:
143138
name: golden-files-${{ runner.os }}-ghc-${{ steps.setup-haskell.outputs.ghc-version }}-cabal-${{ steps.setup-haskell.outputs.cabal-version }}-plan-${{ hashFiles('dist-newstyle/cache/plan.json') }}
@@ -146,28 +141,15 @@ jobs:
146141
retention-days: 1
147142

148143
- name: 🛠️ Setup cabal-docspec (Linux)
149-
if: ${{ !matrix.cabal-skip-tests && runner.os == 'Linux' }}
144+
if: ${{ runner.os == 'Linux' }}
150145
uses: ./.github/actions/setup-cabal-docspec
151146

152147
- name: 🧪 Test with cabal-docspec (Linux)
153-
if: ${{ !matrix.cabal-skip-tests && runner.os == 'Linux' }}
148+
if: ${{ runner.os == 'Linux' }}
154149
run: ./scripts/test-cabal-docspec.sh
155150
env:
156151
SKIP_CABAL_BUILD: true
157152

158-
- name: 🏗️ Build documentation
159-
if: ${{ matrix.cabal-documentation }}
160-
run: ./scripts/generate-haddock.sh
161-
162-
- name: 📦 Upload documentation
163-
if: ${{ matrix.cabal-documentation }}
164-
uses: actions/upload-artifact@v4
165-
with:
166-
name: haddocks-${{ runner.os }}-ghc-${{ matrix.ghc-version || env.DEFAULT_GHC_VERSION }}-cabal-${{ matrix.cabal-version || env.DEFAULT_CABAL_VERSION }}
167-
path: haddocks
168-
if-no-files-found: error
169-
retention-days: 1
170-
171153
strategy:
172154
fail-fast: false
173155
matrix:
@@ -178,7 +160,6 @@ jobs:
178160
# entry under include that assigns these keys creates a new matrix entry
179161
cabal-flags: [""]
180162
cabal-project-file: [""]
181-
cabal-documentation: [false]
182163

183164
include:
184165
# Include builds for various special cases
@@ -188,12 +169,6 @@ jobs:
188169
- name: "Build with cabal.project.release"
189170
os: "ubuntu-latest"
190171
cabal-project-file: "cabal.project.release"
191-
# Include build for documentation
192-
- name: "Build documentation"
193-
os: "ubuntu-latest"
194-
cabal-skip-tests: true
195-
cabal-skip-benchmarks: true
196-
cabal-documentation: true
197172

198173
################################################################################
199174
# Lint with actionlint
@@ -352,40 +327,3 @@ jobs:
352327

353328
- name: 🎗️ Lint with ShellCheck
354329
run: ./scripts/lint-shellcheck.sh
355-
356-
################################################################################
357-
# Publish documentation
358-
################################################################################
359-
publish-documentation:
360-
name: Publish documentation
361-
runs-on: ubuntu-latest
362-
if: ${{ github.event_name == 'push' }}
363-
needs: [build]
364-
365-
permissions:
366-
pages: write
367-
id-token: write
368-
369-
environment:
370-
name: github-pages
371-
url: ${{ steps.publish-pages.outputs.page_url }}
372-
373-
steps:
374-
- name: 🛠️ Setup Pages
375-
uses: actions/configure-pages@v5
376-
377-
- name: 📦 Download documentation
378-
uses: actions/download-artifact@v4
379-
with:
380-
# Ensure that the job that builds the documentation uses the default GHC and Cabal versions.
381-
name: haddocks-Linux-ghc-${{ env.DEFAULT_GHC_VERSION }}-cabal-${{ env.DEFAULT_CABAL_VERSION }}
382-
path: haddocks
383-
384-
- name: 📦 Upload documentation to Pages
385-
uses: actions/upload-pages-artifact@v3
386-
with:
387-
path: haddocks
388-
389-
- name: 🚀 Publish documentation to Pages
390-
id: publish-pages
391-
uses: actions/deploy-pages@v4
Lines changed: 128 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,128 @@
1+
name: CI - Documentation
2+
3+
on:
4+
push:
5+
branches:
6+
- "main"
7+
pull_request:
8+
merge_group:
9+
10+
concurrency:
11+
group: ${{ github.workflow }}-${{ github.event.pull_request.number || github.ref }}
12+
cancel-in-progress: true
13+
14+
permissions:
15+
contents: read
16+
17+
# Set the default shell on all platforms.
18+
defaults:
19+
run:
20+
shell: sh
21+
22+
env:
23+
ghc-version: "9.6"
24+
cabal-version: "3.12"
25+
cabal-project-file: "cabal.project.debug"
26+
27+
jobs:
28+
################################################################################
29+
# Build documentation
30+
################################################################################
31+
build:
32+
name: Build documentation
33+
runs-on: ubuntu-latest
34+
timeout-minutes: 60
35+
36+
steps:
37+
- name: 📥 Checkout repository
38+
uses: actions/checkout@v4
39+
40+
- name: 🛠️ Setup Haskell
41+
id: setup-haskell
42+
uses: haskell-actions/setup@v2
43+
with:
44+
ghc-version: ${{ env.ghc-version }}
45+
cabal-version: ${{ env.cabal-version }}
46+
47+
- name: 🛠️ Setup system dependencies (Linux)
48+
if: ${{ runner.os == 'Linux' }}
49+
run: sudo apt-get update && sudo apt-get -y install liburing-dev librocksdb-dev
50+
env:
51+
DEBIAN_FRONTEND: "noninteractive"
52+
53+
- name: 🛠️ Configure
54+
run: |
55+
cabal configure \
56+
--project-file="${{ env.cabal-project-file }}" \
57+
--enable-tests \
58+
--enable-benchmarks \
59+
--enable-documentation \
60+
--ghc-options="-Werror"
61+
cat "${{ env.cabal-project-file }}.local"
62+
63+
- name: 💾 Generate Cabal plan
64+
run: |
65+
cabal build all \
66+
--project-file="${{ env.cabal-project-file }}" \
67+
--dry-run
68+
69+
# Use the cache action instead of the restore/save actions, because cabal
70+
# haddock-project (used in the generate-haddock.sh script) tends to
71+
# rebuild dependencies regardless of whether we build the dependencies
72+
# manually beforehand.
73+
- name: 💾 Cache Cabal dependencies
74+
uses: actions/cache@v4
75+
if: ${{ !env.ACT }}
76+
env:
77+
key: build-documentation-${{ runner.os }}-ghc-${{ steps.setup-haskell.outputs.ghc-version }}-cabal-${{ steps.setup-haskell.outputs.cabal-version }}
78+
with:
79+
path: ${{ steps.setup-haskell.outputs.cabal-store }}
80+
key: ${{ env.key }}-plan-${{ hashFiles('dist-newstyle/cache/plan.json') }}
81+
restore-keys: ${{ env.key }}-
82+
83+
- name: 🏗️ Build documentation
84+
run: ./scripts/generate-haddock.sh
85+
86+
- name: 📦 Upload documentation
87+
uses: actions/upload-artifact@v4
88+
with:
89+
name: haddocks-${{ runner.os }}-ghc-${{ env.ghc-version }}-cabal-${{ env.cabal-version }}
90+
path: haddocks
91+
if-no-files-found: error
92+
retention-days: 1
93+
94+
################################################################################
95+
# Publish documentation
96+
################################################################################
97+
publish-documentation:
98+
name: Publish documentation
99+
runs-on: ubuntu-latest
100+
if: ${{ github.event_name == 'push' }}
101+
needs: [build]
102+
103+
permissions:
104+
pages: write
105+
id-token: write
106+
107+
environment:
108+
name: github-pages
109+
url: ${{ steps.publish-pages.outputs.page_url }}
110+
111+
steps:
112+
- name: 🛠️ Setup Pages
113+
uses: actions/configure-pages@v5
114+
115+
- name: 📦 Download documentation
116+
uses: actions/download-artifact@v4
117+
with:
118+
name: haddocks-${{ runner.os }}-ghc-${{ env.ghc-version }}-cabal-${{ env.cabal-version }}
119+
path: haddocks
120+
121+
- name: 📦 Upload documentation to Pages
122+
uses: actions/upload-pages-artifact@v3
123+
with:
124+
path: haddocks
125+
126+
- name: 🚀 Publish documentation to Pages
127+
id: publish-pages
128+
uses: actions/deploy-pages@v4

bloomfilter-blocked/CHANGELOG.md

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,5 @@
11
# Revision history for bloomfilter-blocked
22

3-
## 0.1.0.0 -- YYYY-mm-dd
3+
## 0.1.0.0 -- 2025-08-06
44

55
* First version. Released on an unsuspecting world.

bloomfilter-blocked/README.md

Lines changed: 12 additions & 16 deletions
Original file line numberDiff line numberDiff line change
@@ -1,18 +1,18 @@
11
# bloomfilter-blocked
22

33
`bloomfilter-blocked` is a Haskell library providing multiple fast and efficient
4-
implementations of [bloom filters][bloom-filter:wiki]. It is a full rewrite of
5-
the [`bloomfilter`][bloomfilter:hackage] package, originally authored by Bryan
6-
O'Sullivan <[email protected]>.
4+
implementations of [bloom filters](https://en.wikipedia.org/wiki/Bloom_filter).
5+
It is a full rewrite of the
6+
[`bloomfilter`](https://hackage.haskell.org/package/bloomfilter) package,
7+
originally authored by Bryan O'Sullivan <[email protected]>.
78

89
A bloom filter is a space-efficient data structure representing a set that can
910
be probablistically queried for set membership. The set membership query returns
1011
no false negatives, but it might return false positives. That is, if an element
1112
was added to a bloom filter, then a subsequent query definitely returns `True`.
1213
If an element was *not* added to a filter, then a subsequent query may still
1314
return `True` if `False` would be the correct answer. The probabiliy of false
14-
positives -- the false positive rate (FPR) -- is configurable, as we will
15-
describe later.
15+
positives -- the false positive rate (FPR) -- is configurable.
1616

1717
The library includes two implementations of bloom filters: classic, and blocked.
1818

@@ -48,8 +48,9 @@ User should take into account the following:
4848

4949
# Differences from the `bloomfilter` package
5050

51-
The library is a full rewrite of the [`bloomfilter`][bloomfilter:hackage]
52-
package, originally authored by Bryan O'Sullivan <[email protected]>. The main
51+
The library is a full rewrite of the
52+
[`bloomfilter`](https://hackage.haskell.org/package/bloomfilter) package,
53+
originally authored by Bryan O'Sullivan <[email protected]>. The main
5354
differences are:
5455

5556
* `bloomfilter-blocked` supports both classic and blocked bloom filters, whereas
@@ -62,14 +63,9 @@ differences are:
6263
over a `Hashable` type class, instead of having a `a -> [Hash]` typed field.
6364
This separation in `bloomfilter-blocked` allows clean (de-)serialisation of
6465
filters as the hashing scheme is static.
65-
* `bloomfilter-blocked` uses [`XXH3`][xxh3] for hashing instead of [Jenkins'
66-
`lookup3`][lookup3:wiki], which `bloomfilter` uses.
66+
* `bloomfilter-blocked` uses [`XXH3`](https://xxhash.com/) for hashing instead
67+
of [Jenkins'
68+
`lookup3`](https://en.wikipedia.org/wiki/Jenkins_hash_function#lookup3), which
69+
`bloomfilter` uses.
6770
* The user can configure hash salts for improved security in
6871
`bloomfilter-blocked`, whereas this is not supported in `bloomfilter`.
69-
70-
<!-- Sources -->
71-
72-
[bloom-filter:wiki]: https://en.wikipedia.org/wiki/Bloom_filter
73-
[bloomfilter:hackage]: https://hackage.haskell.org/package/bloomfilter
74-
[xxh3]: https://xxhash.com/
75-
[lookup3:wiki]: https://en.wikipedia.org/wiki/Jenkins_hash_function#lookup3

0 commit comments

Comments
 (0)