Skip to content
Merged
Show file tree
Hide file tree
Changes from 4 commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
87 changes: 0 additions & 87 deletions .github/workflows/ci.yaml

This file was deleted.

73 changes: 73 additions & 0 deletions .github/workflows/haskell-ci.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,73 @@
name: Haskell-CI
permissions:
contents: read

on:
push:
branches:
- 'main'
pull_request:
branches:
- 'main'
schedule:
- cron: 0 0 * * *
workflow_dispatch:
inputs:
nightly:
description: Run with the same settings as a nightly build
type: boolean
default: false

concurrency:
group: ${{ github.workflow }}-${{ github.event.pull_request.number || github.ref }}
cancel-in-progress: true

jobs:
check-formatting:
name: Check formatting
runs-on: ubuntu-latest
steps:
- uses: actions/checkout@v4
- name: install fourmolu
run: |
wget https://github.com/fourmolu/fourmolu/releases/download/v0.17.0.0/fourmolu-0.17.0.0-linux-x86_64
chmod +x fourmolu-0.17.0.0-linux-x86_64
mv fourmolu-0.17.0.0-linux-x86_64 fourmolu
- run: ./fourmolu -c .

test-with-cabal:
name: Haskell-CI - Linux - ${{ matrix.ghc-version }}

strategy:
matrix:
ghc-version: [latest, 9.12, "9.10", 9.8, 9.6, 9.4, 9.2, 9.0, "8.10"]
os: [ubuntu-latest]
fail-fast: false

runs-on: ${{ matrix.os }}

steps:
- name: Set NIGHTLY environment variable if the job was triggered by the scheduler
if: "${{ github.event_name == 'schedule'
|| contains(github.event.pull_request.title, 'nightly')
|| contains(github.event.pull_request.title, 'NIGHTLY')
|| github.event_name == 'workflow_dispatch' && github.event.inputs.nightly }}"
run: |
echo "NIGHTLY=true" >> $GITHUB_ENV

- uses: actions/checkout@v4
- uses: haskell-actions/setup@v2
with:
ghc-version: ${{matrix.ghc-version}}
- uses: actions/cache/restore@v4
with:
key: ${{ matrix.os }}-${{ matrix.ghc-version }}-${{ github.sha }}
path: ~/.cabal/store
restore-keys: ${{ matrix.os }}-${{ matrix.ghc-version }}-
- run: cabal build all
- run: cabal test all
- run: cabal haddock all
- uses: actions/cache/save@v4
with:
key: ${{ matrix.os }}-${{ matrix.ghc-version }}-${{ github.sha }}
path: ~/.cabal/store
16 changes: 9 additions & 7 deletions quickcheck-dynamic/src/Test/QuickCheck/DynamicLogic/Internal.hs
Original file line number Diff line number Diff line change
Expand Up @@ -592,9 +592,11 @@ keepTryingUntil n g p = do
shrinkDLTest :: DynLogicModel s => DynLogic s -> DynLogicTest s -> [DynLogicTest s]
shrinkDLTest _ (Looping _) = []
shrinkDLTest d tc =
[ test | as' <- shrinkScript d (getScript tc), let pruned = pruneDLTest d as'
test = makeTestFromPruned d pruned,
-- Don't shrink a non-executable test case to an executable one.
[ test
| as' <- shrinkScript d (getScript tc)
, let pruned = pruneDLTest d as'
test = makeTestFromPruned d pruned
, -- Don't shrink a non-executable test case to an executable one.
case (tc, test) of
(DLScript _, _) -> True
(_, DLScript _) -> False
Expand All @@ -619,10 +621,10 @@ shrinkScript = shrink' initialAnnotatedState
[TestSeqStep (unsafeCoerceVar var := act') ss | Some act'@ActionWithPolarity{} <- computeShrinkAction s act]
++ [ TestSeqStep step ss'
| ss' <-
shrink'
(nextStateStep step s)
(stepDLStep d s step)
ss
shrink'
(nextStateStep step s)
(stepDLStep d s step)
ss
]
nonstructural _ _ TestSeqStop = []

Expand Down
3 changes: 2 additions & 1 deletion quickcheck-dynamic/src/Test/QuickCheck/StateModel.hs
Original file line number Diff line number Diff line change
Expand Up @@ -286,7 +286,8 @@ instance Show Polarity where
show PosPolarity = "+"
show NegPolarity = "-"

data ActionWithPolarity state a = Eq (Action state a) =>
data ActionWithPolarity state a
= Eq (Action state a) =>
ActionWithPolarity
{ polarAction :: Action state a
, polarity :: Polarity
Expand Down
Loading