Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Support 9.2 with only cmpType changes. #92

Open
wants to merge 11 commits into
base: master
Choose a base branch
from
Open
66 changes: 66 additions & 0 deletions .github/workflows/cabal.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,66 @@
name: cabal

on:
push:
branches: [ci-cabal, wip/ghc-9.2-minimal]
pull_request:
branches: [master, main]

jobs:
build:
name: ghc ${{ matrix.ghc }}
runs-on: ubuntu-latest
strategy:
matrix:
cabal: ["3.6"]
ghc:
- "8.2.2"
- "9.2.1"

steps:
- uses: actions/checkout@v2
with:
submodules: true

- uses: haskell/actions/setup@v1
name: Setup GHC and cabal-install
with:
ghc-version: ${{ matrix.ghc }}
cabal-version: ${{ matrix.cabal }}

- uses: rwe/actions-hlint-setup@v1
name: Set up HLint
with:
version: "3.3.4"

- uses: actions/cache@v2
name: cache ~/.cabal/store
with:
path: ~/.cabal/store
key: ${{ runner.os }}-${{ matrix.ghc }}-cabal

- name: build
run: |
cabal v2-update
cabal v2-build all:libs
cabal v2-build uom-plugin --enable-tests

- name: build defs
run: cabal v2-build uom-plugin-defs

# WARNING: Compiles to core lint errors with ghc-9.2.1
- name: build examples
if: ${{ matrix.ghc == '8.2.2' }}
run: cabal v2-build uom-plugin-examples

- name: test uom-plugin:units
run: cabal v2-test uom-plugin:units --test-show-details=direct --test-option="--color=always"

- name: test uom-plugin-tutorial:doctest
run: cabal v2-test uom-plugin-tutorial:doctest --test-show-details=direct --test-option="--color=always"

- uses: rwe/actions-hlint-run@v2
name: hlint
with:
path: '["uom-plugin", "uom-plugin-defs", "uom-plugin-examples", "uom-plugin-tutorial" ]'
fail-on: suggestion
3 changes: 3 additions & 0 deletions .gitmodules
Original file line number Diff line number Diff line change
@@ -0,0 +1,3 @@
[submodule "ghc-corroborate"]
path = ghc-corroborate
url = https://github.com/blockscope/ghc-corroborate
11 changes: 6 additions & 5 deletions build/Main.hs
Original file line number Diff line number Diff line change
Expand Up @@ -12,8 +12,8 @@ main = shakeArgs shakeOptions $ do
sequence_ $ formatPkg <$> dhallPkgs
sequence_ $ hpack <$> dhallPkgs
sequence_ $ cabal <$> dhallCabal
phony "dhall-format" $ need $ (\x -> "dhall-format-" ++ x) <$> dhallPkgs ++ dhallRootImports
phony "hpack-dhall" $ need $ (\x -> "hpack-dhall-" ++ x) <$> dhallPkgs
phony "dhall-format" $ need $ ("dhall-format-" ++) <$> dhallPkgs ++ dhallRootImports
phony "hpack-dhall" $ need $ ("hpack-dhall-" ++) <$> dhallPkgs
phony "cabal-files" $ need $ (\(x, y) -> x </> y <.> "cabal") <$> dhallCabal

