Skip to content

Commit

Permalink
Expose cache hit as output (#5)
Browse files Browse the repository at this point in the history
  • Loading branch information
ofalvai authored Jan 12, 2023
1 parent b0a78d9 commit 6772a96
Show file tree
Hide file tree
Showing 9 changed files with 47 additions and 16 deletions.
5 changes: 4 additions & 1 deletion README.md
Original file line number Diff line number Diff line change
Expand Up @@ -55,7 +55,10 @@ steps:

<details>
<summary>Outputs</summary>
There are no outputs defined in this step

| Environment Variable | Description |
| --- | --- |
| `BITRISE_CACHE_HIT` | Indicates if a cache entry was restored. Possible values: - `exact`: Exact cache hit for the first requested cache key - `partial`: Cache hit for a key other than the first - `false` No cache hit, nothing was restored |
</details>

## 🙋 Contributing
Expand Down
2 changes: 1 addition & 1 deletion go.mod
Original file line number Diff line number Diff line change
Expand Up @@ -3,7 +3,7 @@ module github.com/bitrise-steplib/steps-restore-gradle-cache
go 1.17

require (
github.com/bitrise-io/go-steputils/v2 v2.0.0-alpha.15
github.com/bitrise-io/go-steputils/v2 v2.0.0-alpha.16
github.com/bitrise-io/go-utils/v2 v2.0.0-alpha.13
)

Expand Down
4 changes: 2 additions & 2 deletions go.sum
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
github.com/bitrise-io/go-steputils/v2 v2.0.0-alpha.15 h1:wG037NV+pS8cEwtalE5K58bmKLyUkU0+4m4IuXjTzmo=
github.com/bitrise-io/go-steputils/v2 v2.0.0-alpha.15/go.mod h1:M09BbxYoh6B7KJnXk/yvtuU5nZPh7RQBJGKc1dp+0hQ=
github.com/bitrise-io/go-steputils/v2 v2.0.0-alpha.16 h1:WA0QxrFG6ZeBTFsjBsqnCYwlfW0WRDuxGX74a2ffWRw=
github.com/bitrise-io/go-steputils/v2 v2.0.0-alpha.16/go.mod h1:M09BbxYoh6B7KJnXk/yvtuU5nZPh7RQBJGKc1dp+0hQ=
github.com/bitrise-io/go-utils v1.0.1 h1:e7mepVBkVN1DXRPESNXb0djEw6bxB6B93p/Q74zzcvk=
github.com/bitrise-io/go-utils v1.0.1/go.mod h1:ZY1DI+fEpZuFpO9szgDeICM4QbqoWVt0RSY3tRI1heY=
github.com/bitrise-io/go-utils/v2 v2.0.0-alpha.13 h1:QtAAfm/FpMDv/PnDxgzylVbbSx21pyl7+5T/ToJnWAQ=
Expand Down
10 changes: 10 additions & 0 deletions step.yml
Original file line number Diff line number Diff line change
Expand Up @@ -47,3 +47,13 @@ inputs:
value_options:
- "true"
- "false"

outputs:
- BITRISE_CACHE_HIT:
opts:
title: Cache hit
description: |-
Indicates if a cache entry was restored. Possible values:
- `exact`: Exact cache hit for the first requested cache key
- `partial`: Cache hit for a key other than the first
- `false` No cache hit, nothing was restored
4 changes: 3 additions & 1 deletion vendor/github.com/bitrise-io/go-steputils/v2/cache/common.go

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

28 changes: 22 additions & 6 deletions vendor/github.com/bitrise-io/go-steputils/v2/cache/restore.go

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

2 changes: 1 addition & 1 deletion vendor/modules.txt
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
# github.com/bitrise-io/go-steputils/v2 v2.0.0-alpha.15
# github.com/bitrise-io/go-steputils/v2 v2.0.0-alpha.16
## explicit; go 1.17
github.com/bitrise-io/go-steputils/v2/cache
github.com/bitrise-io/go-steputils/v2/cache/compression
Expand Down

0 comments on commit 6772a96

Please sign in to comment.