Skip to content

Commit

Permalink
Merge pull request #372 from turion/dev_ci_nix_versions
Browse files Browse the repository at this point in the history
Build nix develop for all GHCs
  • Loading branch information
turion authored Nov 22, 2024
2 parents 2a4f7be + d3b66b7 commit 5ee4f6d
Show file tree
Hide file tree
Showing 4 changed files with 45 additions and 20 deletions.
29 changes: 27 additions & 2 deletions .github/workflows/ci.yml
Original file line number Diff line number Diff line change
Expand Up @@ -133,10 +133,34 @@ jobs:
run: nix flake check
- name: Build all packages
run: nix build --accept-flake-config

build-devshell:
name: Nix Flake Develop
needs:
- generateMatrix
- build-flake
strategy:
matrix: ${{ fromJSON(needs.generateMatrix.outputs.matrix) }}
runs-on: ubuntu-latest
steps:
- uses: actions/checkout@v4
- name: Free disk space
run: |
if [ "$(uname --kernel-name)" = "Linux" ]; then
sudo rm -rf /usr/local/* /usr/share/* /opt/*
docker rmi $(docker image ls -aq)
fi
- uses: cachix/install-nix-action@v30
- uses: DeterminateSystems/magic-nix-cache-action@v8
- uses: cachix/cachix-action@v15
with:
name: rhine
authToken: '${{ secrets.CACHIX_AUTH_TOKEN }}'
- name: Run tests
run: |
nix develop --accept-flake-config -c cabal update
nix develop --accept-flake-config -c cabal test all
ghc="ghc$(echo ${{ matrix.ghc }} | tr -d '.')" # Removes the dot from the ghc version and prepends "ghc"
nix develop .#${ghc} --accept-flake-config -c cabal update
nix develop .#${ghc} --accept-flake-config -c cabal test all
cabal-check:
name: Check and format all cabal files
Expand All @@ -154,6 +178,7 @@ jobs:
needs:
- build-cabal
- build-flake
- build-devshell
runs-on:
- ubuntu-latest
steps:
Expand Down
6 changes: 3 additions & 3 deletions flake.lock

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

20 changes: 10 additions & 10 deletions flake.nix
Original file line number Diff line number Diff line change
Expand Up @@ -70,17 +70,15 @@
(hfinal: hprev: lib.optionalAttrs (lib.versionOlder hprev.ghc.version "9.4") {
time-domain = doJailbreak hprev.time-domain;
})
(hfinal: hprev: lib.optionalAttrs (lib.versionOlder hprev.ghc.version "9.6") {
cabal-gild = doJailbreak hprev.cabal-gild;
fourmolu = doJailbreak hprev.fourmolu;
})
(hfinal: hprev: lib.optionalAttrs (lib.versionAtLeast hprev.ghc.version "9.10") {
# Remove these as nixpkgs progresses!
finite-typelits = doJailbreak hprev.finite-typelits;
finite-typelits = hprev.finite-typelits_0_2_1_0;

vector-sized = hprev.callHackageDirect
{
pkg = "vector-sized";
ver = "1.6.1";
sha256 = "sha256-//EOAwpEEQkdYF88U/bp0uybKleYHRmTWaKsxIZvCeQ=";
}
{ };
vector-sized = hprev.vector-sized_1_6_1;

microstache = doJailbreak hprev.microstache;
gloss-rendering = doJailbreak hprev.gloss-rendering;
Expand Down Expand Up @@ -180,10 +178,12 @@
(_: hp: hp.shellFor {
packages = ps: map (pname: ps.${pname}) pnames;
nativeBuildInputs = with hp; [
haskell-language-server
] ++ lib.optional (lib.versionAtLeast hp.ghc.version "9.4") [
fourmolu
cabal-gild
] ++ lib.optional (lib.versionAtLeast hp.ghc.version "9.6") [
cabal-install
fourmolu
haskell-language-server
];
})
(hpsFor pkgs));
Expand Down
10 changes: 5 additions & 5 deletions rhine/rhine.cabal
Original file line number Diff line number Diff line change
Expand Up @@ -31,11 +31,11 @@ data-files:
test/assets/*.txt

tested-with:
ghc ==9.2.8
ghc ==9.4.7
ghc ==9.6.4
ghc ==9.8.2
ghc ==9.10.1
ghc ==9.2
ghc ==9.4
ghc ==9.6
ghc ==9.8
ghc ==9.10

source-repository head
type: git
Expand Down

0 comments on commit 5ee4f6d

Please sign in to comment.