Skip to content

Commit

Permalink
build: test with other compiler versions
Browse files Browse the repository at this point in the history
  • Loading branch information
DavSanchez committed May 20, 2024
1 parent ccd701a commit 01b8e69
Show file tree
Hide file tree
Showing 5 changed files with 125 additions and 57 deletions.
95 changes: 94 additions & 1 deletion .github/workflows/tests.yml
Original file line number Diff line number Diff line change
Expand Up @@ -7,6 +7,7 @@ on:
branches: [master]
jobs:
checks:
name: "Run Nix checks"
runs-on: ${{ matrix.os }}
strategy:
matrix:
Expand All @@ -25,5 +26,97 @@ jobs:
- name: Run Nix checks
run: nix flake check

- name: Build with Nix (runs tests)
default-ghc:
name: "Build & test with Nix (default unstable GHC)"
needs: [checks]
runs-on: ${{ matrix.os }}
strategy:
matrix:
os: [ubuntu-latest, macos-latest]
steps:
- uses: actions/checkout@v4

- name: Install Nix
uses: cachix/install-nix-action@v27

- name: Enable cache for Nix
uses: DeterminateSystems/magic-nix-cache-action@v2

- name: Build default package with Nix
run: nix build

ghc-94:
name: "Build & test with Nix (GHC 9.4)"
needs: [checks]
runs-on: ${{ matrix.os }}
strategy:
matrix:
os: [ubuntu-latest, macos-latest]
steps:
- uses: actions/checkout@v4

- name: Install Nix
uses: cachix/install-nix-action@v27

- name: Enable cache for Nix
uses: DeterminateSystems/magic-nix-cache-action@v2

- name: Build package with Nix (GHC 9.4)
run: nix build ".#richenv-ghc94"

ghc-96:
name: "Build & test with Nix (GHC 9.6)"
needs: [checks]
runs-on: ${{ matrix.os }}
strategy:
matrix:
os: [ubuntu-latest, macos-latest]
steps:
- uses: actions/checkout@v4

- name: Install Nix
uses: cachix/install-nix-action@v27

- name: Enable cache for Nix
uses: DeterminateSystems/magic-nix-cache-action@v2

- name: Build package with Nix (GHC 9.6)
run: nix build ".#richenv-ghc96"

ghc-98:
name: "Build & test with Nix (GHC 9.8)"
needs: [checks]
runs-on: ${{ matrix.os }}
strategy:
matrix:
os: [ubuntu-latest, macos-latest]
steps:
- uses: actions/checkout@v4

- name: Install Nix
uses: cachix/install-nix-action@v27

- name: Enable cache for Nix
uses: DeterminateSystems/magic-nix-cache-action@v2

- name: Build package with Nix (GHC 9.8)
run: nix build ".#richenv-ghc98"

# ghc-910:
# name: "Build & test with Nix (GHC 9.10)"
# needs: [checks]
# runs-on: ${{ matrix.os }}
# strategy:
# matrix:
# os: [ubuntu-latest, macos-latest]
# steps:
# - uses: actions/checkout@v4

# - name: Install Nix
# uses: cachix/install-nix-action@v27

# - name: Enable cache for Nix
# uses: DeterminateSystems/magic-nix-cache-action@v2

# - name: Build package with Nix (GHC 9.10)
# run: nix build ".#richenv-ghc910"
4 changes: 4 additions & 0 deletions CHANGELOG.md
Original file line number Diff line number Diff line change
@@ -1,5 +1,9 @@
# Revision history for richenv

## 0.1.0.2 -- 2024-05-20

* test: switch dependency for YAML parsing from `yaml` to `HsYAML`.

## 0.1.0.1 -- 2023-09-25

* Fix changelog.
Expand Down
59 changes: 13 additions & 46 deletions flake.lock

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

22 changes: 13 additions & 9 deletions flake.nix
Original file line number Diff line number Diff line change
Expand Up @@ -10,8 +10,9 @@

outputs = inputs @ {flake-parts, ...}:
flake-parts.lib.mkFlake {inherit inputs;} {
imports = [
inputs.git-hooks.flakeModule
imports = with inputs; [
git-hooks.flakeModule
# haskell-flake.flakeModule
];

systems = [
Expand All @@ -25,9 +26,7 @@
config,
pkgs,
...
}: let
haskell = pkgs.haskellPackages;
in {
}: {
pre-commit = {
check.enable = true;
settings = {
Expand All @@ -43,8 +42,6 @@
ormolu.enable = true;
hlint.enable = true;
hpack.enable = true;
# yamllint.enable = true;
# hunspell.enable = true;
};
};
};
Expand All @@ -56,15 +53,22 @@
'';
nativeBuildInputs = config.pre-commit.settings.enabledPackages;

buildInputs = with haskell; [
buildInputs = with pkgs.haskellPackages; [
ghc
cabal-install
haskell-language-server
hspec-discover
];
};

packages.default = haskell.callPackage ./default.nix {};
packages = {
default = pkgs.haskellPackages.callPackage ./default.nix {};

richenv-ghc94 = pkgs.haskell.packages.ghc94.callPackage ./default.nix {};
richenv-ghc96 = pkgs.haskell.packages.ghc96.callPackage ./default.nix {};
richenv-ghc98 = pkgs.haskell.packages.ghc98.callPackage ./default.nix {};
# richenv-ghc910 = pkgs.haskell.packages.ghc910.callPackage ./default.nix {};
};
};
};
}
2 changes: 1 addition & 1 deletion richenv.cabal
Original file line number Diff line number Diff line change
Expand Up @@ -58,7 +58,7 @@ extra-doc-files:
-- Extra source files to be distributed with the package, such as examples, or a tutorial module.
-- extra-source-files:

tested-with: GHC ==9.2.8 || ==9.4.6 || ==9.6.2
tested-with: GHC ==9.4.8 || ==9.6.5 || ==9.8.2 || ==9.10.1

source-repository head
type: git
Expand Down

0 comments on commit 01b8e69

Please sign in to comment.