Skip to content
This repository was archived by the owner on Jan 5, 2024. It is now read-only.

Commit 2306df7

Browse files
committed
Add 'cabal: true' option to enable caching
* Support both cabal and stack * Copy `hashFiles` until exposed exposed in the actions/cache API * Saving cache as a post-script * Additional action inputs: `cache-paths` and `cache-keys` * Add `output.stack-root` in `action.yml`
1 parent 6744967 commit 2306df7

21 files changed

+123793
-10260
lines changed

.github/workflows/workflow.yml

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -58,6 +58,7 @@ jobs:
5858
with:
5959
ghc-version: ${{ matrix.ghc }}
6060
cabal-version: ${{ matrix.cabal }}
61+
cache: true
6162
- run: |
6263
runhaskell --version
6364
runhaskell __tests__/hello.hs
@@ -94,6 +95,7 @@ jobs:
9495
enable-stack: true
9596
stack-no-global: true
9697
stack-version: ${{ matrix.stack }}
98+
cache: true
9799
- run: |
98100
stack --version
99101
stack

setup/action.yml

Lines changed: 13 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -23,6 +23,15 @@ inputs:
2323
stack-setup-ghc:
2424
required: false
2525
description: 'If specified, enable-stack must be set. Will run stack setup to install the specified GHC'
26+
cache:
27+
required: false
28+
description: 'If specified, automatically caches cabal/stack-related directories.'
29+
cache-keys:
30+
required: false
31+
description: 'List of caching keys, where the first is the "primary" key and the rest are "restore" keys to fall back on.'
32+
cache-paths:
33+
required: false
34+
description: 'List of directories to cache.'
2635
outputs:
2736
ghc-path:
2837
description: 'The path of the ghc executable _directory_'
@@ -32,6 +41,8 @@ outputs:
3241
description: 'The path of the stack executable _directory_'
3342
cabal-store:
3443
description: 'The path to the cabal store'
44+
stack-root:
45+
description: 'The path to the stack root'
3546
ghc-exe:
3647
description: 'The path of the ghc _executable_'
3748
cabal-exe:
@@ -41,3 +52,5 @@ outputs:
4152
runs:
4253
using: 'node12'
4354
main: 'dist/index.js'
55+
post: 'dist/save-cache.js'
56+
post-if: success()

setup/dist/action.yml

Lines changed: 13 additions & 0 deletions
Some generated files are not rendered by default. Learn more about customizing how changed files appear on GitHub.

0 commit comments

Comments
 (0)