use directly cabal instead of nix in CI

This commit is contained in:
Marco Perone 2023-03-09 11:14:54 +01:00 committed by Marco Perone
parent 9c0a65d019
commit a63e79d519
5 changed files with 498 additions and 9 deletions

View File

@ -13,14 +13,56 @@ jobs:
build:
strategy:
matrix:
ghc: ['90', '92']
ghc: ['9.0.2', '9.2.7']
cabal: ['3.8.1.0', '3.6.2.0', '3.4.1.0']
os: ['ubuntu-latest', 'macos-latest']
exclude:
# Cabal 3.4.1.0 supports GHC version < 9.1
- cabal: '3.4.1.0'
ghc: '9.2.7'
- cabal: '3.4.1.0'
ghc: '9.4.4'
runs-on: ${{ matrix.os }}
name: Build with GHC ${{ matrix.ghc }} on ${{ matrix.os }}
name: Build and test with cabal ${{ matrix.cabal }} and GHC ${{ matrix.ghc }} on ${{ matrix.os }}
steps:
- uses: actions/checkout@v3
- uses: cachix/install-nix-action@v18
with:
nix_path: nixpkgs=channel:nixos-22.11
- name: Build
run: nix build -L .#crem.ghc${{ matrix.ghc }}
- name: Checkout
uses: actions/checkout@v3
- name: Setup Haskell
id: setup-haskell
uses: haskell/actions/setup@v2
with:
ghc-version: ${{ matrix.ghc }}
cabal-version: ${{ matrix.cabal }}
- name: Cache
uses: actions/cache@v3
with:
path: ${{ steps.setup-haskell.outputs.cabal-store }}
key: ${{ runner.os }}-${{ matrix.ghc }}-${{ github.sha }}
restore-keys: ${{ runner.os }}-${{ matrix.ghc }}-
- name: Build dependencies
run: cabal build --only-dependencies
- name: Build
run: cabal build
- name: Test on current dependencies
run: cabal test
- name: Test on HEAD dependencies
run: cabal test --index-state HEAD
# strategy:
# matrix:
# ghc: ['90', '92']
# os: ['ubuntu-latest', 'macos-latest']
# runs-on: ${{ matrix.os }}
# name: Build with GHC ${{ matrix.ghc }} on ${{ matrix.os }}
# steps:
# - uses: actions/checkout@v3
# - uses: cachix/install-nix-action@v18
# with:
# nix_path: nixpkgs=channel:nixos-22.11
# - name: Build
# run: nix build -L .#crem.ghc${{ matrix.ghc }}

1
.gitignore vendored
View File

@ -1,7 +1,6 @@
# cabal
dist
dist-*
*.cabal
.ghc.*
# nix

View File

@ -1,2 +1,3 @@
index-state: 2023-03-09T07:24:13Z
packages: *.cabal
write-ghc-environment-files: always

446
crem.cabal Normal file
View File

