2023-03-03 21:17:44 +00:00
|
|
|
name: "Bootstrap"
|
|
|
|
description: "Bootstrap all tools and dependencies"
|
|
|
|
inputs:
|
|
|
|
go-version:
|
|
|
|
description: "Go version to install"
|
|
|
|
required: true
|
2023-09-07 18:55:38 +00:00
|
|
|
default: "1.21.x"
|
2023-03-03 21:17:44 +00:00
|
|
|
python-version:
|
|
|
|
description: "Python version to install"
|
|
|
|
required: true
|
|
|
|
default: "3.10"
|
|
|
|
cache-key-prefix:
|
|
|
|
description: "Prefix all cache keys with this value"
|
|
|
|
required: true
|
2023-10-27 18:24:56 +00:00
|
|
|
default: "831180ac26"
|
2023-03-03 21:17:44 +00:00
|
|
|
build-cache-key-prefix:
|
|
|
|
description: "Prefix build cache key with this value"
|
|
|
|
required: true
|
|
|
|
default: "f8b6d31dea"
|
|
|
|
bootstrap-apt-packages:
|
|
|
|
description: "Space delimited list of tools to install via apt"
|
|
|
|
default: "libxml2-utils"
|
|
|
|
|
|
|
|
runs:
|
|
|
|
using: "composite"
|
|
|
|
steps:
|
2023-09-20 20:39:23 +00:00
|
|
|
# note: go mod and build is automatically cached on default with v4+
|
|
|
|
- uses: actions/setup-go@93397bea11091df50f3d7e59dc26a7711a8bcfbe #v4.1.0
|
2023-03-03 21:17:44 +00:00
|
|
|
with:
|
|
|
|
go-version: ${{ inputs.go-version }}
|
|
|
|
|
|
|
|
- uses: actions/setup-python@d27e3f3d7c64b4bbf8e4abfb9b63b83e846e0435 # v4.5.0
|
|
|
|
with:
|
|
|
|
python-version: ${{ inputs.python-version }}
|
|
|
|
|
|
|
|
- name: Restore python cache
|
|
|
|
id: python-venv-cache
|
|
|
|
uses: actions/cache@69d9d449aced6a2ede0bc19182fadc3a0a42d2b0 # v3.2.6
|
|
|
|
with:
|
|
|
|
path: |
|
|
|
|
test/quality/venv
|
|
|
|
test/quality/vulnerability-match-labels/venv
|
2023-10-27 18:24:56 +00:00
|
|
|
key: ${{ inputs.cache-key-prefix }}-${{ runner.os }}-python-${{ inputs.python-version }}-${{ hashFiles('**/test/quality/**/requirements.txt') }}
|
2023-03-03 21:17:44 +00:00
|
|
|
|
|
|
|
- name: Restore tool cache
|
|
|
|
id: tool-cache
|
|
|
|
uses: actions/cache@v3
|
|
|
|
with:
|
|
|
|
path: ${{ github.workspace }}/.tmp
|
|
|
|
key: ${{ inputs.cache-key-prefix }}-${{ runner.os }}-tool-${{ hashFiles('Makefile') }}
|
|
|
|
|
|
|
|
- name: (cache-miss) Bootstrap project tools
|
|
|
|
shell: bash
|
|
|
|
if: steps.tool-cache.outputs.cache-hit != 'true'
|
|
|
|
run: make bootstrap-tools
|
|
|
|
|
2023-09-20 20:39:23 +00:00
|
|
|
- name: Bootstrap go dependencies
|
2023-03-03 21:17:44 +00:00
|
|
|
shell: bash
|
|
|
|
run: make bootstrap-go
|
|
|
|
|
|
|
|
- name: Install apt packages
|
|
|
|
if: inputs.bootstrap-apt-packages != ''
|
|
|
|
shell: bash
|
|
|
|
run: |
|
|
|
|
DEBIAN_FRONTEND=noninteractive sudo apt update && sudo -E apt install -y ${{ inputs.bootstrap-apt-packages }}
|
|
|
|
|
|
|
|
- name: Create all cache fingerprints
|
|
|
|
shell: bash
|
|
|
|
run: make fingerprints
|