Skip to content

Commit cd59442

Browse files
committed
chore: ignore cabal file
1 parent afbba06 commit cd59442

File tree

9 files changed

+52
-107
lines changed

9 files changed

+52
-107
lines changed

.github/workflows/conventional-commits.yml

Lines changed: 2 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -1,10 +1,8 @@
11
---
2-
name: Conventional commits
3-
2+
name: conventional-commits
43
on:
54
pull_request:
6-
branches:
7-
- main
5+
branches: [main]
86

97
jobs:
108
build:

.github/workflows/semantic-release.yml

Lines changed: 5 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -1,9 +1,10 @@
11
---
2-
name: Semantic release
2+
name: semantic-release
33
on:
4-
push:
5-
branches:
6-
- main
4+
workflow_run:
5+
workflows: [stack-build]
6+
types: [completed]
7+
branches: [main]
78

89
jobs:
910
build:
Lines changed: 33 additions & 22 deletions
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,5 @@
11
---
2-
name: cabal-build
2+
name: stack-build
33
on:
44
push:
55
branches: main
@@ -11,40 +11,51 @@ permissions:
1111

1212
jobs:
1313
build:
14-
name: ${{ matrix.os }} / ghc ${{ matrix.ghc-version }}
14+
name: lts-${{ matrix.stack.lts }} / ghc-${{ matrix.stack.ghc }} / ${{ matrix.os }}
1515
runs-on: ${{ matrix.os }}-latest
1616
strategy:
1717
fail-fast: false
1818
matrix:
1919
os: [ubuntu]
20-
ghc-version:
21-
- 9.8
22-
- 9.6
23-
- 9.4
20+
stack:
21+
- lts: 23.28
22+
ghc: 9.8.4
23+
24+
- lts: 22.44
25+
ghc: 9.6.7
26+
27+
- lts: &default-lts 21.25
28+
ghc: &default-ghc 9.4.8
2429

2530
include:
2631
- os: windows
27-
ghc-version: 9.6
32+
stack:
33+
lts: *default-lts
34+
ghc: *default-ghc
2835

2936
- os: macos
30-
ghc-version: 9.6
37+
stack:
38+
lts: 21.25
39+
ghc: 9.8.4
3140

3241
steps:
3342
- uses: actions/checkout@v3
3443

35-
- name: Set up GHC ${{ matrix.ghc-version }}
44+
- name: Set up Stack LTS ${{ matrix.stack-lts }}
3645
uses: haskell-actions/setup@v2
3746
id: setup
3847
with:
39-
ghc-version: ${{ matrix.ghc-version }}
40-
# Defaults, added for clarity:
41-
cabal-version: latest
42-
cabal-update: true
48+
ghc-version: ${{ matrix.stack.ghc }}
49+
enable-stack: true
50+
stack-setup-ghc: true
51+
stack-no-global: true
4352

4453
- name: Configure the build
4554
run: |
46-
cabal configure --enable-tests --enable-benchmarks --disable-documentation
47-
cabal build --dry-run
55+
echo "with key: ${{ runner.os }}-ghc-${{ steps.setup.outputs.ghc-version }}-cabal-${{ steps.setup.outputs.cabal-version }}"
56+
57+
stack config set resolver lts-${{ matrix.stack.lts }}
58+
stack build --dry-run
4859
# The last step generates dist-newstyle/cache/plan.json for the cache key.
4960
5061
- name: Restore cached dependencies
@@ -54,32 +65,32 @@ jobs:
5465
key: ${{ runner.os }}-ghc-${{ steps.setup.outputs.ghc-version }}-cabal-${{ steps.setup.outputs.cabal-version }}
5566

5667
with:
57-
path: ${{ steps.setup.outputs.cabal-store }}
68+
path: ${{ steps.setup.outputs.stack-root }}
5869
key: ${{ env.key }}-plan-${{ hashFiles('**/plan.json') }}
5970
restore-keys: ${{ env.key }}-
6071

6172
- name: Install dependencies
62-
run: cabal build all --only-dependencies
73+
run: stack build --only-dependencies
6374

6475
# Cache dependencies already here, so that we do not have to rebuild them should the subsequent steps fail.
6576
- name: Save cached dependencies
6677
uses: actions/cache/save@v3
6778
# Caches are immutable, trying to save with the same key would error.
6879
if: ${{ steps.cache.outputs.cache-primary-key != steps.cache.outputs.cache-matched-key }}
6980
with:
70-
path: ${{ steps.setup.outputs.cabal-store }}
81+
path: ${{ steps.setup.outputs.stack-root }}
7182
key: ${{ steps.cache.outputs.cache-primary-key }}
7283

7384
- name: Build
74-
run: cabal build all
85+
run: stack build
7586

7687
- name: Run tests
77-
run: cabal test all
88+
run: stack test
7889

7990
- name: Check cabal file
80-
run: cabal check
91+
run: stack check
8192
continue-on-error: true
8293

8394
- name: Build documentation
84-
run: cabal haddock all
95+
run: stack haddock
8596
...

.gitignore

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1,3 +1,4 @@
1+
megaparsec-utils.cabal
12
.stack-work/
23
*~
34
dist-newstyle/

megaparsec-utils.cabal

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

package.yaml

Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1,3 +1,4 @@
1+
---
12
name: megaparsec-utils
23
version: 0.0.0.0-dev
34
license: GPL-3
@@ -51,7 +52,9 @@ tests:
5152
- -threaded
5253
- -rtsopts
5354
- -with-rtsopts=-N
55+
5456
dependencies:
5557
- megaparsec-utils
5658
- hspec
5759
- QuickCheck
60+
...

stack.yaml

Lines changed: 4 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,5 @@
1-
resolver:
2-
url: https://raw.githubusercontent.com/commercialhaskell/stackage-snapshots/master/lts/21/25.yaml
3-
1+
---
2+
resolver: lts-21.25
43
packages:
5-
- .
4+
- .
5+
...

stack.yaml.lock

Lines changed: 2 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -1,13 +1,12 @@
11
# This file was autogenerated by Stack.
22
# You should not edit this file by hand.
33
# For more information, please see the documentation at:
4-
# https://docs.haskellstack.org/en/stable/lock_files
4+
# https://docs.haskellstack.org/en/stable/topics/lock_files
55

66
packages: []
77
snapshots:
88
- completed:
99
sha256: a81fb3877c4f9031e1325eb3935122e608d80715dc16b586eb11ddbff8671ecd
1010
size: 640086
1111
url: https://raw.githubusercontent.com/commercialhaskell/stackage-snapshots/master/lts/21/25.yaml
12-
original:
13-
url: https://raw.githubusercontent.com/commercialhaskell/stackage-snapshots/master/lts/21/25.yaml
12+
original: lts-21.25

test/Text/Megaparsec/UtilsSpec.hs

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -158,8 +158,8 @@ spec = do
158158

159159
context "posDecNumParser" $ do
160160
it "no decimals" . property $ \v ->
161-
parseMaybe' posDecNumParser (show (abs (v :: Int)))
162-
`shouldBe` Just (fromIntegral (abs v))
161+
parseMaybe' (posDecNumParser @Void @Int) (show (abs (v :: Int)))
162+
`shouldBe` Just (abs v)
163163

164164
it "decimals" . property $ \v ->
165165
parseMaybe' posDecNumParser (printf "%f" (abs (v :: Double)))

0 commit comments

Comments
 (0)