From b5f03f8babfc7597197edebdf45f690302a979df Mon Sep 17 00:00:00 2001 From: andys8 Date: Sun, 29 Mar 2020 22:54:33 +0200 Subject: [PATCH] Documentation example: Haskell stack There is an example for cabal. This is an example for stack. Both are used in the haskell eco system. --- README.md | 1 + examples.md | 14 ++++++++++++++ 2 files changed, 15 insertions(+) diff --git a/README.md b/README.md index 5c86306..93ebe4e 100644 --- a/README.md +++ b/README.md @@ -64,6 +64,7 @@ See [Examples](examples.md) for a list of `actions/cache` implementations for us - [Elixir - Mix](./examples.md#elixir---mix) - [Go - Modules](./examples.md#go---modules) - [Haskell - Cabal](./examples.md#haskell---cabal) +- [Haskell - Stack](./examples.md#haskell---stack) - [Java - Gradle](./examples.md#java---gradle) - [Java - Maven](./examples.md#java---maven) - [Node - npm](./examples.md#node---npm) diff --git a/examples.md b/examples.md index e3a1a06..fe0155c 100644 --- a/examples.md +++ b/examples.md @@ -5,6 +5,7 @@ - [Elixir - Mix](#elixir---mix) - [Go - Modules](#go---modules) - [Haskell - Cabal](#haskell---cabal) + - [Haskell - Stack](#haskell---stack) - [Java - Gradle](#java---gradle) - [Java - Maven](#java---maven) - [Node - npm](#node---npm) @@ -99,6 +100,19 @@ We cache the elements of the Cabal store separately, as the entirety of `~/.caba key: ${{ runner.os }}-${{ matrix.ghc }}-dist-newstyle ``` +## Haskell - Stack + +```yaml +- uses: actions/cache@v1 + name: Cache ~/.stack + with: + path: ~/.stack + key: ${{ runner.os }}-stack-${{ hashFiles('**/stack.yaml.lock') }}-${{ hashFiles('**/package.yaml') }} + restore-keys: | + ${{ runner.os }}-stack-${{ hashFiles('**/stack.yaml.lock') }}- + ${{ runner.os }}-stack- +``` + ## Java - Gradle ```yaml