Skip to content

Commit

Permalink
[fix] update to ghc 94 (#2)
Browse files Browse the repository at this point in the history
* [fix] update to ghc 94
- fix the compile errors
- fix the test failures
- add github workflows to verify it keeps working
- add nix env
- prepare flake update such that we can update easily in the future
- reformat with stylish-haskell as good as possible
  • Loading branch information
MangoIV committed Oct 24, 2023
1 parent 4faca25 commit 95ee8b5
Show file tree
Hide file tree
Showing 25 changed files with 488 additions and 154 deletions.
1 change: 1 addition & 0 deletions .envrc
Original file line number Diff line number Diff line change
@@ -0,0 +1 @@
use flake -Lv
16 changes: 16 additions & 0 deletions .github/workflows/test-flake.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,16 @@
name: "Check Flake"
on:
workflow_dispatch:
pull_request:
push:
jobs:
install-nix:
runs-on: ubuntu-latest
steps:
- uses: actions/checkout@v3
- uses: cachix/install-nix-action@v22
with:
github_access_token: ${{ secrets.GITHUB_TOKEN }}
- run: nix flake check -Lv --allow-import-from-derivation --fallback --accept-flake-config
- run: nix build .#transitive-anns -Lv --fallback --accept-flake-config
- run: nix build .#ghc92-transitive-anns -Lv --fallback --accept-flake-config
21 changes: 21 additions & 0 deletions .github/workflows/update-flake-lock.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,21 @@
name: update-flake-lock
on:
workflow_dispatch: # allows manual triggering
schedule:
- cron: '0 0 * * 0' # runs weekly on Sunday at 00:00

jobs:
lockfile:
runs-on: ubuntu-latest
steps:
- name: Checkout repository
uses: actions/checkout@v3
- name: Install Nix
uses: DeterminateSystems/nix-installer-action@main
- name: Update flake.lock
uses: DeterminateSystems/update-flake-lock@main
with:
pr-title: "Update flake.lock" # Title of PR to be created
pr-labels: | # Labels to be set on the PR
dependencies
automated
6 changes: 5 additions & 1 deletion .gitignore
Original file line number Diff line number Diff line change
@@ -1,2 +1,6 @@
.stack-work/
*~
*~
.direnv
dist*
result*
.pre-commit-config.yaml
2 changes: 1 addition & 1 deletion Setup.hs
Original file line number Diff line number Diff line change
@@ -1,2 +1,2 @@
import Distribution.Simple
import Distribution.Simple
main = defaultMain
205 changes: 205 additions & 0 deletions flake.lock

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

49 changes: 49 additions & 0 deletions flake.nix
Original file line number Diff line number Diff line change
@@ -0,0 +1,49 @@
{
nixConfig.allow-import-from-derivation = true;
inputs = {
nixpkgs.url = "github:nixos/nixpkgs/nixpkgs-unstable";
parts.url = "github:hercules-ci/flake-parts";
haskell-flake.url = "github:srid/haskell-flake";
pre-commit-hooks.url = "github:cachix/pre-commit-hooks.nix";
};
outputs = inputs:
inputs.parts.lib.mkFlake {inherit inputs;} {
systems = ["x86_64-linux"];
imports = [
inputs.haskell-flake.flakeModule
inputs.pre-commit-hooks.flakeModule
];

perSystem = {
config,
pkgs,
...
}: {
pre-commit = {
check.enable = true;
settings.hooks = {
cabal-fmt.enable = true;
hlint.enable = true;

alejandra.enable = true;
statix.enable = true;
deadnix.enable = true;
};
};

haskellProjects.ghc92 = {
packages = {};
settings = {};
basePackages = pkgs.haskell.packages.ghc92;
devShell.mkShellArgs.shellHook = config.pre-commit.installationScript;
};

haskellProjects.default = {
packages = {};
settings = {};
basePackages = pkgs.haskell.packages.ghc94;
devShell.mkShellArgs.shellHook = config.pre-commit.installationScript;
};
};
};
}
7 changes: 6 additions & 1 deletion hie.yaml
Original file line number Diff line number Diff line change
@@ -1,2 +1,7 @@
cradle:
stack: {}
cabal:
- path: "src"
component: "lib:transitive-anns"

- path: "test"
component: "transitive-anns:test:test"
Loading

0 comments on commit 95ee8b5

Please sign in to comment.