Skip to content

Commit

Permalink
Fix build
Browse files Browse the repository at this point in the history
  • Loading branch information
newhoggy committed Aug 14, 2024
1 parent 1c353bc commit 1cd4383
Show file tree
Hide file tree
Showing 3 changed files with 85 additions and 49 deletions.
122 changes: 79 additions & 43 deletions .github/workflows/haskell.yml
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
name: Binaries
name: Haskell CI

defaults:
run:
Expand All @@ -17,52 +17,88 @@ jobs:
strategy:
fail-fast: false
matrix:
ghc: ["9.2.2", "9.0.2", "8.10.7", "8.8.4", "8.6.5"]
os: [ubuntu-latest, macOS-latest, windows-latest]
cabal: ["3.12"]
ghc: ["9.10.1", "9.8.1", "9.6.3", "9.4.8"]
os: [ubuntu-latest, windows-latest]

steps:
- uses: actions/checkout@v2

- uses: haskell/actions/setup@v1
id: setup-haskell
with:
ghc-version: ${{ matrix.ghc }}
cabal-version: 3.6.2.0

- name: Set some window specific things
if: matrix.os == 'windows-latest'
run: echo 'EXE_EXT=.exe' >> $GITHUB_ENV
include:
# Using include, to make sure there will only be one macOS job, even if the matrix gets expanded later on.
# We want a single job, because macOS runners are scarce.
- ghc: "9.10.1"
cabal: "3.12"
os: macos-latest

- name: Configure project
run: cabal configure --enable-tests --enable-benchmarks --write-ghc-environment-files=ghc8.4.4+
env:
# Modify this value to "invalidate" the cabal cache.
CABAL_CACHE_VERSION: "2024-08-05"

- name: Cabal cache over S3
uses: action-works/cabal-cache-s3@v1
env:
AWS_ACCESS_KEY_ID: ${{ secrets.AWS_ACCESS_KEY_ID }}
AWS_SECRET_ACCESS_KEY: ${{ secrets.AWS_SECRET_ACCESS_KEY }}
with:
region: us-west-2
dist-dir: dist-newstyle
store-path: ${{ steps.setup-haskell.outputs.cabal-store }}
threads: 16
archive-uri: ${{ secrets.BINARY_CACHE_URI }}
skip: "${{ secrets.BINARY_CACHE_URI == '' }}"

- name: Cabal cache over HTTPS
uses: action-works/cabal-cache-s3@v1
with:
dist-dir: dist-newstyle
store-path: ${{ steps.setup-haskell.outputs.cabal-store }}
threads: 16
archive-uri: https://cache.haskellworks.io/archive
skip: "${{ secrets.BINARY_CACHE_URI != '' }}"

- name: Build
run: cabal build all --enable-tests --enable-benchmarks
steps:

- name: Test
run: cabal test all --enable-tests --enable-benchmarks
- name: Install Haskell
uses: input-output-hk/actions/haskell@latest
id: setup-haskell
with:
ghc-version: ${{ matrix.ghc }}
cabal-version: ${{ matrix.cabal }}

# - name: Install system dependencies
# uses: input-output-hk/actions/base@latest
# with:
# use-sodium-vrf: true # default is true

- uses: actions/checkout@v4

- name: Cabal update
run: cabal update

- name: Configure build
run: |
cabal configure --enable-tests --enable-benchmarks
cabal build all --enable-tests --enable-benchmarks --dry-run
- name: Record dependencies
run: |
cat dist-newstyle/cache/plan.json | jq -r '."install-plan"[].id' | sort | uniq > dependencies.txt
date +"%Y-%m-%d" > date.txt
- name: View dependencies
run: |
echo "date = $(cat date.txt)"
echo "md5(dependencies.txt) = $(md5sum dependencies.txt)"
echo "md5(date.txt) = $(md5sum date.txt)"
- name: Upload dependencies.txt
uses: actions/upload-artifact@v2
with:
name: dependencies
path: dependencies.txt

