From c4efe2f973bf161db385ce617ebf63d9ac5f81c9 Mon Sep 17 00:00:00 2001 From: Maxime Desroches Date: Mon, 31 Mar 2025 13:06:37 -0700 Subject: [PATCH] add cache key for macOS runners (#34963) * fix * test * restore * cleanup --- .github/workflows/selfdrive_tests.yaml | 10 +++++++++- 1 file changed, 9 insertions(+), 1 deletion(-) diff --git a/.github/workflows/selfdrive_tests.yaml b/.github/workflows/selfdrive_tests.yaml index 1c290732b8..b42dc7da26 100644 --- a/.github/workflows/selfdrive_tests.yaml +++ b/.github/workflows/selfdrive_tests.yaml @@ -90,21 +90,29 @@ jobs: - uses: actions/checkout@v4 with: submodules: true + - run: echo "CACHE_COMMIT_DATE=$(git log -1 --pretty='format:%cd' --date=format:'%Y-%m-%d-%H:%M')" >> $GITHUB_ENV - name: Homebrew cache uses: ./.github/workflows/auto-cache with: path: ~/Library/Caches/Homebrew + key: brew-macos-${{ env.CACHE_COMMIT_DATE }}-${{ github.sha }} + restore-keys: | + brew-macos-${{ env.CACHE_COMMIT_DATE }} + brew-macos - name: Install dependencies run: ./tools/mac_setup.sh env: # package install has DeprecationWarnings PYTHONWARNINGS: default - run: git lfs pull - - run: echo "CACHE_COMMIT_DATE=$(git log -1 --pretty='format:%cd' --date=format:'%Y-%m-%d-%H:%M')" >> $GITHUB_ENV - name: Getting scons cache uses: ./.github/workflows/auto-cache with: path: /tmp/scons_cache + key: scons-${{ runner.arch }}-macos-${{ env.CACHE_COMMIT_DATE }}-${{ github.sha }} + restore-keys: | + scons-${{ runner.arch }}-macos-${{ env.CACHE_COMMIT_DATE }} + scons-${{ runner.arch }}-macos - name: Building openpilot run: . .venv/bin/activate && scons -j$(nproc)