-
Notifications
You must be signed in to change notification settings - Fork 4.3k
/
Copy pathaction.yml
51 lines (47 loc) · 1.76 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
name: "Cache Build Artifacts"
description: "Cache Java, Javascript and Python build artifacts to reduce build time"
inputs:
cache-key:
description: "Key to use for caching"
required: true
cache-python:
description: "Whether to cache Python dependencies. Only relevant if building connector modules. true or false"
default: "true"
required: true
runs:
using: "composite"
steps:
- name: Pip Caching
if: ${{ inputs.cache_python }} == 'true'
uses: actions/cache@v3
with:
path: |
~/.cache/pip
key: ${{ inputs.cache-key }}-pip-${{ runner.os }}-${{ hashFiles('**/setup.py') }}-${{ hashFiles('**/requirements.txt') }}
restore-keys: |
${{ inputs.cache-key }}-pip-${{ runner.os }}-
- name: Npm Caching
uses: actions/cache@v3
with:
path: |
~/.npm
key: ${{ inputs.cache-key }}-npm-${{ runner.os }}-${{ hashFiles('**/package-lock.json') }}
restore-keys: |
${{ inputs.cache-key }}-npm-${{ runner.os }}-
- name: pnpm Caching
uses: actions/cache@v3
with:
path: |
~/.local/share/pnpm/store
key: ${{ inputs.cache-key }}-pnpm-${{ runner.os }}-${{ hashFiles('**/pnpm-lock.yaml') }}
restore-keys: |
${{ inputs.cache-key }}-pnpm-${{ runner.os }}-
# this intentionally does not use restore-keys so we don't mess with gradle caching
- name: Gradle and Python Caching
uses: actions/cache@v3
with:
path: |
~/.gradle/caches
~/.gradle/wrapper
**/.venv
key: ${{ inputs.cache-key }}-${{ runner.os }}-${{ hashFiles('**/*.gradle*') }}-${{ hashFiles('**/package-lock.json') }}-${{ hashFiles('**/setup.py') }}-${{ hashFiles('**/requirements.txt') }}