github.com/anchore/syft@v1.38.2/.github/actions/bootstrap/action.yaml (about) 1 name: "Bootstrap" 2 3 description: "Bootstrap all tools and dependencies" 4 inputs: 5 go-version: 6 description: "Go version to install" 7 required: true 8 default: ">= 1.24" 9 go-dependencies: 10 description: "Download go dependencies" 11 required: true 12 default: "true" 13 cache-key-prefix: 14 description: "Prefix all cache keys with this value" 15 required: true 16 default: "181053ac82" 17 download-test-fixture-cache: 18 description: "Download test fixture cache from OCI and github actions" 19 required: true 20 default: "false" 21 tools: 22 description: "whether to install tools" 23 default: "true" 24 bootstrap-apt-packages: 25 description: "Space delimited list of tools to install via apt" 26 default: "libxml2-utils" 27 28 runs: 29 using: "composite" 30 steps: 31 # note: go mod and build is automatically cached on default with v4+ 32 - uses: actions/setup-go@4dc6199c7b1a012772edbd06daecab0f50c9053c # v6.1.0 33 if: inputs.go-version != '' 34 with: 35 go-version: ${{ inputs.go-version }} 36 37 - name: Restore tool cache 38 if: inputs.tools == 'true' 39 id: tool-cache 40 uses: actions/cache@0057852bfaa89a56745cba8c7296529d2fc39830 # v4.3.0 41 with: 42 path: ${{ github.workspace }}/.tool 43 key: ${{ inputs.cache-key-prefix }}-${{ runner.os }}-tool-${{ hashFiles('.binny.yaml') }} 44 45 - name: Install project tools 46 shell: bash 47 if: inputs.tools == 'true' 48 run: make tools 49 50 - name: Install go dependencies 51 if: inputs.go-dependencies == 'true' 52 shell: bash 53 run: make ci-bootstrap-go 54 55 - name: Install apt packages 56 if: inputs.bootstrap-apt-packages != '' 57 shell: bash 58 env: 59 APT_PACKAGES: ${{ inputs.bootstrap-apt-packages }} 60 run: | 61 IFS=' ' read -ra packages <<< "$APT_PACKAGES" 62 DEBIAN_FRONTEND=noninteractive sudo apt update && sudo -E apt install -y "${packages[@]}" 63 64 - name: Restore ORAS cache from github actions 65 if: inputs.download-test-fixture-cache == 'true' 66 uses: actions/cache@0057852bfaa89a56745cba8c7296529d2fc39830 # v4.3.0 67 with: 68 path: ${{ github.workspace }}/.tmp/oras-cache 69 key: ${{ inputs.cache-key-prefix }}-oras-cache 70 71 - name: Download test fixture cache 72 if: inputs.download-test-fixture-cache == 'true' 73 shell: bash 74 run: make download-test-fixture-cache