mirror of
https://github.com/kyverno/kyverno.git
synced 2024-12-14 11:57:48 +00:00
4925f7a4b3
Signed-off-by: Charles-Edouard Brétéché <charles.edouard@nirmata.com>
48 lines
1.6 KiB
YAML
48 lines
1.6 KiB
YAML
name: Setup build env
|
|
|
|
description: Clone repo, unshallow, setup go, cache and install tools.
|
|
|
|
inputs:
|
|
unshallow:
|
|
description: git unshallow
|
|
default: 'true'
|
|
build-cache-key:
|
|
description: build cache prefix
|
|
|
|
runs:
|
|
using: composite
|
|
steps:
|
|
- uses: jlumbroso/free-disk-space@76866dbe54312617f00798d1762df7f43def6e5c # v1.2.0
|
|
with:
|
|
tool-cache: true
|
|
android: true
|
|
dotnet: true
|
|
haskell: true
|
|
large-packages: false
|
|
swap-storage: true
|
|
- shell: bash
|
|
if: ${{ inputs.unshallow == 'true' }}
|
|
run: |
|
|
git fetch --prune --unshallow
|
|
- uses: actions/setup-go@6edd4406fa81c3da01a34fa6f6343087c207a568 # v3.5.0
|
|
with:
|
|
go-version: ~1.21.1
|
|
- uses: actions/cache@4723a57e26efda3a62cbde1812113b730952852d # v3.2.2
|
|
with:
|
|
path: ~/go/pkg/mod
|
|
key: ${{ runner.os }}-go-pkg-mod-${{ hashFiles('**/go.sum') }}-${{ hashFiles('Makefile') }}
|
|
- uses: actions/cache@4723a57e26efda3a62cbde1812113b730952852d # v3.2.2
|
|
with:
|
|
path: ~/.cache/kyverno/tools
|
|
key: ${{ runner.os }}-cache-kyverno-tools-${{ hashFiles('**/go.sum') }}-${{ hashFiles('Makefile') }}
|
|
- uses: actions/cache@4723a57e26efda3a62cbde1812113b730952852d # v3.2.2
|
|
if: ${{ inputs.build-cache-key }}
|
|
with:
|
|
path: ~/.cache/go-build
|
|
key: ${{ runner.os }}-build-cache-${{ inputs.build-cache-key }}-${{ hashFiles('**/go.sum') }}-${{ hashFiles('Makefile') }}
|
|
- shell: bash
|
|
run: |
|
|
go mod download
|
|
- shell: bash
|
|
run: |
|
|
GOCACHE=~/.cache/kyverno/tools make install-tools
|