Skip to content

Commit b2952e0

Browse files
committed
Add CI, add bounds on dependencies
1 parent e18f658 commit b2952e0

File tree

2 files changed

+96
-3
lines changed

2 files changed

+96
-3
lines changed

.github/workflows/haskell-actions.yml

Lines changed: 86 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,86 @@
1+
name: build
2+
on:
3+
push:
4+
branches: [master]
5+
pull_request:
6+
branches: [master]
7+
8+
jobs:
9+
build:
10+
name: GHC ${{ matrix.ghc-version }} on ${{ matrix.os }}
11+
runs-on: ${{ matrix.os }}
12+
strategy:
13+
fail-fast: false
14+
matrix:
15+
os: [ubuntu-latest]
16+
ghc-version: ['9.6.6']
17+
18+
steps:
19+
- uses: actions/checkout@v4
20+
21+
- name: Set up GHC ${{ matrix.ghc-version }}
22+
uses: haskell-actions/setup@v2
23+
id: setup
24+
with:
25+
ghc-version: ${{ matrix.ghc-version }}
26+
cabal-version: '3.14.1.1'
27+
cabal-update: true
28+
29+
- name: Extract New-Versions git trailer from Renovate
30+
run: |
31+
if [ ! -f cabal.project ]
32+
then echo 'packages: .' > cabal.project
33+
fi
34+
for constraint in $(git log "--format=%(trailers:key=New-Versions,valueonly=true)" -1)
35+
do echo "constraints: $constraint" >> cabal.project
36+
done
37+
38+
- name: Show cabal.project
39+
run: |
40+
cat cabal.project
41+
42+
- name: Configure the build
43+
run: |
44+
cabal configure --enable-tests --enable-benchmarks --disable-documentation
45+
cabal build all --dry-run
46+
# The last step generates dist-newstyle/cache/plan.json for the cache key.
47+
48+
- name: Restore cached dependencies
49+
uses: actions/cache/restore@v4
50+
id: cache
51+
env:
52+
key: ${{ runner.os }}-ghc-${{ steps.setup.outputs.ghc-version }}-cabal-${{ steps.setup.outputs.cabal-version }}
53+
with:
54+
path: ${{ steps.setup.outputs.cabal-store }}
55+
key: ${{ env.key }}-plan-${{ hashFiles('**/plan.json') }}
56+
restore-keys: ${{ env.key }}-
57+
58+
- name: Install dependencies
59+
# If we had an exact cache hit, the dependencies will be up to date.
60+
if: steps.cache.outputs.cache-hit != 'true'
61+
run: cabal build all --only-dependencies
62+
63+
# Cache dependencies already here, so that we do not have to rebuild them should the subsequent steps fail.
64+
- name: Save cached dependencies
65+
uses: actions/cache/save@v4
66+
# If we had an exact cache hit, trying to save the cache would error because of key clash.
67+
if: steps.cache.outputs.cache-hit != 'true'
68+
with:
69+
path: ${{ steps.setup.outputs.cabal-store }}
70+
key: ${{ steps.cache.outputs.cache-primary-key }}
71+
72+
- name: Build
73+
run: cabal build all
74+
75+
- name: Run tests
76+
run: cabal test all
77+
78+
- name: Check cabal file
79+
run: cabal check
80+
81+
- name: Build documentation
82+
run:
83+
cabal haddock all --disable-documentation
84+
# --disable-documentation disables building documentation for dependencies.
85+
# The package's own documentation is still built,
86+
# yet contains no links to the documentation of the dependencies.

pureMD5.cabal

Lines changed: 10 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,7 @@
1+
cabal-version: 2.4
12
name: pureMD5
23
version: 2.1.4
3-
license: BSD3
4+
license: BSD-3-Clause
45
license-file: LICENSE
56
author: Thomas DuBuisson <thomas.dubuisson@gmail.com>
67
maintainer: Thomas DuBuisson
@@ -10,15 +11,21 @@ synopsis: A Haskell-only implementation of the MD5 digest (hash) algorithm.
1011
category: Data, Cryptography
1112
stability: stable
1213
build-type: Simple
13-
cabal-version: >= 1.10
1414
tested-with: GHC == 7.10.3
15+
extra-doc-files: CHANGES
1516

1617
flag test
1718
description: Build a test program
1819
default: False
1920

2021
Library
21-
Build-Depends: base == 4.*, bytestring >= 0.9, binary >= 0.4.0, cereal >= 0.2, crypto-api, tagged
22+
Build-Depends:
23+
, base >=4.18 && <4.21
24+
, bytestring >=0.11 && <0.12
25+
, binary >=0.8.9 && <0.9
26+
, cereal >=0.5.8.3 && <0.6
27+
, crypto-api >=0.13.3 && <0.14
28+
, tagged >=0.8.6 && <0.9
2229
ghc-options: -O2 -funfolding-use-threshold66 -funfolding-creation-threshold66 -funbox-strict-fields
2330
default-language: Haskell2010
2431
hs-source-dirs:

0 commit comments

Comments
 (0)