Skip to content

Commit

Permalink
WIP
Browse files Browse the repository at this point in the history
  • Loading branch information
phadej committed Nov 14, 2024
1 parent 372179b commit 8960056
Show file tree
Hide file tree
Showing 4 changed files with 45 additions and 6 deletions.
4 changes: 2 additions & 2 deletions fixtures/doctest-version.github
Original file line number Diff line number Diff line change
Expand Up @@ -417,7 +417,7 @@ jobs:
- name: cache (tools)
uses: actions/cache/restore@v4
with:
key: ${{ runner.os }}-${{ matrix.compiler }}-tools-af17a32a
key: ${{ runner.os }}-${{ matrix.compiler }}-tools-58bfb495
path: ~/.haskell-ci-tools
- name: install cabal-plan
run: |
Expand All @@ -436,7 +436,7 @@ jobs:
if: always()
uses: actions/cache/save@v4
with:
key: ${{ runner.os }}-${{ matrix.compiler }}-tools-af17a32a
key: ${{ runner.os }}-${{ matrix.compiler }}-tools-58bfb495
path: ~/.haskell-ci-tools
- name: checkout
uses: actions/checkout@v4
Expand Down
4 changes: 2 additions & 2 deletions fixtures/doctest.github
Original file line number Diff line number Diff line change
Expand Up @@ -417,7 +417,7 @@ jobs:
- name: cache (tools)
uses: actions/cache/restore@v4
with:
key: ${{ runner.os }}-${{ matrix.compiler }}-tools-761cb1ae
key: ${{ runner.os }}-${{ matrix.compiler }}-tools-ae4cd18b
path: ~/.haskell-ci-tools
- name: install cabal-plan
run: |
Expand All @@ -436,7 +436,7 @@ jobs:
if: always()
uses: actions/cache/save@v4
with:
key: ${{ runner.os }}-${{ matrix.compiler }}-tools-761cb1ae
key: ${{ runner.os }}-${{ matrix.compiler }}-tools-ae4cd18b
path: ~/.haskell-ci-tools
- name: checkout
uses: actions/checkout@v4
Expand Down
4 changes: 2 additions & 2 deletions src/HaskellCI/Config/History.hs
Original file line number Diff line number Diff line change
Expand Up @@ -41,9 +41,9 @@ configHistory =
, ver 0 19 2024114 := \cfg -> cfg
& field @"cfgSetupMethods" .~ PerSetupMethod
{ hvrPpa = C.noVersion
, ghcup = invertVersionRange (C.withinVersion (C.mkVersion [9,8,3])) /\ C.earlierVersion (C.mkVersion [9,12,0])
, ghcup = invertVersionRange (C.withinVersion (C.mkVersion [9,8,3])) /\ C.earlierVersion (C.mkVersion [9,12])
, ghcupVanilla = C.withinVersion (C.mkVersion [9,8,3])
, ghcupPrerelease = C.orLaterVersion (C.mkVersion [9,12,0])
, ghcupPrerelease = C.orLaterVersion (C.mkVersion [9,12])
}
]
where
Expand Down
39 changes: 39 additions & 0 deletions src/HaskellCI/SetupMethod.hs
Original file line number Diff line number Diff line change
@@ -0,0 +1,39 @@
{-# LANGUAGE OverloadedStrings #-}
module HaskellCI.SetupMethod where

import HaskellCI.Prelude
import HaskellCI.YamlSyntax

data SetupMethod
= HVRPPA
| GHCUP
| GHCUPvanilla
| GHCUPprerelease
deriving (Eq, Ord, Show, Enum, Bounded)

instance ToYaml SetupMethod where
toYaml HVRPPA = "hvrppa"
toYaml GHCUP = "ghcup"
toYaml GHCUPvanilla = "ghcup-vanilla"
toYaml GHCUPprerelease = "ghcup-prerelease"

data PerSetupMethod a = PerSetupMethod
{ hvrPpa :: a
, ghcup :: a
, ghcupVanilla :: a
, ghcupPrerelease :: a
}
deriving (Show, Generic, Binary, Functor, Foldable, Traversable)

instance Representable SetupMethod PerSetupMethod where
index f HVRPPA = hvrPpa f
index f GHCUP = ghcup f
index f GHCUPvanilla = ghcupVanilla f
index f GHCUPprerelease = ghcupPrerelease f

tabulate f = PerSetupMethod
{ hvrPpa = f HVRPPA
, ghcup = f GHCUP
, ghcupVanilla = f GHCUPvanilla
, ghcupPrerelease = f GHCUPprerelease
}

0 comments on commit 8960056

Please sign in to comment.