Skip to content

Commit

Permalink
Merge pull request #79 from sorki/srk/ci
Browse files Browse the repository at this point in the history
Upper bounds, CI, badges
  • Loading branch information
sorki authored Nov 21, 2023
2 parents 9134dea + 6b5daad commit 872cac9
Show file tree
Hide file tree
Showing 9 changed files with 78 additions and 51 deletions.
50 changes: 26 additions & 24 deletions .github/workflows/ci.yaml
Original file line number Diff line number Diff line change
@@ -1,17 +1,20 @@
# Code generated by dhall-to-yaml. DO NOT EDIT.
jobs:
build:
"runs-on": "ubuntu-latest"
name: "GHC ${{ matrix.ghc }}, Cabal ${{ matrix.cabal }}, OS ${{ matrix.os }}"
"runs-on": "${{ matrix.os }}"
steps:
- uses: "actions/checkout@v3"
- uses: "cachix/install-nix-action@v23"
with:
nix_path: "nixpkgs=channel:nixos-unstable"
- uses: "actions/checkout@v4"
with:
submodules: recursive
- id: "setup-haskell-cabal"
uses: "haskell/actions/setup@v2"
uses: "haskell-actions/setup@v2"
with:
"cabal-version": "${{ matrix.cabal }}"
"enable-stack": false
"ghc-version": "${{ matrix.ghc }}"
- uses: cachix/install-nix-action@v17
with:
nix_path: nixpkgs=channel:nixos-unstable
- name: Update Hackage repository
run: cabal update
- name: cabal.project.local.ci
Expand All @@ -20,10 +23,10 @@ jobs:
cp cabal.project.local.ci cabal.project.local
fi
- name: freeze
run: cabal freeze
run: "cabal freeze --enable-tests --enable-benchmarks"
- uses: "actions/cache@v3"
with:
key: "${{ runner.os }}-${{ matrix.ghc }}-cabal-${{ hashFiles('cabal.project.freeze') }}"
key: "${{ matrix.os }}-${{ matrix.ghc }}-${{ matrix.cabal}}-${{ hashFiles('cabal.project.freeze') }}"
path: |
${{ steps.setup-haskell-cabal.outputs.cabal-store }}
dist-newstyle
Expand All @@ -33,24 +36,23 @@ jobs:
run: "cabal build all --enable-tests --enable-benchmarks"
- name: test all
run: "cabal test all --enable-tests"
- name: haddock all
run: cabal haddock all
- name: Build with Nix
run: "nix-build --argstr compiler $(echo ghc${{ matrix.ghc }} | tr -d '.')"
strategy:
matrix:
cabal:
- '3.4'
- '3.10'
ghc:
- '9.4.4'
- '9.2.5'
- '9.0.2'
- '8.10.7'
build-nix:
"runs-on": "ubuntu-latest"
steps:
- uses: "actions/checkout@v3"
- uses: cachix/install-nix-action@v17
with:
github_access_token: ${{ secrets.GITHUB_TOKEN }}
- name: check it build with nix
run: nix build
- '9.6.3'
- '9.4.7'
- '9.2.8'
os:
- "ubuntu-latest"
name: Haskell CI
'on':
- pull_request
pull_request: {}
push: {}
schedule:
- cron: "4 20 10 * *"
5 changes: 5 additions & 0 deletions CHANGELOG.md
Original file line number Diff line number Diff line change
@@ -1,3 +1,8 @@
1.0.20

