Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
21 changes: 0 additions & 21 deletions .github/workflows/ci.yml

This file was deleted.

1 change: 0 additions & 1 deletion .github/workflows/example.yml
Original file line number Diff line number Diff line change
Expand Up @@ -20,7 +20,6 @@ jobs:
working-directory: example
- name: Build
run: |
echo "cache-hit: ${{steps.stack-cache.outputs.cache-hit}}"
find .
mkdir -p ~/.stack ./.stack-work ./package/.stack-work
echo "An artifact" > ~/.stack/artifact
Expand Down
12 changes: 0 additions & 12 deletions .gitignore

This file was deleted.

1 change: 0 additions & 1 deletion .npmrc

This file was deleted.

8 changes: 0 additions & 8 deletions .prettierrc.js

This file was deleted.

7 changes: 0 additions & 7 deletions .vscode/extensions.json

This file was deleted.

6 changes: 0 additions & 6 deletions .vscode/settings.json

This file was deleted.

26 changes: 18 additions & 8 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -2,14 +2,28 @@

Cache step for Stack-based Haskell projects on GitHub Actions.

**NOTE**: if you are using `freckle/stack-action@v4` or newer, you do not
need this action as its own step. That version of that action handles all
caching internally, and better.
> [!NOTE]
>
> As of `@v3`, this action is a `composite` pass-through to `stack-action`:
>
> ```yaml
> - uses: freckle/stack-action@v6
> env:
> STACK_YAML: ${{ inputs.stack-yaml }}
> with:
> working-directory: ${{ inputs.working-directory }}
> cache-prefix: ${{ inputs.prefix }}
> stack-build-arguments: --dry-run
> install-stack: false
> upgrade-stack: false
> ```
>
> You could consider replacing use of this action with that directly.

## Usage

```yml
uses: freckle/stack-cache-action@v2
uses: freckle/stack-cache-action@v3
```

## Behavior
Expand All @@ -29,10 +43,6 @@ uses: freckle/stack-cache-action@v2
- `working-directory`: Useful in monorepositories
- `prefix`: A prefix to include on keys; useful for cache busting or versioning

## Outputs

- `cache-hit`: indicates a full cache hit on the primary key

## Further Reading

See https://tech.freckle.com/2021/05/18/haskell-on-actions/ for a short tutorial.
Expand Down
21 changes: 14 additions & 7 deletions action.yml
Original file line number Diff line number Diff line change
@@ -1,10 +1,6 @@
name: "Stack cache"
author: "freckle"
description: "Caching Action for Stack-based Haskell projects"
runs:
using: "node16"
main: "dist/restore/index.js"
post: "dist/save/index.js"
inputs:
stack-yaml:
description: "Path to stack.yaml"
Expand All @@ -18,6 +14,17 @@ inputs:
description: "A prefix to include on keys; useful for cache busting or versioning"
required: false
default: ""
outputs:
cache-hit:
description: "A boolean value to indicate an exact match was found for the primary key"
runs:
using: "composite"
steps:
- uses: freckle/stack-action@v5
env:
STACK_YAML: ${{ inputs.stack-yaml }}
with:
working-directory: ${{ inputs.working-directory }}
cache-prefix: ${{ inputs.cache-prefix }}

# Avoid other stack-action behavior, as much as we can
stack-build-arguments: --dry-run
install-stack: false
upgrade-stack: false
3 changes: 0 additions & 3 deletions dist/restore/index.js

This file was deleted.

3 changes: 0 additions & 3 deletions dist/save/index.js

This file was deleted.

3 changes: 0 additions & 3 deletions eslint.config.js

This file was deleted.

1 change: 1 addition & 0 deletions example/.gitignore
Original file line number Diff line number Diff line change
@@ -0,0 +1 @@
.stack-work
9 changes: 9 additions & 0 deletions example/example.cabal
Original file line number Diff line number Diff line change
@@ -0,0 +1,9 @@
cabal-version: 1.12

-- This file has been generated from package.yaml by hpack version 0.39.1.
--
-- see: https://github.com/sol/hpack

name: example
version: 0.0.0.0
build-type: Simple
2 changes: 2 additions & 0 deletions example/package.yaml
Original file line number Diff line number Diff line change
@@ -0,0 +1,2 @@
name: example
version: 0.0.0.0
12 changes: 12 additions & 0 deletions example/stack.yaml.lock
Original file line number Diff line number Diff line change
@@ -0,0 +1,12 @@
# This file was autogenerated by Stack.
# You should not edit this file by hand.
# For more information, please see the documentation at:
# https://docs.haskellstack.org/en/stable/topics/lock_files

packages: []
snapshots:
- completed:
sha256: d7d8d5106e53d1669964bd8bd2b0f88a5ad192d772f5376384b76738fd992311
size: 567037
url: https://raw.githubusercontent.com/commercialhaskell/stackage-snapshots/master/lts/17/9.yaml
original: lts-17.9
39 changes: 0 additions & 39 deletions package.json

This file was deleted.

10 changes: 0 additions & 10 deletions src/inputs.js

This file was deleted.

43 changes: 0 additions & 43 deletions src/restore.js

This file was deleted.

37 changes: 0 additions & 37 deletions src/save.js

This file was deleted.

60 changes: 0 additions & 60 deletions src/stack-cache.js

This file was deleted.

Loading
Loading