Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
38 changes: 26 additions & 12 deletions .github/workflows/cabal.yml
Original file line number Diff line number Diff line change
Expand Up @@ -12,21 +12,20 @@ jobs:
runs-on: ubuntu-latest
steps:
- uses: actions/checkout@v4
- uses: haskell-actions/run-fourmolu@v9
with:
version: "0.13.0.0"
build:
runs-on: ubuntu-latest
needs: fourmolu
strategy:
matrix:
cabal: ["3.6", "3.8"]
ghc: ["8.10.7", "9.0.2", "9.2.4", "9.4.8", "9.6.6", "9.8.2", "9.10.1"]
cabal: ["latest"]
ghc: ["8.10.7", "9.0.2", "9.2.8", "9.4.8", "9.6", "9.8", "9.10", "9.12"]
package:
- "wai-middleware-delegate"
env:
CONFIG: "--enable-tests --enable-benchmarks --flags=dev"
steps:
- uses: actions/checkout@v4
- uses: haskell/actions/setup@v2
- uses: haskell-actions/setup@v2
id: setup-haskell-cabal
with:
ghc-version: ${{ matrix.ghc }}
Expand All @@ -38,10 +37,25 @@ jobs:
path: |
${{ steps.setup-haskell-cabal.outputs.cabal-store }}
dist-newstyle
key: ${{ runner.os }}-${{ matrix.ghc }}-${{ hashFiles('cabal.project.freeze') }}
key: ${{ runner.os }}-${{ matrix.ghc }}-${{ matrix.package }}-${{ hashFiles('cabal.project.freeze') }}
restore-keys: |
${{ runner.os }}-${{ matrix.ghc }}-
- run: cabal build all $CONFIG
- run: cabal test all $CONFIG
- run: cabal haddock all $CONFIG
- run: cabal sdist all
${{ runner.os }}-${{ matrix.ghc }}-${{ matrix.package }}-
- run: cabal build ${{ matrix.package }} $CONFIG
- run: cabal test "${{ matrix.package }}:integration-test"
- run: cabal haddock ${{ matrix.package }}
- run: cabal sdist

build-latest:
runs-on: ubuntu-latest
needs: fourmolu
env:
CONFIG: "--enable-tests --enable-benchmarks --flags=dev"
steps:
- uses: actions/checkout@v4
- uses: haskell-actions/setup@v2
with:
ghc-version: "9.12"
cabal-version: "latest"
- run: cabal update
- run: cabal build $CONFIG
- run: cabal test $CONFIG
31 changes: 0 additions & 31 deletions .github/workflows/ci.yml

This file was deleted.

44 changes: 44 additions & 0 deletions .github/workflows/nix-ci.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,44 @@
name: "Nix Build"
on:
pull_request:
push:
branches: [master]
jobs:
cabal-nix:
runs-on: ubuntu-latest
strategy:
matrix:
ghc: ["ghc910", "ghc912"]
steps:
- uses: actions/checkout@v4
- uses: cachix/install-nix-action@v22
with:
nix_path: nixpkgs=channel:nixos-unstable
- name: Initalize User Nix conf
run: |
mkdir -p $HOME/.config/nix
- name: Add haskell.nix as a substituter in the user Nix conf
run: |
echo "substituters = https://cache.iog.io https://iohk.cachix.org https://cache.nixos.org/" >> $HOME/.config/nix/nix.conf
- name: Add the public key for the haskell.nix substituter
run: |
echo "trusted-public-keys = hydra.iohk.io:f/Ea+s+dFdN+3Y/G+FDgSq+a5NEWhJGzdjvKNGv0/EQ= iohk.cachix.org-1:DpRUyj7h7V830dp/i6Nti+NEO2/nhblbov/8MW7Rqoo= cache.nixos.org-1:6NCHdD59X431o0gWypbMrAURkbJ16ZPMQFGspcDShjY=" >> $HOME/.config/nix/nix.conf
- name: Display the completed user Nix conf
run: |
cat $HOME/.config/nix/nix.conf
- uses: cachix/cachix-action@v17
with:
name: adetokunbo-open
- uses: nix-community/cache-nix-action@v7
with:
primary-key: nix-${{ runner.os }}-${{ matrix.ghc }}-${{ hashFiles('**/*.nix') }}
restore-prefixes-first-match: |
nix-${{ runner.os }}-${{ matrix.ghc }}-
nix-${{ runner.os }}-
gc-max-store-size-linux: 1073741824
- name: Fetch shell dependencies
run: |
nix-shell --argstr ghc ${{ matrix.ghc }} --run "ghc --version && cabal --version"
- name: Build and test
run: |
nix-shell --argstr ghc ${{ matrix.ghc }} --run "cabal build all && cabal test all"
3 changes: 1 addition & 2 deletions README.md
Original file line number Diff line number Diff line change
@@ -1,9 +1,8 @@
# wai-middleware-delegate

