fix(sbom): add support for file
component type of CycloneDX
(#9372)
#84
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
name: Cache test assets | |
# This workflow runs on the main branch to create caches that can be accessed by PRs. | |
# GitHub Actions cache isolation restricts access: | |
# - PRs can only restore caches from: current branch, base branch, and default branch (main) | |
# - PRs cannot restore caches from sibling branches or other PR branches | |
# - By creating caches on the main branch, all PRs can benefit from shared cache | |
on: | |
push: | |
branches: [main] | |
workflow_dispatch: | |
jobs: | |
test-images: | |
name: Cache test images | |
runs-on: ubuntu-latest | |
steps: | |
- name: Check out code into the Go module directory | |
uses: actions/checkout@11bd71901bbe5b1630ceea73d27597364c9af683 # v4.2.2 | |
- name: Set up Go | |
uses: actions/setup-go@d35c59abb061a4a6fb18e82ac0862c26744d6ab5 # v5.5.0 | |
with: | |
go-version-file: go.mod | |
cache: false | |
- name: Install Go tools | |
run: go install tool # GOBIN is added to the PATH by the setup-go action | |
- name: Generate image list digest | |
id: image-digest | |
run: | | |
source integration/testimages.ini | |
IMAGE_LIST=$(skopeo list-tags docker://$TEST_IMAGES) | |
DIGEST=$(echo "$IMAGE_LIST" | jq '.Tags += ["containerd"] | .Tags |= sort' | sha256sum | cut -d' ' -f1) | |
echo "digest=$DIGEST" >> $GITHUB_OUTPUT | |
- name: Restore and save test images cache | |
uses: actions/cache@0400d5f644dc74513175e3cd8d07132dd4860809 # v4.2.4 | |
with: | |
path: integration/testdata/fixtures/images | |
key: cache-test-images-${{ steps.image-digest.outputs.digest }} | |
- name: Download test images | |
run: mage test:fixtureContainerImages | |
test-vm-images: | |
name: Cache test VM images | |
runs-on: ubuntu-latest | |
steps: | |
- name: Check out code into the Go module directory | |
uses: actions/checkout@11bd71901bbe5b1630ceea73d27597364c9af683 # v4.2.2 | |
- name: Set up Go | |
uses: actions/setup-go@d35c59abb061a4a6fb18e82ac0862c26744d6ab5 # v5.5.0 | |
with: | |
go-version-file: go.mod | |
cache: false | |
- name: Install Go tools | |
run: go install tool # GOBIN is added to the PATH by the setup-go action | |
- name: Generate image list digest | |
id: image-digest | |
run: | | |
source integration/testimages.ini | |
IMAGE_LIST=$(skopeo list-tags docker://$TEST_VM_IMAGES) | |
DIGEST=$(echo "$IMAGE_LIST" | jq '.Tags |= sort' | sha256sum | cut -d' ' -f1) | |
echo "digest=$DIGEST" >> $GITHUB_OUTPUT | |
- name: Restore and save test VM images cache | |
uses: actions/cache@0400d5f644dc74513175e3cd8d07132dd4860809 # v4.2.4 | |
with: | |
path: integration/testdata/fixtures/vm-images | |
key: cache-test-vm-images-${{ steps.image-digest.outputs.digest }} | |
- name: Download test VM images | |
run: mage test:fixtureVMImages | |
lint-cache: | |
name: Cache lint results | |
runs-on: ubuntu-latest | |
steps: | |
- name: Check out code | |
uses: actions/checkout@11bd71901bbe5b1630ceea73d27597364c9af683 # v4.2.2 | |
- name: Set up Go | |
uses: actions/setup-go@d35c59abb061a4a6fb18e82ac0862c26744d6ab5 # v5.5.0 | |
with: | |
go-version-file: go.mod | |
cache: false | |
- name: Run golangci-lint for caching | |
uses: golangci/golangci-lint-action@4afd733a84b1f43292c63897423277bb7f4313a9 # v8.0.0 | |
with: | |
version: v2.1 | |
args: --verbose |