diff --git a/.github/workflows/build.yml b/.github/workflows/build.yml index 60a31f04..712a27c3 100644 --- a/.github/workflows/build.yml +++ b/.github/workflows/build.yml @@ -15,6 +15,9 @@ jobs: - macos-13 # x86_64-darwin - macos-latest # aarch64-darwin - ubuntu-latest # x86_64-linux + ghc: + - ghc8107 + - ghc902 fail-fast: true runs-on: ${{ matrix.os }} timeout-minutes: 15 @@ -24,10 +27,10 @@ jobs: with: extra-conf: accept-flake-config = true - uses: DeterminateSystems/magic-nix-cache-action@v7 - - name: Compile code - run: nix build .#test - - name: Run tests - run: nix run .#test + - name: Compile code ${{ matrix.ghc }} + run: nix build .#test-${{ matrix.ghc }} + - name: Run tests ${{ matrix.ghc }} + run: nix run .#test-${{ matrix.ghc }} docker: uses: ./.github/workflows/reusable-docker.yml diff --git a/flake.nix b/flake.nix index 99e590ba..062c8406 100644 --- a/flake.nix +++ b/flake.nix @@ -7,8 +7,14 @@ nixConfig = { allow-import-from-derivation = "true"; - extra-substituters = [ "https://cache.iog.io" ]; - extra-trusted-public-keys = [ "hydra.iohk.io:f/Ea+s+dFdN+3Y/G+FDgSq+a5NEWhJGzdjvKNGv0/EQ=" ]; + extra-substituters = [ + "https://cache.iog.io" + "https://cache.zw3rk.com" + ]; + extra-trusted-public-keys = [ + "hydra.iohk.io:f/Ea+s+dFdN+3Y/G+FDgSq+a5NEWhJGzdjvKNGv0/EQ=" + "loony-tools:pr9m4BkM/5/eSTZlkQyRt57Jz7OMBxNSUiMC4FkcNfk=" + ]; }; outputs = inputs@{ self, flake-utils, haskellNix, nixpkgs }: @@ -21,29 +27,39 @@ overlays = [ haskellNix.overlay (final: prev: { - hapistrano = final.haskell-nix.cabalProject' { + hapistrano-ghc8107 = final.haskell-nix.cabalProject' { src = final.haskell-nix.haskellLib.cleanGit { name = "hapistrano"; src = ./.; }; compiler-nix-name = "ghc8107"; }; + hapistrano-ghc902 = final.haskell-nix.cabalProject' { + src = final.haskell-nix.haskellLib.cleanGit { + name = "hapistrano"; + src = ./.; + }; + compiler-nix-name = "ghc902"; + }; }) ]; }; - flake = pkgs.hapistrano.flake { }; - in - flake // rec { + flake-ghc8107 = pkgs.hapistrano-ghc8107.flake { }; + flake-ghc902 = pkgs.hapistrano-ghc902.flake { }; + in rec { apps = { - test = { + test-ghc8107 = { type = "app"; - program = "${packages.test}/bin/test"; + program = "${packages.test-ghc8107}/bin/test"; + }; + test-ghc902 = { + type = "app"; + program = "${packages.test-ghc902}/bin/test"; }; }; - legacyPackages = pkgs; packages = { - default = flake.packages."hapistrano:exe:hap"; - test = flake.packages."hapistrano:test:test".overrideAttrs (_: { + default = flake-ghc8107.packages."hapistrano:exe:hap"; + test-ghc8107 = flake-ghc8107.packages."hapistrano:test:test".overrideAttrs (_: { postFixup = '' wrapProgram $out/bin/test \ --set PATH ${pkgs.lib.makeBinPath [ @@ -55,8 +71,23 @@ ]} ''; }); + test-ghc902 = flake-ghc902.packages."hapistrano:test:test".overrideAttrs (_: { + postFixup = '' + wrapProgram $out/bin/test \ + --set PATH ${pkgs.lib.makeBinPath [ + pkgs.bash + pkgs.coreutils + pkgs.findutils + pkgs.git + pkgs.zsh + ]} + ''; + }); + }; + devShells = { + default = devShells.ghc902; + ghc8107 = flake-ghc8107.devShells.default; + ghc902 = flake-ghc902.devShells.default; }; }); } - -