Skip to content

Commit

Permalink
Add CI check (#2)
Browse files Browse the repository at this point in the history
* Add CI check

* Oh
  • Loading branch information
danieljharvey authored Nov 28, 2023
1 parent ade2003 commit 3f9c31f
Show file tree
Hide file tree
Showing 3 changed files with 24 additions and 43 deletions.
20 changes: 20 additions & 0 deletions .github/workflows/nix-check.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,20 @@
name: nix check

on:
push:

jobs:
nix-develop:
name: nix develop
runs-on: ubuntu-latest
steps:
- name: Checkout 🛎️
uses: actions/checkout@v4

- uses: DeterminateSystems/nix-installer-action@main

- uses: DeterminateSystems/magic-nix-cache-action@main

- name: nix develop --command true
run: |
nix develop --print-build-logs --command true
8 changes: 0 additions & 8 deletions .github/workflows/wasm-calc-haskell.yml
Original file line number Diff line number Diff line change
Expand Up @@ -4,18 +4,10 @@ on:
push:
branches:
- trunk
paths:
- "wasm-calc/**"
- "cabal.project"
- "cabal.project.freeze"

pull_request:
branches:
- trunk
paths:
- "wasm-calc/**"
- "cabal.project"
- "cabal.project.freeze"

jobs:
build:
Expand Down
39 changes: 4 additions & 35 deletions flake.nix
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
{
description = "Mimsa";
description = "wasm-calc";

inputs = {
nixpkgs.url = "github:NixOS/nixpkgs";
Expand All @@ -11,27 +11,6 @@
let
pkgs = nixpkgs.legacyPackages.${system};

oldCompilerVersion = "ghc945";

# we are going to build ormolu and hlint with an old ghc that isn't
# broken
oldHaskell = pkgs.haskell // {
packages = pkgs.haskell.packages // {
"${oldCompilerVersion}" =
pkgs.haskell.packages."${oldCompilerVersion}".override {
overrides = self: super: {
# On aarch64-darwin, this creates a cycle for some reason; didn't look too much into it.
ghcid = pkgs.haskell.lib.dontCheck (pkgs.haskell.lib.overrideCabal super.ghcid (drv: { enableSeparateBinOutput = false; }));
# has wrong version of unix-compat, so we ignore it
shelly = pkgs.haskell.lib.doJailbreak super.shelly;
};

};
};
};

oldHaskellPackages = haskell.packages.${oldCompilerVersion};

# current compiler version, ideally, we'll put everything here
# eventually

Expand Down Expand Up @@ -62,7 +41,7 @@
jailbreakUnbreak = pkg:
pkgs.haskell.lib.doJailbreak (pkg.overrideAttrs (_: { meta = { }; }));

packageName = "mimsa";
packageName = "wasm-calc";
in
{
# we're not interested in building with Nix, just using it for deps
Expand All @@ -72,25 +51,15 @@

devShell = pkgs.mkShell {
buildInputs = with haskellPackages; [
oldHaskellPackages.hlint
oldHaskellPackages.ormolu
hlint
ormolu
# haskell-language-server # this simply does nothing atm
ghcid
cabal-fmt
cabal-install
ghc
pkgs.zlib # used by `digest` package
pkgs.nodejs-18_x
pkgs.clang_14
pkgs.llvmPackages_14.llvm
pkgs.nodePackages.ts-node
];

# put clang_14 on the path
#shellHook = with pkgs; ''
# export PATH="${clang_14}/bin:$PATH"
#'';

inputsFrom = builtins.attrValues self.packages.${system};
};
});
Expand Down

0 comments on commit 3f9c31f

Please sign in to comment.