diff --git a/.github/actions/build-cache/action.yml b/.github/actions/build-cache/action.yml index a6635d4a93..f69201aeb4 100644 --- a/.github/actions/build-cache/action.yml +++ b/.github/actions/build-cache/action.yml @@ -1,5 +1,10 @@ name: Build Cache description: Cache builds +inputs: + docker: + description: If the test should load docker images + required: false + default: false runs: using: "composite" # Make sure to keep these cache entries in sync with those in writecache.yml @@ -14,6 +19,7 @@ runs: echo "hash=$hash" >> "$GITHUB_OUTPUT" - name: Restore Hermit Cache uses: actions/cache/restore@v4 + if: inputs.docker == 'true' with: path: ${{ runner.os == 'macOS' && '~/Library/Caches/hermit/pkg' || '~/.cache/hermit/pkg' }} key: ${{ runner.os }}-hermit-cache-${{ steps.bin-hash.outputs.hash }} diff --git a/.github/workflows/ci.yml b/.github/workflows/ci.yml index a0a7c10b4c..2a0b90217f 100644 --- a/.github/workflows/ci.yml +++ b/.github/workflows/ci.yml @@ -267,8 +267,19 @@ jobs: steps: - name: Checkout code uses: actions/checkout@v4 + - name: Check if Docker Required + id: check-docker + run: | + result="$(git grep -E '//ftl:subscribe|DefaultPostgresDatabaseConfig|DefaultMySQLDatabaseConfig' -- "$(git grep -l '^//go:build integration' | xargs grep -l '^func ${{ matrix.test }}' | xargs -I {} dirname ./{})/testdata" || true)" + if [ -z "$result" ]; then + echo "docker_req=false" >> $GITHUB_ENV + else + echo "docker_req=true" >> $GITHUB_ENV + fi - name: Build Cache uses: ./.github/actions/build-cache + with: + docker: ${{ env.result != ''}} - name: Init Hermit uses: cashapp/activate-hermit@v1.1.3 - name: Docker Compose