Skip to content

Commit

Permalink
feat: only load docker when needed
Browse files Browse the repository at this point in the history
  • Loading branch information
stuartwdouglas committed Dec 16, 2024
1 parent e166171 commit a16fda6
Showing 2 changed files with 13 additions and 0 deletions.
6 changes: 6 additions & 0 deletions .github/actions/build-cache/action.yml
Original file line number Diff line number Diff line change
@@ -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 }}
7 changes: 7 additions & 0 deletions .github/workflows/ci.yml
Original file line number Diff line number Diff line change
@@ -267,8 +267,15 @@ jobs:
steps:
- name: Checkout code
uses: actions/checkout@v4
- name: Check if Docker Required
id: check-docker
run: |

Check failure on line 272 in .github/workflows/ci.yml

GitHub Actions / Lint

shellcheck reported issue in this script: SC2046:warning:1:101: Quote this to prevent word splitting [shellcheck]

Check failure on line 272 in .github/workflows/ci.yml

GitHub Actions / Lint

shellcheck reported issue in this script: SC2086:info:2:30: Double quote to prevent globbing and word splitting [shellcheck]
result="$(git grep -E '//ftl:subscribe|DefaultPostgresDatabaseConfig|DefaultMySQLDatabaseConfig' -- $(git grep -l '^//go:build integration' | xargs grep -l '^func TestPubSub' | xargs -I {} dirname ./{})/testdata || true)"
echo "docker_req=$result" >> $GITHUB_ENV
- name: Build Cache
uses: ./.github/actions/build-cache
with:
docker: ${{ env.result != ''}}
- name: Init Hermit
uses: cashapp/[email protected]
- name: Docker Compose

0 comments on commit a16fda6

Please sign in to comment.