* [Bump upper bounds](https://github.com/Gabriella439/nix-diff/pull/79)
* Allow `unix-2.8` and few more

1.0.19

* [New Haskell API](https://github.com/Gabriella439/nix-diff/pull/60)
Expand Down
6 changes: 4 additions & 2 deletions README.md
Original file line number Diff line number Diff line change
@@ -1,5 +1,9 @@
# `nix-diff`

[![GitHub Workflow Status](https://img.shields.io/github/actions/workflow/status/Gabriella439/nix-diff/ci.yaml?branch=main)](https://github.com/Gabriella439/nix-diff/actions/workflows/ci.yaml)
[![Hackage version](https://img.shields.io/hackage/v/nix-diff.svg?color=success)](https://hackage.haskell.org/package/nix-diff)
[![Dependencies](https://img.shields.io/hackage-deps/v/nix-diff?label=Dependencies)](https://packdeps.haskellers.com/feed?needle=nix-diff)

This package provides a `nix-diff` executable which explains why two Nix
derivations differ. The most common use cases for this are:

Expand Down Expand Up @@ -91,8 +95,6 @@ You need to have nix installed in your PC.

## Development status

[![Build Status](https://travis-ci.org/Gabriella439/nix-diff.png)](https://travis-ci.org/Gabriella439/nix-diff)

I don't currently plan to add any new features, but I do welcome feature
requests. Just open an issue on the issue tracker if you would like to request
an improvement.
Expand Down
7 changes: 7 additions & 0 deletions ci.dhall
Original file line number Diff line number Diff line change
@@ -0,0 +1,7 @@
let haskellCi =
https://raw.githubusercontent.com/sorki/github-actions-dhall/main/haskell-ci.dhall

in haskellCi.generalCi
(haskellCi.withNix haskellCi.defaultCabalSteps)
(haskellCi.DhallMatrix::{=} with ghc = haskellCi.defaultGHC3)
: haskellCi.CI.Type
10 changes: 10 additions & 0 deletions ci.sh
Original file line number Diff line number Diff line change
@@ -0,0 +1,10 @@
#!/usr/bin/env bash
# Script by @fisx

set -eo pipefail
cd "$( dirname "${BASH_SOURCE[0]}" )"

echo "regenerating .github/workflows/ci.yaml"

which dhall-to-yaml || cabal install dhall-yaml
dhall-to-yaml-ng --generated-comment --file ci.dhall > .github/workflows/ci.yaml
19 changes: 15 additions & 4 deletions default.nix
Original file line number Diff line number Diff line change
Expand Up @@ -8,15 +8,26 @@
#
# ... and then Nix will supply the correct Haskell development environment for
# you
{ compiler ? null
}:
let
config = { };

overlay = pkgsNew: pkgsOld: {
haskellPackages = pkgsOld.haskellPackages.override (old: {
haskellPackages =
let
packageSet =
if compiler == null
then pkgsOld.haskellPackages
else pkgsOld.haskell.packages.${compiler};
in packageSet.override (old: {
overrides =
let
sourceOverrides = pkgsNew.haskell.lib.packageSourceOverrides {
"nix-diff" = ./.;
fromCabal2nix = self: super: {
nix-diff =
# see a note in flake.nix
pkgsNew.haskell.lib.dontCheck
(self.callCabal2nix "nix-diff" ./. { });
};

fromDirectory = pkgsNew.haskell.lib.packagesFromDirectory {
Expand All @@ -27,7 +38,7 @@ let

in
pkgsNew.lib.fold pkgsNew.lib.composeExtensions default [
sourceOverrides
fromCabal2nix
fromDirectory
];

Expand Down
8 changes: 0 additions & 8 deletions flake.nix
Original file line number Diff line number Diff line change
Expand Up @@ -47,12 +47,4 @@
devShells.default = pkgs.haskellPackages.nix-diff.env;
}
));

nixConfig = {
extra-substituters = [ "https://cache.garnix.io" ];

extra-trusted-public-keys = [
"cache.garnix.io:CTFPyKSLcx5RMJKfLo5EEPUObbA78b0YQ2DTCJXqr9g="
];
};
}
18 changes: 9 additions & 9 deletions nix-diff.cabal
Original file line number Diff line number Diff line change
Expand Up @@ -26,15 +26,15 @@ library
build-depends: base >= 4.9 && < 5
, attoparsec >= 0.13 && < 0.15
, aeson
, bytestring >= 0.9 && < 0.12
, containers >= 0.5 && < 0.7
, bytestring >= 0.9 && < 0.13
, containers >= 0.5 && < 0.8
, directory < 1.4
, mtl >= 2.2 && < 2.3
, mtl >= 2.2 && < 2.4
, nix-derivation >= 1.1 && < 1.2
, optparse-applicative >= 0.14.0.0 && < 0.18
, optparse-applicative >= 0.14.0.0 && < 0.19
, patience >= 0.3 && < 0.4
, text >= 1.2 && < 2.1
, vector >= 0.12 && < 0.13
, text >= 1.2 && < 2.2
, vector >= 0.12 && < 0.14
, process < 1.7
, filepath < 1.5
, QuickCheck < 2.15
Expand All @@ -54,7 +54,7 @@ executable nix-diff
, bytestring
, optparse-applicative >= 0.14.0.0 && < 0.18
, text
, unix < 2.8
, unix < 2.9
, containers
, mtl
hs-source-dirs: app
Expand All @@ -78,8 +78,8 @@ test-suite nix-diff-test
, text
, containers
, mtl
, typed-process < 0.2.11
, tasty < 1.5
, typed-process < 0.2.12
, tasty < 1.6
, tasty-quickcheck < 0.11
, tasty-silver < 3.4

Expand Down
6 changes: 2 additions & 4 deletions nix/nix-derivation.nix
Original file line number Diff line number Diff line change
Expand Up @@ -3,10 +3,8 @@
}:
mkDerivation {
pname = "nix-derivation";
version = "1.1.1";
sha256 = "2d69ca33daa5f92b3601b263b1360b230ff193e144db815b1b039b0ed8c18fc9";
revision = "1";
editedCabalFile = "1ink37s91kbrq8p0sqyi1i90xp2jimyg1cnzy9ydjh3iv21f7pi5";
version = "1.1.3";
sha256 = "11drhg3zjhwbvdw25k0icvbkcpqilx0m9qw60k7snfaz1iadfkdb";
isLibrary = true;
isExecutable = true;
libraryHaskellDepends = [
Expand Down

0 comments on commit 872cac9

Please sign in to comment.