Run build on ghc8107

This commit is contained in:
Sebastian Estrella 2024-07-05 15:59:22 -05:00
parent 81c99d15d3
commit 8698aebc12
2 changed files with 33 additions and 63 deletions

View File

@ -1,8 +1,3 @@
# The present workflow was made based on the following references:
# - https://github.com/actions/cache/blob/main/examples.md#haskell---cabal
# - https://github.com/haskell/time/blob/master/.github/workflows/ci.yml
# - https://github.com/stackbuilders/stache/blob/master/.github/workflows/ci.yaml
# - https://markkarpov.com/post/github-actions-for-haskell-ci.html
--- ---
name: Build name: Build
@ -15,31 +10,24 @@ concurrency:
jobs: jobs:
haskell: haskell:
strategy: strategy:
fail-fast: true
matrix: matrix:
os: os:
- macos-13 # x86_64-darwin - macos-13 # x86_64-darwin
# - macos-latest # aarch64-darwin - macos-latest # aarch64-darwin
# - ubuntu-latest # x86_64-linux - ubuntu-latest # x86_64-linux
installable: fail-fast: true
# - test-ghc8107
- test-ghc902 # TODO: Rename package to test-ghc924
# exclude:
# - os: ubuntu-latest
# installable: test-ghc902
runs-on: ${{ matrix.os }} runs-on: ${{ matrix.os }}
timeout-minutes: 10 timeout-minutes: 10
steps: steps:
- uses: actions/checkout@v4 - uses: actions/checkout@v4
- uses: DeterminateSystems/nix-installer-action@v12 - uses: DeterminateSystems/nix-installer-action@v12
with: with:
extra-conf: extra-conf: accept-flake-config = true
accept-flake-config = true
- uses: DeterminateSystems/magic-nix-cache-action@v7 - uses: DeterminateSystems/magic-nix-cache-action@v7
- name: Compile code - name: Compile code
run: nix build .#${{ matrix.installable }} run: nix build .#test
- name: Run tests - name: Run tests
run: nix run .#${{ matrix.installable }} run: nix run .#test
docker: docker:
if: false if: false

View File

@ -6,7 +6,7 @@
}; };
nixConfig = { nixConfig = {
allow-import-from-derivation = true; allow-import-from-derivation = "true";
extra-substituters = [ "https://cache.iog.io" ]; extra-substituters = [ "https://cache.iog.io" ];
extra-trusted-public-keys = [ "hydra.iohk.io:f/Ea+s+dFdN+3Y/G+FDgSq+a5NEWhJGzdjvKNGv0/EQ=" ]; extra-trusted-public-keys = [ "hydra.iohk.io:f/Ea+s+dFdN+3Y/G+FDgSq+a5NEWhJGzdjvKNGv0/EQ=" ];
}; };
@ -20,59 +20,41 @@
inherit (haskellNix) config; inherit (haskellNix) config;
overlays = [ overlays = [
haskellNix.overlay haskellNix.overlay
(final: prev: (final: prev: {
let hapistrano = final.haskell-nix.cabalProject' {
mkCabalProject = compiler-nix-name: final.haskell-nix.cabalProject' { src = final.haskell-nix.haskellLib.cleanGit {
inherit compiler-nix-name; name = "hapistrano";
src = final.haskell-nix.haskellLib.cleanGit { src = ./.;
name = "hapistrano";
src = ./.;
};
}; };
in compiler-nix-name = "ghc8107";
{ };
hapistrano-ghc8107 = mkCabalProject "ghc8107"; })
hapistrano-ghc902 = mkCabalProject "ghc924";
})
]; ];
}; };
flake-ghc8107 = pkgs.hapistrano-ghc8107.flake { }; flake = pkgs.hapistrano.flake { };
flake-ghc902 = pkgs.hapistrano-ghc902.flake { };
overrideTestPackage = flake: flake.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
]}
'';
});
in in
rec { flake // rec {
apps = { apps = {
test-ghc8107 = { test = {
type = "app"; type = "app";
program = "${packages.test-ghc8107}/bin/test"; program = "${packages.test}/bin/test";
};
test-ghc902 = {
type = "app";
program = "${packages.test-ghc902}/bin/test";
}; };
}; };
devShells = { legacyPackages = pkgs;
default = devShells.ghc902;
ghc8107 = flake-ghc8107.devShells.default;
ghc902 = flake-ghc902.devShells.default;
};
packages = { packages = {
default = packages.hap-ghc902; default = flake.packages."hapistrano:exe:hap";
hap-ghc8107 = flake-ghc8107.packages."hapistrano:exe:hap"; test = flake.packages."hapistrano:test:test".overrideAttrs (_: {
hap-ghc902 = flake-ghc902.packages."hapistrano:exe:hap"; postFixup = ''
test-ghc8107 = overrideTestPackage flake-ghc8107; wrapProgram $out/bin/test \
test-ghc902 = overrideTestPackage flake-ghc902; --set PATH ${pkgs.lib.makeBinPath [
pkgs.bash
pkgs.coreutils
pkgs.findutils
pkgs.git
pkgs.zsh
]}
'';
});
}; };
}); });
} }