-
Notifications
You must be signed in to change notification settings - Fork 1
/
Copy pathaction.yaml
32 lines (27 loc) · 927 Bytes
/
action.yaml
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
name: '📦 Cache Kotlin scripts'
description: 'Cache Kotlin scripts using actions/cache'
inputs:
path:
description: 'actions/cache@v4 path'
required: true
default: ${{ github.workspace }}/.main.kts
key:
description: 'actions/cache@v4 key'
required: true
default: kts-${{ runner.os }}-${{ hashFiles('**/*.main.kts') }}
runs:
using: composite
steps:
- if: env.KOTLIN_MAIN_KTS_COMPILED_SCRIPTS_CACHE_DIR == ''
run: echo "KOTLIN_MAIN_KTS_COMPILED_SCRIPTS_CACHE_DIR=$INPUT_PATH" >> $GITHUB_ENV
shell: bash
env:
INPUT_PATH: ${{ inputs.path }}
- name: Cache Kotlin scripts
uses: actions/cache@v4
with:
path: ${{ env.KOTLIN_MAIN_KTS_COMPILED_SCRIPTS_CACHE_DIR }}
key: ${{ inputs.key }}
- name: Ensure the Kotlin scripts cache directory exists
run: mkdir -p "$KOTLIN_MAIN_KTS_COMPILED_SCRIPTS_CACHE_DIR"
shell: bash