Update Scala - SBT example to include Coursier cache

This commit is contained in:
Daniel Shuy 2020-05-30 21:20:51 +08:00 committed by GitHub
parent b8204782bb
commit 393e74a534
No known key found for this signature in database
GPG key ID: 4AEE18F83AFDEB23

View file

@ -437,13 +437,68 @@ When dependencies are installed later in the workflow, we must specify the same
## Scala - SBT
SBT 1.2
```yaml
- name: Cache SBT ivy cache
uses: actions/cache@v2
with:
path: ~/.ivy2/cache
key: ${{ runner.os }}-sbt-ivy-cache-${{ hashFiles('**/build.sbt') }}
- name: Cache SBT
uses: actions/cache@v2
with:
path: |
~/.ivy2/cache
~/.sbt
path: ~/.sbt
key: ${{ runner.os }}-sbt-${{ hashFiles('**/build.sbt') }}
```
SBT 1.3.0-1.3.10
```yaml
- name: Cache SBT ivy cache
uses: actions/cache@v2
with:
path: ~/.ivy2/cache
key: ${{ runner.os }}-sbt-ivy-cache-${{ hashFiles('**/build.sbt') }}
- name: Cache SBT coursier cache
uses: actions/cache@v2
with:
path: ~/.coursier/cache
key: ${{ runner.os }}-sbt-coursier-cache-${{ hashFiles('**/build.sbt') }}
- name: Cache SBT
uses: actions/cache@v2
with:
path: ~/.sbt
key: ${{ runner.os }}-sbt-${{ hashFiles('**/build.sbt') }}
```
SBT 1.3.11+
```yaml
- name: Cache SBT ivy cache
uses: actions/cache@v2
with:
path: ~/.ivy2/cache
key: ${{ runner.os }}-sbt-ivy-cache-${{ hashFiles('**/build.sbt') }}
- name: Cache SBT coursier cache (Linux)
uses: actions/cache@v2
if: startsWith(runner.os, 'Linux')
with:
path: ~/.cache/coursier/v1
key: ${{ runner.os }}-sbt-coursier-cache-${{ hashFiles('**/build.sbt') }}
- name: Cache SBT coursier cache (macOS)
uses: actions/cache@v2
if: startsWith(runner.os, 'macOS')
with:
path: ~/Library/Caches/Coursier/v1
key: ${{ runner.os }}-sbt-coursier-cache-${{ hashFiles('**/build.sbt') }}
- name: Cache SBT coursier cache (Windows)
uses: actions/cache@v2
if: startsWith(runner.os, 'Windows')
with:
path: ~\AppData\Local\Coursier\Cache\v1
key: ${{ runner.os }}-sbt-coursier-cache-${{ hashFiles('**/build.sbt') }}
- name: Cache SBT
uses: actions/cache@v2
with:
path: ~/.sbt
key: ${{ runner.os }}-sbt-${{ hashFiles('**/build.sbt') }}
```