- uses: actions/cache@v4
name: Cache cabal store
with:
path: ${{ steps.setup-haskell.outputs.cabal-store }}
key: cache-${{ env.CACHE_VERSION }}-${{ runner.os }}-${{ matrix.ghc }}-${{ hashFiles('dependencies.txt') }}-${{ hashFiles('date.txt') }}
restore-keys: |
cache-${{ env.CACHE_VERSION }}-${{ runner.os }}-${{ matrix.ghc }}-${{ hashFiles('dependencies.txt') }}-${{ hashFiles('date.txt') }}
cache-${{ env.CACHE_VERSION }}-${{ runner.os }}-${{ matrix.ghc }}-${{ hashFiles('dependencies.txt') }}
cache-${{ env.CACHE_VERSION }}-${{ runner.os }}-${{ matrix.ghc }}
# Now we install the dependencies. If the cache was found and restored in the previous step,
# this should be a no-op, but if the cache key was not found we need to build stuff so we can
# cache it for the next step.
- name: Install dependencies
run: cabal build all --enable-tests --only-dependencies -j --ghc-option=-j4

# Now we build.
- name: Build all
run: cabal build all --enable-tests

- name: Run tests
env:
TMPDIR: ${{ runner.temp }}
TMP: ${{ runner.temp }}
KEEP_WORKSPACE: 1
run: cabal test all --enable-tests --enable-benchmarks

check:
needs: build
Expand Down
10 changes: 5 additions & 5 deletions hw-streams.cabal
Original file line number Diff line number Diff line change
Expand Up @@ -28,20 +28,20 @@ flag bounds-checking-enabled

common base { build-depends: base >= 4.11 && < 5 }

common bytestring { build-depends: bytestring >= 0.9 && < 0.12 }
common bytestring { build-depends: bytestring >= 0.9 && < 0.13 }
common criterion { build-depends: criterion >= 1.2 && < 1.7 }
common directory { build-depends: directory >= 1.2 && < 1.4 }
common doctest { build-depends: doctest >= 0.16.2 && < 0.21 }
common doctest { build-depends: doctest >= 0.16.2 && < 1.0 }
common doctest-discover { build-depends: doctest-discover >= 0.2 && < 0.3 }
common exceptions { build-depends: exceptions >= 0.8 && < 0.11 }
common ghc-prim { build-depends: ghc-prim >= 0.4 && < 0.10 }
common hedgehog { build-depends: hedgehog >= 0.5 && < 1.3 }
common ghc-prim { build-depends: ghc-prim >= 0.4 && < 0.12 }
common hedgehog { build-depends: hedgehog >= 0.5 && < 2 }
common hspec { build-depends: hspec >= 2.4 && < 3 }
common hw-bits { build-depends: hw-bits >= 0.7.0.3 && < 0.8 }
common hw-hspec-hedgehog { build-depends: hw-hspec-hedgehog >= 0.1 && < 0.2 }
common hw-prim { build-depends: hw-prim >= 0.6.2.17 && < 0.7 }
common mmap { build-depends: mmap >= 0.5 && < 0.6 }
common primitive { build-depends: primitive >= 0.6.3.0 && < 0.8 }
common primitive { build-depends: primitive >= 0.6.3.0 && < 0.10 }
common QuickCheck { build-depends: QuickCheck >= 2.10 && < 2.15 }
common transformers { build-depends: transformers >= 0.4 && < 0.7 }
common vector { build-depends: vector >= 0.12 && < 0.14 }
Expand Down
2 changes: 1 addition & 1 deletion src/HaskellWorks/Data/Streams/Stream/Ops.hs
Original file line number Diff line number Diff line change
Expand Up @@ -14,7 +14,7 @@ import qualified HaskellWorks.Data.Bits.BitWise as BW
import qualified HaskellWorks.Data.Streams.Stream as HW

ltWord :: Word64 -> Word64 -> Word64
ltWord (W64# a#) (W64# b#) = fromIntegral (I64# (ltWord# a# b#))
ltWord (W64# a#) (W64# b#) = fromIntegral (I# (ltWord64# a# b#))
{-# INLINE ltWord #-}

comp :: Stream Word64 -> Stream Word64
Expand Down

0 comments on commit 1cd4383

Please sign in to comment.