From 6477984c4688355b87591c1033ac4054d11f0b0b Mon Sep 17 00:00:00 2001 From: Kevin Lee Date: Tue, 12 Nov 2024 22:21:26 +1100 Subject: [PATCH] Update: GitHub Actions with new actions/setup-java with its caching sbt and use sbt/setup-sbt --- .github/workflows/build.yml | 15 +---- .github/workflows/checks.yml | 15 +---- .github/workflows/coverage.yml | 15 +---- .github/workflows/doc-site-build-only.yml | 16 ++--- .github/workflows/doc-site-publish.yml | 16 ++--- .github/workflows/release.yml | 77 +++++------------------ 6 files changed, 34 insertions(+), 120 deletions(-) diff --git a/.github/workflows/build.yml b/.github/workflows/build.yml index b12c682..2c17fbe 100644 --- a/.github/workflows/build.yml +++ b/.github/workflows/build.yml @@ -25,21 +25,12 @@ jobs: steps: - uses: actions/checkout@v4.1.2 - - uses: actions/setup-java@v4 + - uses: actions/setup-java@v4.4.0 with: java-version: ${{ matrix.scala.java-version }} distribution: ${{ matrix.scala.java-distribution }} - - - name: Cache SBT - uses: actions/cache@v4.0.2 - 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: "[Push] Build All for ${{ matrix.scala.name }} ${{ matrix.scala.version }} - ${{ github.run_number }}" if: github.event_name == 'push' diff --git a/.github/workflows/checks.yml b/.github/workflows/checks.yml index c2ea416..29b9702 100644 --- a/.github/workflows/checks.yml +++ b/.github/workflows/checks.yml @@ -24,21 +24,12 @@ jobs: steps: - uses: actions/checkout@v4.1.2 - - uses: actions/setup-java@v4 + - uses: actions/setup-java@v4.4.0 with: java-version: ${{ matrix.scala.java-version }} distribution: ${{ matrix.scala.java-distribution }} - - - name: Cache SBT - uses: actions/cache@v4.0.2 - with: - path: | - ~/.ivy2/cache - ~/.cache/coursier - ~/.sbt - key: ${{ runner.os }}-sbt-${{ hashFiles('**/*.sbt') }}-${{ hashFiles('**/build.properties') }} - restore-keys: | - ${{ runner.os }}-sbt + cache: 'sbt' + - uses: sbt/setup-sbt@v1 - name: "[Push] Build All for ${{ matrix.scala.name }} v${{ matrix.scala.version }} - ${{ github.run_number }}" if: github.event_name == 'push' diff --git a/.github/workflows/coverage.yml b/.github/workflows/coverage.yml index 9377c30..19c2fc2 100644 --- a/.github/workflows/coverage.yml +++ b/.github/workflows/coverage.yml @@ -25,21 +25,12 @@ jobs: steps: - uses: actions/checkout@v4 - - uses: actions/setup-java@v4 + - uses: actions/setup-java@v4.4.0 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/doc-site-build-only.yml b/.github/workflows/doc-site-build-only.yml index cd1cc26..7fdb3eb 100644 --- a/.github/workflows/doc-site-build-only.yml +++ b/.github/workflows/doc-site-build-only.yml @@ -22,26 +22,18 @@ jobs: steps: - uses: actions/checkout@v4.1.2 - - uses: actions/setup-java@v4 + - uses: actions/setup-java@v4.4.0 with: java-version: ${{ matrix.scala.java-version }} distribution: ${{ matrix.scala.java-distribution }} + cache: 'sbt' + - uses: sbt/setup-sbt@v1 + - uses: actions/setup-node@v4 with: node-version: ${{ matrix.node.version }} registry-url: 'https://registry.npmjs.org' - - name: Cache SBT - uses: actions/cache@v4.0.2 - 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 }}- - - name: Cache npm uses: actions/cache@v4.0.2 with: diff --git a/.github/workflows/doc-site-publish.yml b/.github/workflows/doc-site-publish.yml index 5bc77b5..8e434a9 100644 --- a/.github/workflows/doc-site-publish.yml +++ b/.github/workflows/doc-site-publish.yml @@ -22,26 +22,18 @@ jobs: steps: - uses: actions/checkout@v4.1.2 - - uses: actions/setup-java@v4 + - uses: actions/setup-java@v4.4.0 with: java-version: ${{ matrix.scala.java-version }} distribution: ${{ matrix.scala.java-distribution }} + cache: 'sbt' + - uses: sbt/setup-sbt@v1 + - uses: actions/setup-node@v4 with: node-version: ${{ matrix.node.version }} registry-url: 'https://registry.npmjs.org' - - name: Cache SBT - uses: actions/cache@v4.0.2 - 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 }}- - - name: Cache npm uses: actions/cache@v4.0.2 with: diff --git a/.github/workflows/release.yml b/.github/workflows/release.yml index 3992c00..b38c125 100644 --- a/.github/workflows/release.yml +++ b/.github/workflows/release.yml @@ -26,21 +26,12 @@ jobs: steps: - uses: actions/checkout@v4.1.2 - - uses: actions/setup-java@v4 + - uses: actions/setup-java@v4.4.0 with: java-version: ${{ matrix.scala.java-version }} distribution: ${{ matrix.scala.java-distribution }} - - - name: Cache SBT - uses: actions/cache@v4.0.2 - 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: "[Push] Build All for ${{ matrix.scala.name }} ${{ matrix.scala.version }} - ${{ github.run_number }}" if: github.event_name == 'push' @@ -78,21 +69,12 @@ jobs: steps: - uses: actions/checkout@v4.1.2 - - uses: actions/setup-java@v4 + - uses: actions/setup-java@v4.4.0 with: java-version: ${{ matrix.scala.java-version }} distribution: ${{ matrix.scala.java-distribution }} - - - name: Cache SBT - uses: actions/cache@v4.0.2 - 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' }} @@ -123,21 +105,12 @@ jobs: runs-on: ubuntu-latest steps: - uses: actions/checkout@v4.1.2 - - uses: actions/setup-java@v4 + - uses: actions/setup-java@v4.4.0 with: java-version: ${{ env.GH_JAVA_VERSION }} distribution: ${{ env.GH_JAVA_DISTRIBUTION }} - - - name: Cache SBT - uses: actions/cache@v4.0.2 - with: - path: | - ~/.ivy2/cache - ~/.cache/coursier - ~/.sbt - key: ${{ runner.os }}-sbt-${{ hashFiles('**/*.sbt') }}-${{ hashFiles('**/build.properties') }} - restore-keys: | - ${{ runner.os }}-sbt + cache: 'sbt' + - uses: sbt/setup-sbt@v1 - name: sbt GitHub Release env: @@ -161,22 +134,14 @@ jobs: - uses: actions/checkout@v4.1.2 with: fetch-depth: 0 - - uses: actions/setup-java@v4 + - uses: actions/setup-java@v4.4.0 with: java-version: ${{ env.GH_JAVA_VERSION }} distribution: ${{ env.GH_JAVA_DISTRIBUTION }} - - uses: olafurpg/setup-gpg@v3 + cache: 'sbt' + - uses: sbt/setup-sbt@v1 - - name: Cache SBT - uses: actions/cache@v4.0.2 - with: - path: | - ~/.ivy2/cache - ~/.cache/coursier - ~/.sbt - key: ${{ runner.os }}-sbt-${{ hashFiles('**/*.sbt') }}-${{ hashFiles('**/build.properties') }} - restore-keys: | - ${{ runner.os }}-sbt + - uses: olafurpg/setup-gpg@v3 - name: "sbt ci-release - ${{ github.run_number }}" if: startsWith(github.ref, 'refs/tags/v') @@ -212,22 +177,14 @@ jobs: - uses: actions/checkout@v4.1.2 with: fetch-depth: 0 - - uses: actions/setup-java@v4 + - uses: actions/setup-java@v4.4.0 with: java-version: ${{ env.GH_JAVA_VERSION }} distribution: ${{ env.GH_JAVA_DISTRIBUTION }} - - uses: olafurpg/setup-gpg@v3 + cache: 'sbt' + - uses: sbt/setup-sbt@v1 - - name: Cache SBT - uses: actions/cache@v4.0.2 - with: - path: | - ~/.ivy2/cache - ~/.cache/coursier - ~/.sbt - key: ${{ runner.os }}-sbt-${{ hashFiles('**/*.sbt') }}-${{ hashFiles('**/build.properties') }} - restore-keys: | - ${{ runner.os }}-sbt + - uses: olafurpg/setup-gpg@v3 - name: "sbt ci-release (no tag) - ${{ github.run_number }}" if: startsWith(github.ref, 'refs/heads/')