Expose minimal flake and use matrix on build code

This commit is contained in:
Oscar Izquierdo 2024-08-05 22:40:05 +02:00 committed by Sebastián Estrella
parent b87f959b89
commit dca8e4fb1c
2 changed files with 13 additions and 12 deletions

View File

@ -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,15 +27,10 @@ jobs:
with:
extra-conf: accept-flake-config = true
- uses: DeterminateSystems/magic-nix-cache-action@v7
# TODO: improve with matrix
- name: Compile code ghc8107
run: nix build .#test-ghc8107
- name: Run tests ghc8107
run: nix run .#test-ghc8107
- name: Compile code ghc902
run: nix build .#test-ghc902
- name: Run tests ghc902
run: nix run .#test-ghc902
- 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

View File

@ -46,8 +46,7 @@
};
flake-ghc8107 = pkgs.hapistrano-ghc8107.flake { };
flake-ghc902 = pkgs.hapistrano-ghc902.flake { };
in
flake-ghc8107 // flake-ghc902 // rec {
in rec {
apps = {
test-ghc8107 = {
type = "app";
@ -58,7 +57,6 @@
program = "${packages.test-ghc902}/bin/test";
};
};
legacyPackages = pkgs;
packages = {
default = flake-ghc8107.packages."hapistrano:exe:hap";
test-ghc8107 = flake-ghc8107.packages."hapistrano:test:test".overrideAttrs (_: {
@ -86,5 +84,10 @@
'';
});
};
devShells = {
default = devShells.ghc902;
ghc8107 = flake-ghc8107.devShells.default;
ghc902 = flake-ghc902.devShells.default;
};
});
}