Skip to content

Commit

Permalink
upd: version
Browse files Browse the repository at this point in the history
fix: output

upd: package.lock

upd: script

action: build the action

fix: inputs

fix: require token

action: build the action

add: permission

fix: circular imports

action: build the action

fix: messages

fix: ci

action: build the action

fix: gc messages

action: build the action

fix: edit name

fix: method name
  • Loading branch information
deemp committed Dec 11, 2023
1 parent 2914b86 commit f95674f
Show file tree
Hide file tree
Showing 21 changed files with 1,851 additions and 102,469 deletions.
4 changes: 3 additions & 1 deletion .github/workflows/ci.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -103,6 +103,8 @@ jobs:
make-similar-caches:
name: Make similar caches
needs: check-cache-changes
permissions:
actions: write
strategy:
matrix:
os:
Expand Down Expand Up @@ -220,7 +222,7 @@ jobs:
uses: ./.
with:
# save a new cache every time ci file changes
key: cache-${{ matrix.os }}-${{ hashFiles('.github/workflows/ci.yaml') }}
primary-key: cache-${{ matrix.os }}-${{ hashFiles('.github/workflows/ci.yaml') }}
restore-prefixes-first-match: cache-${{ matrix.os }}-

gc-max-store-size-linux: 8000000000
Expand Down
2 changes: 1 addition & 1 deletion README.md

Large diffs are not rendered by default.

18 changes: 10 additions & 8 deletions action.nix
Original file line number Diff line number Diff line change
Expand Up @@ -72,31 +72,33 @@ in
- ${whenListOf} key prefixes, when there's a miss on the ${q primary-key},
the action searches in this list for the first prefix for which there exists a cache
with a matching key and the action tries to restore that cache.
- Otherwise, this input has no effect.
- ${noEffectOtherwise}
default: ""
restore-prefixes-all-matches:
description: |
- ${whenListOf} key prefixes, the action tries to restore
all caches whose keys match these prefixes.
- Otherwise, this input has no effect.
- ${noEffectOtherwise}
default: ""
skip-restore-on-hit-primary-key:
description: |
- Can have an effect only when ${q restore-prefixes-first-match} has no effect.
- When `true`, when there's a hit on the ${q primary-key}, the action doesn't restore caches.
- Otherwise, this input has no effect.
- ${noEffectOtherwise}
default: "false"
fail-on:
description: |
- Input form: `<key type>.<result>`.
- `<key type>` options: `primary`, `first-match`.
- `<key type>` options: ${q primary-key}, `first-match`.
- `<result>` options: `miss`, `not-restored`.
- When the input satisfies the input form, when the event described in the input happens, the action fails.
- Example:
- Input: `primary.not-restored`.
- Event: a cache could not be restored via the ${q primary-key}.''
- Example:
- Input: `${primary-key}.not-restored`.
- Event: a cache could not be restored via the ${q primary-key}.
- ${noEffectOtherwise}
default: ""''
else ""
}
Expand Down Expand Up @@ -208,7 +210,7 @@ in
if target == "cache" || target == "restore" then
''
outputs:
primary-key:
${primary-key}:
description: |
- A string.
- The ${q primary-key}.
Expand Down
10 changes: 6 additions & 4 deletions action.yml
Original file line number Diff line number Diff line change
Expand Up @@ -32,12 +32,14 @@ inputs:
fail-on:
description: |
- Input form: `<key type>.<result>`.
- `<key type>` options: `primary`, `first-match`.
- `<key type>` options: `primary-key`, `first-match`.
- `<result>` options: `miss`, `not-restored`.
- When the input satisfies the input form, when the event described in the input happens, the action fails.
- Example:
- Input: `primary.not-restored`.
- Event: a cache could not be restored via the `primary-key`.
- Example:
- Input: `primary-key.not-restored`.
- Event: a cache could not be restored via the `primary-key`.
- Otherwise, this input has no effect.
default: ""

nix:
description: |
Expand Down
Loading

0 comments on commit f95674f

Please sign in to comment.