@ -0,0 +1,446 @@
cabal-version: 2.0
-- This file has been generated from package.yaml by hpack version 0.35.1.
--
-- see: https://github.com/sol/hpack
name: crem
version: 0.1.0.0
description: `crem` stands for __c__ompositional __r__epresentable __e__xecutable __m__achines. It allows creating state machines (Mealy machines in fact), compose them to build bigger machines out of smaller ones and then run them and draw their flow and their state space.
author: Marco Perone
maintainer: marco.perone@tweag.io
copyright: 2022 Tweag I/O
license: MIT
license-file: LICENSE
build-type: Simple
library
exposed-modules:
Crem.BaseMachine
Crem.Decider
Crem.Graph
Crem.Render.Render
Crem.Render.RenderableVertices
Crem.Render.RenderFlow
Crem.StateMachine
Crem.Topology
hs-source-dirs:
src
default-extensions:
DerivingStrategies
LambdaCase
PackageImports
ghc-options: -Weverything -Werror -Wno-safe -Wno-unsafe -Wno-missing-safe-haskell-mode -Wno-implicit-prelude -Wno-missing-export-lists -Wno-missing-home-modules -Wno-missing-import-lists -Wno-all-missed-specialisations
build-depends:
base
, profunctors
, singletons-base
, text
default-language: Haskell2010
if impl(ghc >= 9.2)
ghc-options: -Wno-missing-kind-signatures
default-language: GHC2021
else
default-extensions:
BangPatterns
BinaryLiterals
ConstrainedClassMethods
ConstraintKinds
DeriveDataTypeable
DeriveFoldable
DeriveFunctor
DeriveGeneric
DeriveLift
DeriveTraversable
DoAndIfThenElse
EmptyCase
EmptyDataDecls
EmptyDataDeriving
ExistentialQuantification
ExplicitForAll
FlexibleContexts
FlexibleInstances
ForeignFunctionInterface
GADTSyntax
GeneralisedNewtypeDeriving
HexFloatLiterals
ImplicitPrelude
ImportQualifiedPost
InstanceSigs
KindSignatures
MonomorphismRestriction
MultiParamTypeClasses
NamedFieldPuns
NamedWildCards
NumericUnderscores
PatternGuards
PolyKinds
PostfixOperators
RankNTypes
RelaxedPolyRec
ScopedTypeVariables
StandaloneDeriving
StandaloneKindSignatures
StarIsType
TraditionalRecordSyntax
TupleSections
TypeApplications
TypeOperators
TypeSynonymInstances
library crem-examples
exposed-modules:
Crem.Example.BooleanStateMachine
Crem.Example.LockDoor
Crem.Example.OneState
Crem.Example.PlusOneUpToFour
Crem.Example.RiskManager.Aggregate
Crem.Example.RiskManager.Application
Crem.Example.RiskManager.Domain
Crem.Example.RiskManager.Policy
Crem.Example.RiskManager.Projection
Crem.Example.Switch
Crem.Example.TheHobbit
Crem.Example.TriangularMachine
Crem.Example.TwoSwitchesGate
Crem.Example.Uno
hs-source-dirs:
examples
default-extensions:
DerivingStrategies
LambdaCase
PackageImports
ghc-options: -Weverything -Werror -Wno-safe -Wno-unsafe -Wno-missing-safe-haskell-mode -Wno-implicit-prelude -Wno-missing-export-lists -Wno-missing-home-modules -Wno-missing-import-lists -Wno-all-missed-specialisations
build-depends:
base
, crem
, profunctors
, singletons-base
, text
default-language: Haskell2010
if impl(ghc >= 9.2)
ghc-options: -Wno-missing-kind-signatures
default-language: GHC2021
else
default-extensions:
BangPatterns
BinaryLiterals
ConstrainedClassMethods
ConstraintKinds
DeriveDataTypeable
DeriveFoldable
DeriveFunctor
DeriveGeneric
DeriveLift
DeriveTraversable
DoAndIfThenElse
EmptyCase
EmptyDataDecls
EmptyDataDeriving
ExistentialQuantification
ExplicitForAll
FlexibleContexts
FlexibleInstances
ForeignFunctionInterface
GADTSyntax
GeneralisedNewtypeDeriving
HexFloatLiterals
ImplicitPrelude
ImportQualifiedPost
InstanceSigs
KindSignatures
MonomorphismRestriction
MultiParamTypeClasses
NamedFieldPuns
NamedWildCards
NumericUnderscores
PatternGuards
PolyKinds
PostfixOperators
RankNTypes
RelaxedPolyRec
ScopedTypeVariables
StandaloneDeriving
StandaloneKindSignatures
StarIsType
TraditionalRecordSyntax
TupleSections
TypeApplications
TypeOperators
TypeSynonymInstances
executable hobbit-game
main-is: Main.hs
hs-source-dirs:
hobbit-game
default-extensions:
DerivingStrategies
LambdaCase
PackageImports
ghc-options: -Weverything -Werror -Wno-safe -Wno-unsafe -Wno-missing-safe-haskell-mode -Wno-implicit-prelude -Wno-missing-export-lists -Wno-missing-home-modules -Wno-missing-import-lists -Wno-all-missed-specialisations
build-depends:
base
, crem
, crem-examples
default-language: Haskell2010
if impl(ghc >= 9.2)
ghc-options: -Wno-missing-kind-signatures
default-language: GHC2021
else
default-extensions:
BangPatterns
BinaryLiterals
ConstrainedClassMethods
ConstraintKinds
DeriveDataTypeable
DeriveFoldable
DeriveFunctor
DeriveGeneric
DeriveLift
DeriveTraversable
DoAndIfThenElse
EmptyCase
EmptyDataDecls
EmptyDataDeriving
ExistentialQuantification
ExplicitForAll
FlexibleContexts
FlexibleInstances
ForeignFunctionInterface
GADTSyntax
GeneralisedNewtypeDeriving
HexFloatLiterals
ImplicitPrelude
ImportQualifiedPost
InstanceSigs
KindSignatures
MonomorphismRestriction
MultiParamTypeClasses
NamedFieldPuns
NamedWildCards
NumericUnderscores
PatternGuards
PolyKinds
PostfixOperators
RankNTypes
RelaxedPolyRec
ScopedTypeVariables
StandaloneDeriving
StandaloneKindSignatures
StarIsType
TraditionalRecordSyntax
TupleSections
TypeApplications
TypeOperators
TypeSynonymInstances
executable hobbit-map
main-is: Main.hs
hs-source-dirs:
hobbit-map
default-extensions:
DerivingStrategies
LambdaCase
PackageImports
ghc-options: -Weverything -Werror -Wno-safe -Wno-unsafe -Wno-missing-safe-haskell-mode -Wno-implicit-prelude -Wno-missing-export-lists -Wno-missing-home-modules -Wno-missing-import-lists -Wno-all-missed-specialisations
build-depends:
base
, crem
, crem-examples
, text
default-language: Haskell2010
if impl(ghc >= 9.2)
ghc-options: -Wno-missing-kind-signatures
default-language: GHC2021
else
default-extensions:
BangPatterns
BinaryLiterals
ConstrainedClassMethods
ConstraintKinds
DeriveDataTypeable
DeriveFoldable
DeriveFunctor
DeriveGeneric
DeriveLift
DeriveTraversable
DoAndIfThenElse
EmptyCase
EmptyDataDecls
EmptyDataDeriving
ExistentialQuantification
ExplicitForAll
FlexibleContexts
FlexibleInstances
ForeignFunctionInterface
GADTSyntax
GeneralisedNewtypeDeriving
HexFloatLiterals
ImplicitPrelude
ImportQualifiedPost
InstanceSigs
KindSignatures
MonomorphismRestriction
MultiParamTypeClasses
NamedFieldPuns
NamedWildCards
NumericUnderscores
PatternGuards
PolyKinds
PostfixOperators
RankNTypes
RelaxedPolyRec
ScopedTypeVariables
StandaloneDeriving
StandaloneKindSignatures
StarIsType
TraditionalRecordSyntax
TupleSections
TypeApplications
TypeOperators
TypeSynonymInstances
test-suite crem-doctests
type: exitcode-stdio-1.0
main-is: Main.hs
hs-source-dirs:
doctest
default-extensions:
DerivingStrategies
LambdaCase
PackageImports
ghc-options: -Weverything -Werror -Wno-safe -Wno-unsafe -Wno-missing-safe-haskell-mode -Wno-implicit-prelude -Wno-missing-export-lists -Wno-missing-home-modules -Wno-missing-import-lists -Wno-all-missed-specialisations -threaded -Wno-unused-packages
build-depends:
base
, crem
, crem-examples
, doctest-parallel
default-language: Haskell2010
if impl(ghc >= 9.2)
ghc-options: -Wno-missing-kind-signatures
default-language: GHC2021
else
default-extensions:
BangPatterns
BinaryLiterals
ConstrainedClassMethods
ConstraintKinds
DeriveDataTypeable
DeriveFoldable
DeriveFunctor
DeriveGeneric
DeriveLift
DeriveTraversable
DoAndIfThenElse
EmptyCase
EmptyDataDecls
EmptyDataDeriving
ExistentialQuantification
ExplicitForAll
FlexibleContexts
FlexibleInstances
ForeignFunctionInterface
GADTSyntax
GeneralisedNewtypeDeriving
HexFloatLiterals
ImplicitPrelude
ImportQualifiedPost
InstanceSigs
KindSignatures
MonomorphismRestriction
MultiParamTypeClasses
NamedFieldPuns
NamedWildCards
NumericUnderscores
PatternGuards
PolyKinds
PostfixOperators
RankNTypes
RelaxedPolyRec
ScopedTypeVariables
StandaloneDeriving
StandaloneKindSignatures
StarIsType
TraditionalRecordSyntax
TupleSections
TypeApplications
TypeOperators
TypeSynonymInstances
test-suite crem-spec
type: exitcode-stdio-1.0
main-is: Spec.hs
other-modules:
Crem.DeciderSpec
Crem.GraphSpec
Crem.Render.RenderFlowSpec
Crem.Render.RenderSpec
Crem.RiskManagerSpec
Crem.StateMachineSpec
hs-source-dirs:
spec
default-extensions:
DerivingStrategies
LambdaCase
PackageImports
ghc-options: -Weverything -Werror -Wno-safe -Wno-unsafe -Wno-missing-safe-haskell-mode -Wno-implicit-prelude -Wno-missing-export-lists -Wno-missing-home-modules -Wno-missing-import-lists -Wno-all-missed-specialisations
build-tool-depends:
hspec-discover:hspec-discover
build-depends:
base
, crem
, crem-examples
, hspec
, profunctors
, singletons-base
default-language: Haskell2010
if impl(ghc >= 9.2)
ghc-options: -Wno-missing-kind-signatures
default-language: GHC2021
else
default-extensions:
BangPatterns
BinaryLiterals
ConstrainedClassMethods
ConstraintKinds
DeriveDataTypeable
DeriveFoldable
DeriveFunctor
DeriveGeneric
DeriveLift
DeriveTraversable
DoAndIfThenElse
EmptyCase
EmptyDataDecls
EmptyDataDeriving
ExistentialQuantification
ExplicitForAll
FlexibleContexts
FlexibleInstances
ForeignFunctionInterface
GADTSyntax
GeneralisedNewtypeDeriving
HexFloatLiterals
ImplicitPrelude
ImportQualifiedPost
InstanceSigs
KindSignatures
MonomorphismRestriction
MultiParamTypeClasses
NamedFieldPuns
NamedWildCards
NumericUnderscores
PatternGuards
PolyKinds
PostfixOperators
RankNTypes
RelaxedPolyRec
ScopedTypeVariables
StandaloneDeriving
StandaloneKindSignatures
StarIsType
TraditionalRecordSyntax
TupleSections
TypeApplications
TypeOperators
TypeSynonymInstances

View File

@ -134,6 +134,7 @@ tests:
- hspec
- profunctors
- singletons-base
build-tools: hspec-discover:hspec-discover
when:
- condition: false
other-modules: Paths_crem