-
Notifications
You must be signed in to change notification settings - Fork 2k
Expand file tree
/
Copy pathaction.yml
More file actions
52 lines (46 loc) · 1.75 KB
/
action.yml
File metadata and controls
52 lines (46 loc) · 1.75 KB
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
name: "Install vdev"
description: "Install vdev CLI tool with caching based on source code changes"
branding:
icon: tool
color: purple
inputs:
skip-cache:
description: "Skip cache lookup and force compilation"
required: false
default: 'false'
runs:
using: "composite"
steps:
- name: Cache vdev binary
id: cache-vdev
if: ${{ inputs.skip-cache != 'true' }}
uses: actions/cache@cdf6c1fa76f9f475f3d7449005a359c84ca0f306 # v5.0.3
with:
path: ~/.cargo/bin/vdev
# ** WARNING - IMPORTANT **
# If updating the key, make sure to also update other usages of the key in this file
# and also in .github/actions/setup/action.yml
# ** WARNING - IMPORTANT **
key: ${{ runner.os }}-vdev-${{ hashFiles('vdev/**', 'lib/vector-vrl/**', 'Cargo.toml', 'Cargo.lock') }}
restore-keys: |
${{ runner.os }}-vdev-
- name: Build and install vdev
if: steps.cache-vdev.outputs.cache-hit != 'true'
shell: bash
run: |
echo "Building vdev from source (cache miss)"
cargo install --path vdev --locked --force
- name: Save vdev to cache
if: ${{ inputs.skip-cache == 'true' }}
uses: actions/cache/save@cdf6c1fa76f9f475f3d7449005a359c84ca0f306 # v5.0.3
with:
path: ~/.cargo/bin/vdev
# ** WARNING - IMPORTANT **
# If updating the key, make sure to also update other usages of the key in this file
# and also in .github/actions/setup/action.yml
# ** WARNING - IMPORTANT **
key: ${{ runner.os }}-vdev-${{ hashFiles('vdev/**', 'lib/vector-vrl/**', 'Cargo.toml', 'Cargo.lock') }}
- name: Set VDEV environment variable
shell: bash
run: |
echo "VDEV=$(which vdev)" >> "$GITHUB_ENV"