From dfbc85a02cf374c247fa3fed6a968a72963449b1 Mon Sep 17 00:00:00 2001 From: Tim Emiola Date: Wed, 1 Jul 2026 10:42:38 +0900 Subject: [PATCH 1/2] Update dev files --- .github/workflows/cabal.yml | 2 +- .github/workflows/ci.yml | 31 ------------------------- .github/workflows/nix-ci.yml | 44 ++++++++++++++++++++++++++++++++++++ README.md | 3 +-- default.nix | 4 +++- dev.nix | 12 +++++----- shell.nix | 6 ++--- 7 files changed, 58 insertions(+), 44 deletions(-) delete mode 100644 .github/workflows/ci.yml create mode 100644 .github/workflows/nix-ci.yml diff --git a/.github/workflows/cabal.yml b/.github/workflows/cabal.yml index 6444a8d..49f94be 100644 --- a/.github/workflows/cabal.yml +++ b/.github/workflows/cabal.yml @@ -21,7 +21,7 @@ jobs: 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"] + ghc: ["8.10.7", "9.0.2", "9.2.8", "9.4.8", "9.6", "9.8", "9.10", "9.12"] env: CONFIG: "--enable-tests --enable-benchmarks --flags=dev" steps: diff --git a/.github/workflows/ci.yml b/.github/workflows/ci.yml deleted file mode 100644 index 410ecf8..0000000 --- a/.github/workflows/ci.yml +++ /dev/null @@ -1,31 +0,0 @@ -name: "Nix Build" -on: - pull_request: - push: - branches: [master] -jobs: - cabal-nix: - runs-on: ubuntu-latest - 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.nixos.org https://hydra.iohk.io" >> $HOME/.config/nix/nix.conf - - name: Add the public key for the haskell.nix substituter - run: | - echo "trusted-public-keys = cache.nixos.org-1:6NCHdD59X431o0gWypbMrAURkbJ16ZPMQFGspcDShjY= hydra.iohk.io:f/Ea+s+dFdN+3Y/G+FDgSq+a5NEWhJGzdjvKNGv0/EQ=" >> $HOME/.config/nix/nix.conf - - uses: cachix/cachix-action@v10 - with: - name: adetokunbo-open - - name: Display the completed user Nix conf - run: | - cat $HOME/.config/nix/nix.conf - - name: Run the tests in a nix-shell - run: | - nix-shell --run "cabal new-test --test-show-details=streaming" diff --git a/.github/workflows/nix-ci.yml b/.github/workflows/nix-ci.yml new file mode 100644 index 0000000..d561645 --- /dev/null +++ b/.github/workflows/nix-ci.yml @@ -0,0 +1,44 @@ +name: "Nix Build" +on: + pull_request: + push: + branches: [main] +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" diff --git a/README.md b/README.md index a0afdde..83eff12 100644 --- a/README.md +++ b/README.md @@ -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 diff --git a/default.nix b/default.nix index ed0346c..e6833c4 100644 --- a/default.nix +++ b/default.nix @@ -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; } diff --git a/dev.nix b/dev.nix index a363bf6..904bd75 100644 --- a/dev.nix +++ b/dev.nix @@ -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"; } diff --git a/shell.nix b/shell.nix index 8c9fc54..431a91d 100644 --- a/shell.nix +++ b/shell.nix @@ -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 @@ -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 From 3007d69527d2c6384e3678f712055a8fd46a304e Mon Sep 17 00:00:00 2001 From: Tim Emiola Date: Wed, 1 Jul 2026 10:57:13 +0900 Subject: [PATCH 2/2] Update the workflow files --- .github/workflows/cabal.yml | 36 +++++++++++++++++++++++++----------- .github/workflows/nix-ci.yml | 2 +- 2 files changed, 26 insertions(+), 12 deletions(-) diff --git a/.github/workflows/cabal.yml b/.github/workflows/cabal.yml index 49f94be..7872a12 100644 --- a/.github/workflows/cabal.yml +++ b/.github/workflows/cabal.yml @@ -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"] + 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 }} @@ -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 diff --git a/.github/workflows/nix-ci.yml b/.github/workflows/nix-ci.yml index d561645..4bfd7b1 100644 --- a/.github/workflows/nix-ci.yml +++ b/.github/workflows/nix-ci.yml @@ -2,7 +2,7 @@ name: "Nix Build" on: pull_request: push: - branches: [main] + branches: [master] jobs: cabal-nix: runs-on: ubuntu-latest