-
-
Notifications
You must be signed in to change notification settings - Fork 5
/
action.yml
43 lines (39 loc) · 1.43 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
name: Tool Cache
description: Implementation of Tool Cache in composite GitHub Actions
branding:
icon: package
color: purple
inputs:
folder_name:
description: Folder name of the program inside runner temp
required: true
cache_hit:
description: If set to true, will not install the program since it is already installed by cache
default: false
runs:
using: composite
steps:
- name: Install program to tool cache (Unix-like)
if: (runner.os == 'Linux' || runner.os == 'macOS') && inputs.cache_hit != 'true'
shell: bash
run: $GITHUB_ACTION_PATH/scripts/install/Unix-like.sh
env:
folder_name: ${{ inputs.folder_name }}
- name: Add program tool cache folder to path (Unix-like)
if: runner.os == 'Linux' || runner.os == 'macOS'
shell: bash
run: $GITHUB_ACTION_PATH/scripts/add-to-path/Unix-like.sh
env:
folder_name: ${{ inputs.folder_name }}
- name: Install program to tool cache (Windows)
if: runner.os == 'Windows' && inputs.cache_hit != 'true'
shell: pwsh
run: '& $env:GITHUB_ACTION_PATH\scripts\install\Windows.ps1'
env:
folder_name: ${{ inputs.folder_name }}
- name: Add program tool cache folder to path (Windows)
if: runner.os == 'Windows'
shell: pwsh
run: '& $env:GITHUB_ACTION_PATH\scripts\add-to-path\Windows.ps1'
env:
folder_name: ${{ inputs.folder_name }}