Skip to content

Commit

Permalink
Expose minimal flake and use matrix on build code
Browse files Browse the repository at this point in the history
  • Loading branch information
oscar-izval authored and sestrella committed Aug 6, 2024
1 parent b87f959 commit dca8e4f
Show file tree
Hide file tree
Showing 2 changed files with 13 additions and 12 deletions.
16 changes: 7 additions & 9 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,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
Expand Down
9 changes: 6 additions & 3 deletions flake.nix
Original file line number Diff line number Diff line change
Expand Up @@ -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";
Expand All @@ -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 (_: {
Expand Down Expand Up @@ -86,5 +84,10 @@
'';
});
};
devShells = {
default = devShells.ghc902;
ghc8107 = flake-ghc8107.devShells.default;
ghc902 = flake-ghc902.devShells.default;
};
});
}

0 comments on commit dca8e4f

Please sign in to comment.