From 3d3c7b32655250f992de9b3a53fde77178b3a344 Mon Sep 17 00:00:00 2001 From: Timo Behrendt Date: Fri, 10 Apr 2026 18:42:38 +0200 Subject: [PATCH] adjust tests --- .gitea/workflows/ci.yaml | 33 +++++++++++++++------------------ 1 file changed, 15 insertions(+), 18 deletions(-) diff --git a/.gitea/workflows/ci.yaml b/.gitea/workflows/ci.yaml index aa635ed..c7b7e0b 100644 --- a/.gitea/workflows/ci.yaml +++ b/.gitea/workflows/ci.yaml @@ -4,33 +4,30 @@ on: pull_request: jobs: - test-setup-trivy: - strategy: - matrix: - arch: [ amd64, arm64 ] - name: Test Setup Trivy ${{ matrix.arch }} - runs-on: - - ubuntu-latest - - linux_${{ matrix.arch }} - steps: - - uses: actions/checkout@de0fac2e4500dabe0009e67214ff5f5447ce83dd # v6.0.2 - - name: Setup Trivy - uses: ./setup-trivy - - name: Run Trivy - run: trivy --version - test-setup-db: name: Test Setup DB runs-on: - ubuntu-latest steps: - uses: actions/checkout@de0fac2e4500dabe0009e67214ff5f5447ce83dd # v6.0.2 - - uses: ./setup-trivy - name: Setup DB id: setup-db uses: ./setup-db - - name: Run Trivy - run: trivy fs --skip-db-update --cache-dir ${{ steps.setup-db.outputs.cache-dir }} . + - name: Verify vulnerability DB in cache + run: | + set -euo pipefail + cache="${{ steps.setup-db.outputs.cache-dir }}" + db="$cache/db/trivy.db" + meta="$cache/db/metadata.json" + test -f "$meta" || { echo "FAIL: $meta missing (DB not downloaded?)"; exit 1; } + test -f "$db" || { echo "FAIL: $db missing (DB not downloaded?)"; exit 1; } + size=$(stat -c%s "$db") + min=$((3 * 1024 * 1024)) + if [ "$size" -lt "$min" ]; then + echo "FAIL: trivy.db too small ($size bytes; expected at least $min bytes, i.e. a few MiB)" + exit 1 + fi + echo "OK: trivy.db is present ($size bytes) and metadata.json exists." test-get-images-from-files: name: Test Get Images From Files