forked from gravitational/teleport
-
Notifications
You must be signed in to change notification settings - Fork 0
/
action.yml
52 lines (46 loc) · 1.91 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
name: Prepare Teleport workspace
description: Prepares Teleport workspace folder
inputs:
cache_key:
description: Cache infix used in cache actions
required: false
default: ${{ github.workflow }}
runs:
using: "composite"
steps:
- name: Mark workspace as git safe.directory
shell: bash
run: |
git config --global --add safe.directory ${GITHUB_WORKSPACE}
git config --global --add safe.directory ${GITHUB_WORKSPACE}/webassets
- name: Fetch Go cache paths
id: go-cache-paths
shell: bash
run: |
echo "go-build=$(go env GOCACHE)" >> $GITHUB_OUTPUT
echo "go-mod=$(go env GOMODCACHE)" >> $GITHUB_OUTPUT
- name: Get Go version
id: go-version
shell: bash
run: echo "go-version=$(go version | { read _ _ v _; echo ${v#go}; })" >> $GITHUB_OUTPUT
- name: Go build cache
uses: actions/cache@v3
with:
path: ${{ steps.go-cache-paths.outputs.go-build }}
key: ${{ runner.os }}-go-build-${{ steps.go-version.outputs.go-version }}-${{ inputs.cache_key }}-${{ hashFiles('**/go.sum') }}
restore-keys: ${{ runner.os }}-go-build-${{ steps.go-version.outputs.go-version }}-${{ inputs.cache_key }}-
- name: Go mod cache
uses: actions/cache@v3
with:
path: ${{ steps.go-cache-paths.outputs.go-mod }}
key: ${{ runner.os }}-go-mod-${{ steps.go-version.outputs.go-version }}-${{ inputs.cache_key }}-${{ hashFiles('**/go.sum') }}
restore-keys: ${{ runner.os }}-go-mod-${{ steps.go-version.outputs.go-version }}-${{ inputs.cache_key }}-
- name: Rust cargo cache
uses: actions/cache@v3
with:
path: |
${{ github.workspace }}/target
/usr/local/cargo/registry
/usr/local/cargo/git
key: ${{ runner.os }}-cargo-${{ inputs.cache_key }}-${{ hashFiles('**/Cargo.lock') }}
restore-keys: ${{ runner.os }}-cargo-${{ inputs.cache_key }}-