diff --git a/.github/workflows/e2e-cache.yml b/.github/workflows/e2e-cache.yml index c23c1778..0a5a8e19 100644 --- a/.github/workflows/e2e-cache.yml +++ b/.github/workflows/e2e-cache.yml @@ -111,3 +111,58 @@ jobs: exit 1 fi ls ~/.m2/repository + sbt-save: + runs-on: ${{ matrix.os }} + defaults: + run: + shell: bash + working-directory: __tests__/cache/sbt + strategy: + fail-fast: false + matrix: + os: [macos-latest, windows-latest, ubuntu-latest] + steps: + - name: Checkout + uses: actions/checkout@v3 + - name: Run setup-java with the cache for sbt + uses: ./ + id: setup-java + with: + distribution: 'adopt' + java-version: '11' + cache: sbt + - name: Create files to cache + run: | + sbt update + if [ ! -d ~/.ivy2/cache ]; then + echo "::error::The ~/.ivy2/cache directory does not exist unexpectedly" + exit 1 + fi + sbt-restore: + runs-on: ${{ matrix.os }} + defaults: + run: + shell: bash + working-directory: __tests__/cache/sbt + strategy: + fail-fast: false + matrix: + os: [macos-latest, windows-latest, ubuntu-latest] + needs: sbt-save + steps: + - name: Checkout + uses: actions/checkout@v3 + - name: Run setup-java with the cache for sbt + uses: ./ + id: setup-java + with: + distribution: 'adopt' + java-version: '11' + cache: sbt + - name: Confirm that ~/.ivy2/cache directory has been made + run: | + if [ ! -d ~/.ivy2/cache ]; then + echo "::error::The ~/.ivy2/cache directory does not exist unexpectedly" + exit 1 + fi + ls ~/.ivy2/cache diff --git a/__tests__/cache/sbt/build.sbt b/__tests__/cache/sbt/build.sbt index 66f9b4de..9396d867 100644 --- a/__tests__/cache/sbt/build.sbt +++ b/__tests__/cache/sbt/build.sbt @@ -1 +1,3 @@ -ThisBuild / scalaVersion := "3.1.1" \ No newline at end of file +ThisBuild / scalaVersion := "3.1.1" + +libraryDependencies += "org.junit.jupiter" % "junit-jupiter-api" % "5.8.2" % Test \ No newline at end of file