|
41 | 41 | fi |
42 | 42 | echo "sbt_cachekey=$RUNNER_OS-$RUNNER_ARCH-sbt-runner-$SBT_RUNNER_VERSION-$SBT_CACHE_KEY_VERSION" >> "$GITHUB_OUTPUT" |
43 | 43 | echo "sbt_diskcachekey=$RUNNER_OS-$RUNNER_ARCH-java$JDK_VERSION-sbt-diskcache-$SBT_CACHE_KEY_VERSION" >> "$GITHUB_OUTPUT" |
44 | | - - name: Check Tool Cache |
| 44 | + - name: Check tool cache |
45 | 45 | id: cache-tool-dir |
46 | 46 | shell: bash |
47 | 47 | env: |
|
60 | 60 | with: |
61 | 61 | path: ${{ steps.cache-paths.outputs.sbt_toolpath }} |
62 | 62 | key: ${{ steps.cache-paths.outputs.sbt_cachekey }} |
| 63 | + - name: Check runner cache |
| 64 | + id: cache-tool-dir2 |
| 65 | + shell: bash |
| 66 | + env: |
| 67 | + SBT_TOOLPATH: "${{ steps.cache-paths.outputs.sbt_toolpath }}" |
| 68 | + run: | |
| 69 | + # actions/cache seems to be buggy on Windows, so double check if restore worked |
| 70 | + if [[ -f "$SBT_TOOLPATH/sbt/bin/sbt" ]]; then |
| 71 | + echo "cache-hit=true" >> "$GITHUB_OUTPUT" |
| 72 | + else |
| 73 | + mkdir -p "$SBT_TOOLPATH" |
| 74 | + echo "cache-hit=false" >> "$GITHUB_OUTPUT" |
| 75 | + fi |
63 | 76 | - name: sbt 2.x disk cache |
64 | 77 | id: disk-cache |
65 | 78 | if: inputs.disk-cache == 'true' |
|
74 | 87 | SBT_RUNNER_VERSION: ${{ inputs.sbt-runner-version }} |
75 | 88 | SBT_TOOLPATH: "${{ steps.cache-paths.outputs.sbt_toolpath }}" |
76 | 89 | SBT_DOWNLOADPATH: "${{ steps.cache-paths.outputs.sbt_downloadpath }}" |
77 | | - if: steps.cache-tool-dir.outputs.cache-hit != 'true' && steps.cache-dir.outputs.cache-hit != 'true' |
| 90 | + if: steps.cache-tool-dir2.outputs.cache-hit != 'true' |
78 | 91 | run: | |
79 | 92 | mkdir -p "$SBT_DOWNLOADPATH" |
80 | 93 | curl -sL "https://github.com/sbt/sbt/releases/download/v$SBT_RUNNER_VERSION/sbt-$SBT_RUNNER_VERSION.zip" > \ |
|
89 | 102 | - name: "Verify the sbt distribution signature" |
90 | 103 | id: "ampel-verify" |
91 | 104 | # Skip on Windows/macOS until go-billy path fix lands: https://github.com/go-git/go-billy/issues/194 |
92 | | - if: runner.os == 'Linux' && steps.cache-tool-dir.outputs.cache-hit != 'true' && steps.cache-dir.outputs.cache-hit != 'true' |
| 105 | + if: runner.os == 'Linux' && steps.cache-tool-dir2.outputs.cache-hit != 'true' |
93 | 106 | uses: carabiner-dev/actions/ampel/verify@2a4b2cd115ede14629b03ef7e77586d3269d4c72 # v1.2.3 |
94 | 107 | with: |
95 | 108 | policy: "git+https://github.com/carabiner-dev/policies#signature/signature.json" |
|
0 commit comments