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

Commit 7861316

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 7861316

20 files changed

+123788
-10260
lines changed

setup/action.yml

Lines changed: 15 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -23,6 +23,17 @@ 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+
default: 'The default primary key is `$os-$ghc$hash(cabal.project.freeze|stack.yaml.lock)-$github-sha`, and the restores keys are its prefixes.'
33+
cache-paths:
34+
required: false
35+
description: 'List of directories to cache.'
36+
default: 'For cabal: `outputs.cabal-store` and `dist-newstyle`. For stack: `outputs.stack-root`.'
2637
outputs:
2738
ghc-path:
2839
description: 'The path of the ghc executable _directory_'
@@ -32,6 +43,8 @@ outputs:
3243
description: 'The path of the stack executable _directory_'
3344
cabal-store:
3445
description: 'The path to the cabal store'
46+
stack-root:
47+
description: 'The path to the stack root'
3548
ghc-exe:
3649
description: 'The path of the ghc _executable_'
3750
cabal-exe:
@@ -41,3 +54,5 @@ outputs:
4154
runs:
4255
using: 'node12'
4356
main: 'dist/index.js'
57+
post: 'dist/save-cache.js'
58+
post-if: success()

setup/dist/action.yml

Lines changed: 15 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)