-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy pathaction.yml
59 lines (52 loc) · 2.16 KB
/
action.yml
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
name: "Setup Deno with cache"
description: "Composite action wrapper around denoland/setup-deno and actions/cache to setup Deno and cache its dependencies."
branding:
icon: fast-forward
color: gray-dark
inputs:
deno-version:
description: "The Deno version to install. Can be a semver version of a stable release, 'canary' for the latest canary, or the Git hash of a specific canary release."
default: "1.x"
deno-json-path:
description: "The path to the Deno config file to use for caching. Defaults to an empty string, using the built-in CLI default (`deno.json` and `deno.jsonc`)."
default: ""
deno-lock-path:
description: "The path to the lock file to use for caching. Defaults to `./deno.lock`."
default: "./deno.lock"
directory:
description: "The path to the scripts to cache. Defaults to the repo root."
default: "."
outputs:
deno-version:
description: "The Deno version that was installed."
value: ${{ steps.setup-deno.outputs.deno-version }}
is-canary:
description: "If the installed Deno version was a canary version."
value: ${{ steps.setup-deno.outputs.is-canary }}
cache-hit:
description: "A boolean value to indicate an exact match was found for the key."
value: ${{ steps.cache-deno.outputs.cache-hit }}
runs:
using: "composite"
steps:
- name: Setup Deno
id: setup-deno
uses: denoland/[email protected]
with:
deno-version: ${{ inputs.deno-version }}
- name: Set Deno cache dir
shell: bash
run: echo "DENO_DIR=$RUNNER_TEMP${{ runner.os == 'Windows' && '\\' || '/' }}deno_cache" >> $GITHUB_ENV
- name: Register Deno problem matchers
shell: bash
run: echo "::add-matcher::${{ github.action_path }}/.github/deno-matcher.json"
- name: Cache Deno dependencies
id: cache-deno
uses: actions/[email protected]
with:
key: ${{ hashFiles(inputs.deno-lock-path) }}
path: ${{ env.DENO_DIR }}
- name: Restore Deno dependencies
shell: bash
run: |
find ${{ inputs.directory }} -regex '.*\.[jt]sx*' -exec deno cache ${{ inputs.deno-json-path != '' && '--config=' || '' }}${{ inputs.deno-json-path }} {} \;