Skip to content

Commit

Permalink
Cache even more trivy (#2914)
Browse files Browse the repository at this point in the history
Signed-off-by: Dimitris Karakasilis <dimitris@karakasilis.me>
  • Loading branch information
jimmykarily authored Oct 3, 2024
1 parent 24b498d commit 2a5bb93
Show file tree
Hide file tree
Showing 2 changed files with 54 additions and 2 deletions.
24 changes: 24 additions & 0 deletions .github/workflows/image-arm-pr.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -13,9 +13,31 @@ env:
FORCE_COLOR: 1
EARTHLY_TOKEN: ${{ secrets.EARTHLY_TOKEN }}
jobs:
# Populate the trivy cache once for all later jobs to use
trivy-cache:
runs-on: ubuntu-latest
steps:
- uses: actions/checkout@692973e3d937129bcbf40652eb9f2f61becf3332 # v4
with:
fetch-depth: 0
- name: Install earthly
uses: Luet-lab/luet-install-action@cec77490c3f2416d7d07a47cfab04d448641d7ce # v1.1
with:
repository: quay.io/kairos/packages
packages: utils/earthly
- name: Restore trivy cache
uses: yogeshlonkar/trivy-cache-action@v0
with:
gh-token: ${{ secrets.GITHUB_TOKEN }}
- name: Populate trivy Cache
run: |
[ ! -d ".trivy" ] && mkdir -p ".trivy"
earthly +trivy-download-db --DIR .trivy
opensuse:
uses: ./.github/workflows/reusable-docker-arm-build.yaml
secrets: inherit
needs:
- trivy-cache
permissions:
id-token: write # OIDC support
contents: write
Expand All @@ -41,6 +63,8 @@ jobs:
alpine:
uses: ./.github/workflows/reusable-docker-arm-build.yaml
secrets: inherit
needs:
- trivy-cache
permissions:
id-token: write # OIDC support
contents: write
Expand Down
32 changes: 30 additions & 2 deletions .github/workflows/image-arm.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -81,8 +81,31 @@ jobs:
# end of optional handling for multi line json
echo "::set-output name=matrix::{\"include\": $content }"
# Populate the trivy cache once for all later jobs to use
trivy-cache:
runs-on: ubuntu-latest
steps:
- uses: actions/checkout@692973e3d937129bcbf40652eb9f2f61becf3332 # v4
with:
fetch-depth: 0
- name: Install earthly
uses: Luet-lab/luet-install-action@cec77490c3f2416d7d07a47cfab04d448641d7ce # v1.1
with:
repository: quay.io/kairos/packages
packages: utils/earthly
- name: Restore trivy cache
uses: yogeshlonkar/trivy-cache-action@v0
with:
gh-token: ${{ secrets.GITHUB_TOKEN }}
- name: Populate trivy Cache
run: |
[ ! -d ".trivy" ] && mkdir -p ".trivy"
earthly +trivy-download-db --DIR .trivy
build-nvidia-base:
runs-on: fast
needs:
- trivy-cache
steps:
- uses: actions/checkout@692973e3d937129bcbf40652eb9f2f61becf3332 # v4
with:
Expand Down Expand Up @@ -184,7 +207,9 @@ jobs:
pull-requests: read
repository-projects: read
statuses: read
needs: build-nvidia-base
needs:
- build-nvidia-base
- trivy-cache
secrets: inherit
with:
flavor: ubuntu
Expand Down Expand Up @@ -220,13 +245,16 @@ jobs:
base_image: ${{ matrix.baseImage }}
worker: ${{ matrix.worker }}
needs:
- get-core-matrix
- get-core-matrix
- trivy-cache
strategy:
fail-fast: false
matrix: ${{fromJson(needs.get-core-matrix.outputs.matrix)}}

image_and_iso_arm64_generic:
uses: ./.github/workflows/reusable-image-and-iso-arm-generic.yaml
needs:
- trivy-cache
secrets: inherit
with:
flavor: "opensuse"
Expand Down

0 comments on commit 2a5bb93

Please sign in to comment.