Skip to content

Commit 0286ae1

Browse files
authored
Merge pull request #8 from dscho/cache
Accelerate via @actions/cache
2 parents e1f1549 + 53e6622 commit 0286ae1

File tree

6 files changed

+71305
-18124
lines changed

6 files changed

+71305
-18124
lines changed

README.md

Lines changed: 6 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -66,6 +66,12 @@ Please note that only the `build-installers` and the `full` flavors are availabl
6666

6767
By default, this Action prints a line whenever 250 items were extracted (this does not work for the `full` flavor, where this Action is silent by default). It can be overridden by setting the input parameter `verbose`; setting it to a number will show updates whenever that many items were extracted. Setting it to `false` will suppress progress updates. Setting it to `true` will print every extracted file (this also works for the `full` flavor).
6868

69+
### Caching
70+
71+
To accelerate this Action, artifacts are cached once downloaded. This can be turned off by setting the input parameter `cache` to `false`.
72+
73+
In practice, caching the `full` artifacts does not provide much of a speed-up. Instead, it slows it down by adding several minutes during with the artifact is cached. Therefore, caching is disabled for the `full` artifacts by default, corresponding to `cache: auto`.
74+
6975
## Developing _this_ Action
7076

7177
> First, you'll need to have a reasonably modern version of `node` handy, such as Node 12.

__tests__/main.test.ts

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -50,7 +50,8 @@ if (process.env.RUN_NETWORK_TESTS !== 'true') {
5050
INPUT_FLAVOR: 'minimal',
5151
INPUT_ARCHITECTURE: 'x86_64',
5252
INPUT_PATH: outputDirectory,
53-
INPUT_VERBOSE: '250'
53+
INPUT_VERBOSE: '250',
54+
INPUT_CACHE: 'true'
5455
}
5556
})
5657
).toEqual(0)

action.yml

Lines changed: 4 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -21,6 +21,10 @@ inputs:
2121
required: false
2222
description: 'Whether to log files as they are extracted'
2323
default: '250'
24+
cache:
25+
required: false
26+
description: 'Use @actions/cache to accelerate this Action'
27+
default: 'auto'
2428
runs:
2529
using: 'node12'
2630
main: 'dist/index.js'

0 commit comments

Comments
 (0)