55 description : " The runner version (The actual version is controlled via project/build.properties)"
66 required : true
77 default : 1.12.11
8+ disk-cache :
9+ description : " Enable sbt 2.x disk cache"
10+ required : false
11+ default : true
812runs :
913 using : " composite"
1014 steps :
@@ -18,11 +22,18 @@ runs:
1822 if [[ "$RUNNER_OS" == "Windows" ]]; then
1923 echo "sbt_toolpath=$RUNNER_TOOL_CACHE\\sbt\\$SBT_RUNNER_VERSION" >> "$GITHUB_OUTPUT"
2024 echo "sbt_downloadpath=$RUNNER_TEMP\\_sbt" >> "$GITHUB_OUTPUT"
25+ echo "sbt_diskcache=$HOME\\AppData\\Local\\sbt" >> "$GITHUB_OUTPUT"
26+ elif [[ "$RUNNER_OS" == "macOS" ]]; then
27+ echo "sbt_toolpath=$RUNNER_TOOL_CACHE/sbt/$SBT_RUNNER_VERSION" >> "$GITHUB_OUTPUT"
28+ echo "sbt_downloadpath=$RUNNER_TEMP/_sbt" >> "$GITHUB_OUTPUT"
29+ echo "sbt_diskcache=$HOME/Library/Caches/sbt" >> "$GITHUB_OUTPUT"
2130 else
2231 echo "sbt_toolpath=$RUNNER_TOOL_CACHE/sbt/$SBT_RUNNER_VERSION" >> "$GITHUB_OUTPUT"
2332 echo "sbt_downloadpath=$RUNNER_TEMP/_sbt" >> "$GITHUB_OUTPUT"
33+ echo "sbt_diskcache=$HOME/.cache/sbt" >> "$GITHUB_OUTPUT"
2434 fi
2535 echo "sbt_cachekey=$RUNNER_OS-sbt-$SBT_RUNNER_VERSION-$SBT_CACHE_KEY_VERSION" >> "$GITHUB_OUTPUT"
36+ echo "sbt_diskcachekey=$RUNNER_OS-sbt-diskcache-$SBT_CACHE_KEY_VERSION" >> "$GITHUB_OUTPUT"
2637 - name : Check Tool Cache
2738 id : cache-tool-dir
2839 shell : bash
4253 with :
4354 path : ${{ steps.cache-paths.outputs.sbt_toolpath }}
4455 key : ${{ steps.cache-paths.outputs.sbt_cachekey }}
56+ - name : sbt 2.x disk cache
57+ id : disk-cache
58+ if : inputs.disk-cache == 'true'
59+ uses : actions/cache@27d5ce7f107fe9357f9df03efb73ab90386fccae # v5.0.5
60+ with :
61+ path : ${{ steps.cache-paths.outputs.sbt_diskcache }}
62+ key : ${{ steps.cache-paths.outputs.sbt_diskcachekey }}
4563 - name : " Download and Install sbt"
4664 shell : bash
4765 env :
0 commit comments