[![GitHub CI](https://github.com/adetokunbo/wai-middleware-delegate/actions/workflows/ci.yml/badge.svg)](https://github.com/adetokunbo/wai-middleware-delegate/actions)
[![GitHub CI](https://github.com/adetokunbo/wai-middleware-delegate/actions/workflows/nix-ci.yml/badge.svg)](https://github.com/adetokunbo/wai-middleware-delegate/actions)
[![Stackage Nightly](http://stackage.org/package/wai-middleware-delegate/badge/nightly)](http://stackage.org/nightly/package/wai-middleware-delegate)
[![Hackage][hackage-badge]][hackage]
[![Hackage Dependencies][hackage-deps-badge]][hackage-deps]
[![BSD3](https://img.shields.io/badge/license-BSD3-green.svg?dummy)](https://github.com/adetokunbo/wai-middleware-delegate/blob/master/LICENSE)

`wai-middleware-delegate` is a [WAI][1] middleware that allows requests to be
Expand Down
4 changes: 3 additions & 1 deletion default.nix
Original file line number Diff line number Diff line change
Expand Up @@ -3,11 +3,13 @@ let
pkgs-nix = import ./h8x.nix;
in
{ pkgs ? pkgs-nix
, ghc ? dev.compiler-nix-name
} : pkgs.haskell-nix.cabalProject {
# 'cleanGit' cleans a source directory based on the files known by git
src = pkgs.haskell-nix.haskellLib.cleanGit {
name = "wai-middleware-delegate";
src = ./.;
};
inherit (dev) compiler-nix-name index-state;
compiler-nix-name = ghc;
inherit (dev) index-state;
}
12 changes: 6 additions & 6 deletions dev.nix
Original file line number Diff line number Diff line change
@@ -1,14 +1,14 @@
{
# Pin haskell-nix to a recent (as of 2024/12/29) commit
h8x-commit = "d65cc46ed1b8efadfbff6d41403b465525ffc225";
# Pin haskell-nix to a recent (as of 2025/06/21) commit
h8x-commit = "a3f435537829d97a1d2b1d27675963ac3ab21151";

# Pin hackage-nix to the potentially more recent version of hackage
hackage-nix-commit = "88fb58dc1ccce1290b7db5773a867169374b539d";
# Pin hackage-nix to the potentially more recent version of hackage (as if 2026/06/24)
hackage-nix-commit = "f118693f7a5ba47711714782c05d6a0108f707a2";

# Specify the GHC version to use.
compiler-nix-name = "ghc982";
compiler-nix-name = "ghc98";

# Specify the hackage index state which should be supported by either
# the h8x-commit, or the hackage-nix-commit, whichever is latest
index-state = "2024-12-29T00:00:00Z";
index-state = "2026-06-24T00:00:00Z";
}
6 changes: 3 additions & 3 deletions shell.nix
Original file line number Diff line number Diff line change
@@ -1,5 +1,6 @@
{ ghc ? (import ./dev.nix).compiler-nix-name }:
let
project = import ./default.nix {};
project = import ./default.nix { inherit ghc; };
in
project.shellFor {
# Don't build haddock to optimize build time
Expand All @@ -12,8 +13,7 @@ in
hlint = "latest";
haskell-language-server = "latest";
ghcid = "latest";
fourmolu = "0.15.0.0";
cabal-fmt = "latest";
fourmolu = "latest";
};
# See overlays/tools.nix for more details

Expand Down
Loading