From 393e74a534dd15d80055490b7878ff5f49837737 Mon Sep 17 00:00:00 2001 From: Daniel Shuy Date: Sat, 30 May 2020 21:20:51 +0800 Subject: [PATCH] Update Scala - SBT example to include Coursier cache --- examples.md | 61 ++++++++++++++++++++++++++++++++++++++++++++++++++--- 1 file changed, 58 insertions(+), 3 deletions(-) diff --git a/examples.md b/examples.md index ec662bb..bfd0476 100644 --- a/examples.md +++ b/examples.md @@ -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') }} ```