Skip to content

Commit

Permalink
Merge pull request #241 from stackbuilders/ci-ghc902
Browse files Browse the repository at this point in the history
Added ghc902 to CI build
  • Loading branch information
oscar-izval authored Aug 8, 2024
2 parents 6f61598 + dca8e4f commit dea0bec
Show file tree
Hide file tree
Showing 2 changed files with 51 additions and 17 deletions.
11 changes: 7 additions & 4 deletions .github/workflows/build.yml
Original file line number Diff line number Diff line change
Expand Up @@ -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
Expand All @@ -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
Expand Down
57 changes: 44 additions & 13 deletions flake.nix
Original file line number Diff line number Diff line change
Expand Up @@ -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 }:
Expand All @@ -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 [
Expand All @@ -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;
};
});
}


0 comments on commit dea0bec

Please sign in to comment.