type Folder = String
Expand All @@ -28,6 +28,7 @@ dhallPkgs = fst <$> dhallCabal
dhallCabal :: [(Folder, Pkg)]
dhallCabal =
[ ("uom-plugin", "uom-plugin")
, ("uom-plugin-defs", "uom-plugin-defs")
, ("uom-plugin-examples", "uom-plugin-examples")
, ("uom-plugin-tutorial", "uom-plugin-tutorial")
, ("build", "build-uom-plugin")
Expand All @@ -39,18 +40,18 @@ dhallRootImports = ["defaults"]
formatPkg :: Folder -> Rules ()
formatPkg folder =
phony ("dhall-format-" ++ folder)
$ cmd Shell ("dhall format --inplace " ++ (folder </> "package.dhall"))
$ cmd Shell ("dhall format " ++ (folder </> "package.dhall"))

formatRoot :: String -> Rules ()
formatRoot x =
phony ("dhall-format-" ++ x)
$ cmd Shell ("dhall format --inplace " ++ (x <.> ".dhall"))
$ cmd Shell ("dhall format " ++ (x <.> ".dhall"))

hpack :: Folder -> Rules ()
hpack folder =
phony ("hpack-dhall-" ++ folder) $ do
need ["dhall-format-" ++ folder]
cmd (Cwd folder) Shell ("dhall-hpack-cabal --package-dhall=package.dhall")
cmd (Cwd folder) Shell "dhall-hpack-cabal --package-dhall=package.dhall"

cabal :: (Folder, Pkg) -> Rules ()
cabal (folder, pkg) =
Expand Down
10 changes: 5 additions & 5 deletions build/build-uom-plugin.cabal
Original file line number Diff line number Diff line change
@@ -1,10 +1,10 @@
cabal-version: 1.12

-- This file has been generated from package.dhall by hpack version 0.31.0.
-- This file has been generated from package.dhall by hpack version 0.34.6.
--
-- see: https://github.com/sol/hpack
--
-- hash: bec7aa84478fcff5a44bca8fd75597ac24f83c51fd414ba6f9fbd0cf9bd4f97d
-- hash: bed7ffcc01000f2c62945f98eac2b6f8e9f6b947d966b10788e505c88e729acf

name: build-uom-plugin
version: 0.3.0.1
Expand All @@ -14,7 +14,8 @@ category: Build
author: Adam Gundry <[email protected]>
maintainer: Adam Gundry <[email protected]>
copyright: Copyright (c) 2014-2018, Adam Gundry
tested-with: GHC == 8.0.2, GHC == 8.2.2, GHC == 8.4.4, GHC == 8.6.5, GHC == 8.8.3
tested-with:
GHC == 8.0.2, GHC == 8.2.2, GHC == 8.4.4, GHC == 8.6.5, GHC == 8.8.3
build-type: Simple
extra-source-files:
package.dhall
Expand All @@ -24,12 +25,11 @@ executable build-uom-plugin
other-modules:
Paths_build_uom_plugin
hs-source-dirs:
./.
./
ghc-options: -Wall -fno-warn-unticked-promoted-constructors -rtsopts -threaded -with-rtsopts=-N
build-depends:
ansi-terminal
, base
, dhall
, raw-strings-qq
, shake
, text
Expand Down
39 changes: 12 additions & 27 deletions build/package.dhall
Original file line number Diff line number Diff line change
@@ -1,29 +1,14 @@
./../defaults.dhall
⫽ { name =
"build-uom-plugin"
, synopsis =
"A shake build of uom-plugin."
, description =
"Builds the packages making up uom-plugin."
, category =
"Build"
, executables =
{ build-uom-plugin =
{ dependencies =
[ "base"
, "ansi-terminal"
, "dhall"
, "shake"
, "raw-strings-qq"
, "text"
, "time"
]
, ghc-options =
[ "-rtsopts", "-threaded", "-with-rtsopts=-N" ]
, main =
"Main.hs"
, source-dirs =
"."
}
}
⫽ { name = "build-uom-plugin"
, synopsis = "A shake build of uom-plugin."
, description = "Builds the packages making up uom-plugin."
, category = "Build"
, executables.build-uom-plugin
=
{ dependencies =
[ "base", "ansi-terminal", "shake", "raw-strings-qq", "text", "time" ]
, ghc-options = [ "-rtsopts", "-threaded", "-with-rtsopts=-N" ]
, main = "Main.hs"
, source-dirs = "."
}
}
9 changes: 8 additions & 1 deletion cabal.project
Original file line number Diff line number Diff line change
@@ -1,2 +1,9 @@
packages: */*.cabal
packages:
ghc-corroborate/ghc-corroborate
uom-plugin
uom-plugin-defs
uom-plugin-tutorial
uom-plugin-examples
build
tests: True
write-ghc-environment-files: always
Loading