Skip to content

Commit 678b566

Browse files
committed
ci: switch to cabal
1 parent 4b64d6e commit 678b566

File tree

1 file changed

+11
-70
lines changed

1 file changed

+11
-70
lines changed

.github/workflows/haskell.yml

Lines changed: 11 additions & 70 deletions
Original file line numberDiff line numberDiff line change
@@ -3,18 +3,17 @@ name: Haskell CI
33
on:
44
push:
55
branches:
6-
- '*'
6+
- "*"
77
pull_request:
8-
branches: [ "master" ]
8+
branches: ["master"]
99

1010
permissions:
1111
contents: read
1212

1313
jobs:
1414
fourmolu:
15-
1615
runs-on: ubuntu-latest
17-
16+
1817
steps:
1918
- uses: actions/checkout@v3
2019
- uses: haskell-actions/run-fourmolu@v9
@@ -27,7 +26,7 @@ jobs:
2726
fail-fast: false
2827
matrix:
2928
os: [windows-latest, macos-latest, ubuntu-latest]
30-
ghc-version: ['9.6', '9.4', '9.2', '9.0']
29+
ghc-version: ["9.6", "9.4", "9.2", "9.0"]
3130

3231
steps:
3332
- uses: actions/checkout@v3
@@ -51,80 +50,22 @@ jobs:
5150
5251
- name: Configure the build
5352
run: |
54-
# cabal configure --enable-tests --enable-benchmarks --disable-documentation
55-
# cabal build --dry-run
56-
stack build --test --bench --no-haddock --dry-run
53+
cabal configure --enable-tests --enable-benchmarks --disable-documentation
54+
cabal build --dry-run
55+
# stack build --test --bench --no-haddock --dry-run
5756
# The last step generates dist-newstyle/cache/plan.json for the cache key.
5857

59-
- name: Restore .stack-work cache
60-
uses: actions/cache/restore@v3
61-
id: cache-restore-stack-work
62-
with:
63-
path: .stack-work
64-
key: ${{ runner.os }}-ghc-${{ env.GHC_VERSION }}-stack-${{ env.STACK_VERSION }}-stack-work-${{ hashFiles('stack.yaml') }}-${{ hashFiles('package.yaml') }}-${{ hashFiles('**/*.hs') }}
65-
restore-keys: |
66-
${{ runner.os }}-ghc-${{ env.GHC_VERSION }}-stack-${{ env.STACK_VERSION }}-stack-work-
67-
68-
- name: Restore ~/.stack cache (Unix)
69-
uses: actions/cache/restore@v3
70-
id: cache-restore-stack-global-unix
71-
if: runner.os == 'Linux' || runner.os == 'macOS'
72-
with:
73-
path: ~/.stack
74-
key: ${{ runner.os }}-ghc-${{ env.GHC_VERSION }}-stack-${{ env.STACK_VERSION }}-stack-global-${{ hashFiles('stack.yaml') }}-${{ hashFiles('package.yaml') }}
75-
restore-keys: |
76-
${{ runner.os }}-ghc-${{ env.GHC_VERSION }}-stack-${{ env.STACK_VERSION }}-stack-global-
77-
78-
- name: Restore %APPDATA%\stack, %LOCALAPPDATA%\Programs\stack cache (Windows)
79-
uses: actions/cache/restore@v3
80-
id: cache-restore-stack-global-windows
81-
if: runner.os == 'Windows'
82-
with:
83-
path: |
84-
~\AppData\Roaming\stack
85-
~\AppData\Local\Programs\stack
86-
key: ${{ runner.os }}-ghc-${{ env.GHC_VERSION }}-stack-${{ env.STACK_VERSION }}-stack-global-${{ hashFiles('stack.yaml') }}-${{ hashFiles('package.yaml') }}
87-
restore-keys: |
88-
${{ runner.os }}-ghc-${{ env.GHC_VERSION }}-stack-${{ env.STACK_VERSION }}-stack-global-
89-
9058
- name: Build dependencies
91-
run: stack build --only-dependencies
59+
run: cabal build --only-dependencies
9260

9361
- name: Build the package
94-
run: stack build
95-
96-
- name: Save .stack-work cache
97-
uses: actions/cache/save@v3
98-
id: cache-save-stack-work
99-
if: steps.cache-restore-stack-work.outputs.cache-hit != 'true'
100-
with:
101-
path: .stack-work
102-
key: ${{ steps.cache-restore-stack-work.outputs.cache-primary-key }}
103-
104-
- name: Save %APPDATA%\stack, %LOCALAPPDATA%\Programs\stack cache (Windows)
105-
uses: actions/cache/save@v3
106-
if: runner.os == 'Windows'
107-
&& steps.cache-restore-stack-global-windows.outputs.cache-hit != 'true'
108-
with:
109-
path: |
110-
~\AppData\Roaming\stack
111-
~\AppData\Local\Programs\stack
112-
key: ${{ steps.cache-restore-stack-global-windows.outputs.cache-primary-key }}
113-
114-
- name: Save ~/.stack cache (Unix)
115-
uses: actions/cache/save@v3
116-
id: cache-save-stack-global
117-
if: (runner.os == 'Linux' || runner.os == 'macOS')
118-
&& steps.cache-restore-stack-global-unix.outputs.cache-hit != 'true'
119-
with:
120-
path: ~/.stack
121-
key: ${{ steps.cache-restore-stack-global-unix.outputs.cache-primary-key }}
62+
run: cabal build
12263

12364
- name: Run tests
124-
run: stack test
65+
run: cabal test
12566

12667
- name: Check cabal file
12768
run: cabal check
12869

12970
- name: Build documentation
130-
run: stack haddock
71+
run: cabal haddock

0 commit comments

Comments
 (0)