From ce1a5c10bbf50b02f07fb5472af16f28e73f7bd8 Mon Sep 17 00:00:00 2001 From: Mateusz Galazyn Date: Wed, 27 Dec 2023 10:26:19 +0100 Subject: [PATCH] Remove GHC9.2 from CI. --- .github/workflows/github-page.yml | 7 ++++--- .github/workflows/haskell.yml | 7 ++----- flake.nix | 25 +++++++++++++++++-------- 3 files changed, 23 insertions(+), 16 deletions(-) diff --git a/.github/workflows/github-page.yml b/.github/workflows/github-page.yml index 7d7471420a..e9a28ab13b 100644 --- a/.github/workflows/github-page.yml +++ b/.github/workflows/github-page.yml @@ -1,6 +1,7 @@ name: "Haddock documentation" on: + pull_request: push: branches: - main @@ -32,17 +33,17 @@ jobs: - name: Fetch nix cache and update cabal indices run: | - nix develop .\#ghc962 --command \ + nix develop .\#haddockShell --command \ cabal update - name: Build whole project run: | - nix develop .\#ghc962 --command \ + nix develop .\#haddockShell --command \ cabal build all - name: Build documentation run: | - nix develop .\#ghc962 --command \ + nix develop .\#haddockShell --command \ cabal haddock-project --local --output=./haddocks --internal --foreign-libraries - name: Compress haddocks diff --git a/.github/workflows/haskell.yml b/.github/workflows/haskell.yml index f52bcafc8d..ba0db49386 100644 --- a/.github/workflows/haskell.yml +++ b/.github/workflows/haskell.yml @@ -11,12 +11,9 @@ jobs: strategy: fail-fast: false matrix: - ghc: ["8.10.7", "9.2.7", "9.6.2"] - cabal: ["3.10.1.0"] + ghc: ["8.10.7", "9.6.3"] + cabal: ["3.10.2.0"] os: [ubuntu-latest, macos-latest, windows-latest] - exclude: - - ghc: "9.2.7" - os: macos-latest env: # Modify this value to "invalidate" the cabal cache. diff --git a/flake.nix b/flake.nix index 930319d741..3550e7a937 100644 --- a/flake.nix +++ b/flake.nix @@ -45,7 +45,8 @@ inherit (nixpkgs) lib; # see flake `variants` below for alternative compilers - defaultCompiler = "ghc928"; + defaultCompiler = "ghc963"; + haddockShellCompiler = "ghc963"; # We use cabalProject' to ensure we don't build the plan for # all systems. cabalProject = nixpkgs.haskell-nix.cabalProject' ({config, ...}: { @@ -76,7 +77,7 @@ # tools we want in our shell, from hackage shell.tools = { - cabal = "3.10.1.0"; + cabal = "3.10.2.0"; ghcid = "0.8.8"; } // lib.optionalAttrs (config.compiler-nix-name == defaultCompiler) { @@ -137,25 +138,33 @@ # This ensure hydra send a status for the required job (even if no change other than commit hash) revision = nixpkgs.writeText "revision" (inputs.self.rev or "dirty"); }; - }; - legacyPackages = rec { + } + // { haddockShell = devShells.haddockShell; }; + legacyPackages = { inherit cabalProject nixpkgs; # also provide hydraJobs through legacyPackages to allow building without system prefix: inherit hydraJobs; }; devShells = let - profillingShell = p: { + profilingShell = p: { # `nix develop .#profiling` (or `.#ghc927.profiling): a shell with profiling enabled profiling = (p.appendModule {modules = [{enableLibraryProfiling = true;}];}).shell; }; in - profillingShell cabalProject + profilingShell cabalProject # Additional shells for every GHC version supported by haskell.nix, eg. `nix develop .#ghc927` // lib.mapAttrs (compiler-nix-name: _: let p = cabalProject.appendModule {inherit compiler-nix-name;}; in - p.shell // (profillingShell p)) - nixpkgs.haskell-nix.compiler; + p.shell // (profilingShell p)) + nixpkgs.haskell-nix.compiler + # Add GHC 9.6 shell for haddocks + // + { haddockShell = let + p = cabalProject.appendModule {compiler-nix-name = haddockShellCompiler;}; + in + p.shell // (profilingShell p); + }; # formatter used by nix fmt formatter = nixpkgs.alejandra; }