Skip to content

Commit

Permalink
Add vcpkg cache step
Browse files Browse the repository at this point in the history
  • Loading branch information
keynmol committed Jul 16, 2024
1 parent b9157f9 commit 948349d
Show file tree
Hide file tree
Showing 2 changed files with 27 additions and 0 deletions.
9 changes: 9 additions & 0 deletions .github/workflows/ci.yml
Original file line number Diff line number Diff line change
Expand Up @@ -52,6 +52,15 @@ jobs:
if: matrix.java == 'temurin@17' && steps.setup-java-temurin-17.outputs.cache-hit == 'false'
run: sbt +update

- name: Cache vcpkg
uses: actions/cache@v4
with:
key: ${{ runner.os }}-sbt-vcpkg
path: |
~/Library/Caches/sbt-vcpkg/vcpkg-install
~/.cache/sbt-vcpkg/vcpkg-install
~/.cache/sbt-vcpkg/vcpkg
- name: Check that workflows are up to date
run: sbt githubWorkflowCheck

Expand Down
18 changes: 18 additions & 0 deletions build.sbt
Original file line number Diff line number Diff line change
Expand Up @@ -20,6 +20,24 @@ ThisBuild / scalacOptions ++= Seq(
"-language:implicitConversions"
)

ThisBuild / githubWorkflowBuildPreamble += {
import org.typelevel.sbt.gha.*
import WorkflowStep.*

val paths =
List(
"~/Library/Caches/sbt-vcpkg/vcpkg-install",
"~/.cache/sbt-vcpkg/vcpkg-install",
"~/.cache/sbt-vcpkg/vcpkg"
)

Use(
UseRef.Public("actions", "cache", "v4"),
name = Some("Cache vcpkg"),
params = Map("key" -> "${{ runner.os }}-sbt-vcpkg", "path" -> paths.mkString("\n"))
)
}

val Scala3 = "3.4.1"
ThisBuild / scalaVersion := Scala3 // the default Scala

Expand Down

0 comments on commit 948349d

Please sign in to comment.