Skip to content

Commit f2d9800

Browse files
Test with lots of ghc versions (#95)
1 parent 252826f commit f2d9800

File tree

4 files changed

+116
-95
lines changed

4 files changed

+116
-95
lines changed

.github/workflows/ci.yaml

Lines changed: 0 additions & 87 deletions
This file was deleted.

.github/workflows/haskell-ci.yml

Lines changed: 105 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,105 @@
1+
name: Haskell-CI
2+
permissions:
3+
contents: read
4+
5+
on:
6+
push:
7+
branches:
8+
- 'main'
9+
pull_request:
10+
branches:
11+
- 'main'
12+
schedule:
13+
- cron: 0 0 * * *
14+
workflow_dispatch:
15+
inputs:
16+
nightly:
17+
description: Run with the same settings as a nightly build
18+
type: boolean
19+
default: false
20+
21+
concurrency:
22+
group: ${{ github.workflow }}-${{ github.event.pull_request.number || github.ref }}
23+
cancel-in-progress: true
24+
25+
jobs:
26+
check-formatting:
27+
name: Check formatting
28+
runs-on: ubuntu-latest
29+
steps:
30+
- uses: actions/checkout@v4
31+
- name: install fourmolu
32+
run: |
33+
wget https://github.com/fourmolu/fourmolu/releases/download/v0.17.0.0/fourmolu-0.17.0.0-linux-x86_64
34+
chmod +x fourmolu-0.17.0.0-linux-x86_64
35+
mv fourmolu-0.17.0.0-linux-x86_64 fourmolu
36+
- run: ./fourmolu -c .
37+
38+
test-with-cabal:
39+
name: Haskell-CI - Linux - ${{ matrix.ghc-version }}
40+
41+
strategy:
42+
matrix:
43+
ghc-version: [latest, 9.12, "9.10", 9.8, 9.6, 9.4, 9.2, 9.0, "8.10"]
44+
os: [ubuntu-latest]
45+
fail-fast: false
46+
47+
runs-on: ${{ matrix.os }}
48+
49+
steps:
50+
- name: Set NIGHTLY environment variable if the job was triggered by the scheduler
51+
if: "${{ github.event_name == 'schedule'
52+
|| contains(github.event.pull_request.title, 'nightly')
53+
|| contains(github.event.pull_request.title, 'NIGHTLY')
54+
|| github.event_name == 'workflow_dispatch' && github.event.inputs.nightly }}"
55+
run: |
56+
echo "NIGHTLY=true" >> $GITHUB_ENV
57+
58+
- uses: actions/checkout@v4
59+
- uses: haskell-actions/setup@v2
60+
with:
61+
ghc-version: ${{matrix.ghc-version}}
62+
- uses: actions/cache/restore@v4
63+
with:
64+
key: ${{ matrix.os }}-${{ matrix.ghc-version }}-${{ github.sha }}
65+
path: ~/.cabal/store
66+
restore-keys: ${{ matrix.os }}-${{ matrix.ghc-version }}-
67+
- run: cabal build all
68+
- run: cabal test all
69+
70+
- name: Documentation (Haddock)
71+
if: "${{ matrix.ghc-version == 'latest' }}"
72+
run: |
73+
.github/workflows/ci-haddock.sh
74+
75+
- name: Upload Documentation
76+
if: "${{ matrix.ghc-version == 'latest' }}"
77+
uses: actions/upload-artifact@v4
78+
with:
79+
name: haddocks
80+
path: ./docs
81+
82+
- uses: actions/cache/save@v4
83+
with:
84+
key: ${{ matrix.os }}-${{ matrix.ghc-version }}-${{ github.sha }}
85+
path: ~/.cabal/store
86+
87+
documentation:
88+
name: Documentation
89+
needs: [test-with-cabal]
90+
runs-on: ubuntu-latest
91+
steps:
92+
- name: Download generated documentation
93+
uses: actions/download-artifact@v4
94+
with:
95+
name: haddocks
96+
path: docs
97+
98+
- name: Publish Documentation
99+
if: github.event_name == 'push'
100+
uses: peaceiris/actions-gh-pages@v3
101+
with:
102+
github_token: ${{ secrets.GITHUB_TOKEN || github.token }}
103+
publish_dir: docs/
104+
enable_jekyll: true
105+
force_orphan: true

quickcheck-dynamic/src/Test/QuickCheck/DynamicLogic/Internal.hs

Lines changed: 9 additions & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -592,9 +592,11 @@ keepTryingUntil n g p = do
592592
shrinkDLTest :: DynLogicModel s => DynLogic s -> DynLogicTest s -> [DynLogicTest s]
593593
shrinkDLTest _ (Looping _) = []
594594
shrinkDLTest d tc =
595-
[ test | as' <- shrinkScript d (getScript tc), let pruned = pruneDLTest d as'
596-
test = makeTestFromPruned d pruned,
597-
-- Don't shrink a non-executable test case to an executable one.
595+
[ test
596+
| as' <- shrinkScript d (getScript tc)
597+
, let pruned = pruneDLTest d as'
598+
test = makeTestFromPruned d pruned
599+
, -- Don't shrink a non-executable test case to an executable one.
598600
case (tc, test) of
599601
(DLScript _, _) -> True
600602
(_, DLScript _) -> False
@@ -619,10 +621,10 @@ shrinkScript = shrink' initialAnnotatedState
619621
[TestSeqStep (unsafeCoerceVar var := act') ss | Some act'@ActionWithPolarity{} <- computeShrinkAction s act]
620622
++ [ TestSeqStep step ss'
621623
| ss' <-
622-
shrink'
623-
(nextStateStep step s)
624-
(stepDLStep d s step)
625-
ss
624+
shrink'
625+
(nextStateStep step s)
626+
(stepDLStep d s step)
627+
ss
626628
]
627629
nonstructural _ _ TestSeqStop = []
628630

quickcheck-dynamic/src/Test/QuickCheck/StateModel.hs

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -286,7 +286,8 @@ instance Show Polarity where
286286
show PosPolarity = "+"
287287
show NegPolarity = "-"
288288

289-
data ActionWithPolarity state a = Eq (Action state a) =>
289+
data ActionWithPolarity state a
290+
= Eq (Action state a) =>
290291
ActionWithPolarity
291292
{ polarAction :: Action state a
292293
, polarity :: Polarity

0 commit comments

Comments
 (0)