From 336045e97077b2a498b9b8af476069aa0f16d04c Mon Sep 17 00:00:00 2001 From: Kevin Lee Date: Fri, 18 Oct 2024 20:56:44 +1100 Subject: [PATCH] Update GitHub Actions: Replace olafurpg/setup-scala with actions/setup-java and sbt/setup-sbt --- .github/workflows/build.yml | 22 ++++------ .github/workflows/coverage.yml | 13 +----- .github/workflows/release.yml | 77 +++++++++++----------------------- 3 files changed, 33 insertions(+), 79 deletions(-) diff --git a/.github/workflows/build.yml b/.github/workflows/build.yml index 09e2508..534d358 100644 --- a/.github/workflows/build.yml +++ b/.github/workflows/build.yml @@ -15,26 +15,18 @@ jobs: strategy: matrix: scala: - - { name: "Scala 2", version: "2.12.18", binary-version: "2.12", java-version: "adopt@1.11", params: "" } - - { name: "Scala 2", version: "2.13.12", binary-version: "2.13", java-version: "adopt@1.11", params: "" } - - { name: "Scala 3.1", version: "3.3.1", binary-version: "3", java-version: "adopt@1.11", params: '' } + - { name: "Scala 2", version: "2.12.18", binary-version: "2.12", java-version: "11", java-distribution: "temurin", params: "" } + - { name: "Scala 2", version: "2.13.12", binary-version: "2.13", java-version: "11", java-distribution: "temurin", params: "" } + - { name: "Scala 3.1", version: "3.3.1", binary-version: "3", java-version: "11", java-distribution: "temurin", params: '' } steps: - uses: actions/checkout@v4 - - uses: olafurpg/setup-scala@v14 + - uses: actions/setup-java@v4 with: java-version: ${{ matrix.scala.java-version }} - - - name: Cache SBT - uses: actions/cache@v4 - with: - path: | - ~/.ivy2/cache - ~/.cache/coursier - ~/.sbt - key: ${{ runner.os }}-sbt-${{ matrix.scala.binary-version }}-${{ hashFiles('**/*.sbt') }}-${{ hashFiles('**/build.properties') }} - restore-keys: | - ${{ runner.os }}-sbt-${{ matrix.scala.binary-version }} + distribution: ${{ matrix.scala.java-distribution }} + cache: 'sbt' + - uses: sbt/setup-sbt@v1 - name: "[Push] Build All for Scala ${{ matrix.scala.version }}" if: github.event_name == 'push' diff --git a/.github/workflows/coverage.yml b/.github/workflows/coverage.yml index 0892bed..6a543ca 100644 --- a/.github/workflows/coverage.yml +++ b/.github/workflows/coverage.yml @@ -29,17 +29,8 @@ jobs: with: java-version: ${{ matrix.scala.java-version }} distribution: ${{ matrix.scala.java-distribution }} - - - name: Cache SBT - uses: actions/cache@v4 - with: - path: | - ~/.ivy2/cache - ~/.cache/coursier - ~/.sbt - key: ${{ runner.os }}-sbt-${{ matrix.scala.binary-version }}-${{ hashFiles('**/*.sbt') }}-${{ hashFiles('**/build.properties') }} - restore-keys: | - ${{ runner.os }}-sbt-${{ matrix.scala.binary-version }}- + cache: 'sbt' + - uses: sbt/setup-sbt@v1 - name: "[Codecov] Report ${{ matrix.scala.name }} ${{ matrix.scala.version }} - ${{ github.run_number }}" if: ${{ matrix.scala.report == 'report' && github.event_name == 'push' }} diff --git a/.github/workflows/release.yml b/.github/workflows/release.yml index 8cce8ea..a760228 100644 --- a/.github/workflows/release.yml +++ b/.github/workflows/release.yml @@ -8,7 +8,8 @@ on: - '*' env: - GH_JAVA_VERSION: "adopt@1.11" + GH_JAVA_VERSION: "11" + GH_JAVA_DISTRIBUTION: "temurin" GH_JVM_OPTS: "-Xss64m -Xms1024m -XX:MaxMetaspaceSize=1G -Xmx2G -XX:MaxInlineLevel=18 -XX:+UnlockExperimentalVMOptions -XX:+UseJVMCICompiler" jobs: @@ -19,26 +20,18 @@ jobs: strategy: matrix: scala: - - { name: "Scala 2", version: "2.12.18", binary-version: "2.12", java-version: "adopt@1.11", params: "" } - - { name: "Scala 2", version: "2.13.12", binary-version: "2.13", java-version: "adopt@1.11", params: "" } - - { name: "Scala 3.1", version: "3.3.1", binary-version: "3", java-version: "adopt@1.11", params: '' } + - { name: "Scala 2", version: "2.12.18", binary-version: "2.12", java-version: "11", java-distribution: "temurin", params: "" } + - { name: "Scala 2", version: "2.13.12", binary-version: "2.13", java-version: "11", java-distribution: "temurin", params: "" } + - { name: "Scala 3.1", version: "3.3.1", binary-version: "3", java-version: "11", java-distribution: "temurin", params: '' } steps: - uses: actions/checkout@v4 - - uses: olafurpg/setup-scala@v14 + - uses: actions/setup-java@v4 with: java-version: ${{ matrix.scala.java-version }} - - - name: Cache SBT - uses: actions/cache@v4 - with: - path: | - ~/.ivy2/cache - ~/.cache/coursier - ~/.sbt - key: ${{ runner.os }}-sbt-${{ matrix.scala.binary-version }}-${{ hashFiles('**/*.sbt') }}-${{ hashFiles('**/build.properties') }} - restore-keys: | - ${{ runner.os }}-sbt-${{ matrix.scala.binary-version }} + distribution: ${{ matrix.scala.java-distribution }} + cache: 'sbt' + - uses: sbt/setup-sbt@v1 - name: "Build All for Scala ${{ matrix.scala.version }}" env: @@ -53,24 +46,16 @@ jobs: strategy: matrix: scala: - - { name: "Scala 2", version: "2.13.12", binary-version: "2.13", java-version: "adopt@1.11" } + - { name: "Scala 2", version: "2.13.12", binary-version: "2.13", java-version: "11", java-distribution: "temurin" } steps: - uses: actions/checkout@v4 - - uses: olafurpg/setup-scala@v14 + - uses: actions/setup-java@v4 with: java-version: ${{ matrix.scala.java-version }} - - - name: Cache SBT - uses: actions/cache@v4 - with: - path: | - ~/.ivy2/cache - ~/.cache/coursier - ~/.sbt - key: ${{ runner.os }}-sbt-${{ matrix.scala.binary-version }}-${{ hashFiles('**/*.sbt') }}-${{ hashFiles('**/build.properties') }} - restore-keys: | - ${{ runner.os }}-sbt-${{ matrix.scala.binary-version }}- + distribution: ${{ matrix.scala.java-distribution }} + cache: 'sbt' + - uses: sbt/setup-sbt@v1 - name: "[Codecov] Report ${{ matrix.scala.name }} ${{ matrix.scala.version }} - ${{ github.run_number }}" env: @@ -95,20 +80,14 @@ jobs: runs-on: ubuntu-latest steps: - uses: actions/checkout@v4 - - uses: olafurpg/setup-scala@v14 with: - java-version: ${{ env.GH_JAVA_VERSION }} - - - name: Cache SBT - uses: actions/cache@v4 + fetch-depth: 0 + - uses: actions/setup-java@v4 with: - path: | - ~/.ivy2/cache - ~/.cache/coursier - ~/.sbt - key: ${{ runner.os }}-sbt-${{ hashFiles('**/*.sbt') }}-${{ hashFiles('**/build.properties') }} - restore-keys: | - ${{ runner.os }}-sbt + java-version: ${{ env.GH_JAVA_VERSION }} + distribution: ${{ env.GH_JAVA_DISTRIBUTION }} + cache: 'sbt' + - uses: sbt/setup-sbt@v1 - name: sbt GitHub Release env: @@ -135,22 +114,14 @@ jobs: - uses: actions/checkout@v4 with: fetch-depth: 0 - - uses: olafurpg/setup-scala@v14 + - uses: actions/setup-java@v4 with: java-version: ${{ env.GH_JAVA_VERSION }} + distribution: ${{ env.GH_JAVA_DISTRIBUTION }} + cache: 'sbt' + - uses: sbt/setup-sbt@v1 - uses: olafurpg/setup-gpg@v3 - - name: Cache SBT - uses: actions/cache@v4 - with: - path: | - ~/.ivy2/cache - ~/.cache/coursier - ~/.sbt - key: ${{ runner.os }}-sbt-${{ hashFiles('**/*.sbt') }}-${{ hashFiles('**/build.properties') }} - restore-keys: | - ${{ runner.os }}-sbt - - name: "sbt ci-release - ${{ github.run_number }}" env: PGP_PASSPHRASE: ${{ secrets.PGP_PASSPHRASE }}