Skip to content
New issue

Have a question about this project? # for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “#”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? # to your account

Cache even more trivy #2914

Merged
merged 1 commit into from
Oct 3, 2024
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
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
Loading