Skip to content

Commit

Permalink
Update: GitHub Actions with new actions/setup-java with its caching s…
Browse files Browse the repository at this point in the history
…bt and use sbt/setup-sbt
  • Loading branch information
kevin-lee committed Nov 12, 2024
1 parent 2b3136f commit 6477984
Show file tree
Hide file tree
Showing 6 changed files with 34 additions and 120 deletions.
15 changes: 3 additions & 12 deletions .github/workflows/build.yml
Original file line number Diff line number Diff line change
Expand Up @@ -25,21 +25,12 @@ jobs:

steps:
- uses: actions/[email protected]
- 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/[email protected]
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'
Expand Down
15 changes: 3 additions & 12 deletions .github/workflows/checks.yml
Original file line number Diff line number Diff line change
Expand Up @@ -24,21 +24,12 @@ jobs:

steps:
- uses: actions/[email protected]
- 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/[email protected]
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'
Expand Down
15 changes: 3 additions & 12 deletions .github/workflows/coverage.yml
Original file line number Diff line number Diff line change
Expand Up @@ -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' }}
Expand Down
16 changes: 4 additions & 12 deletions .github/workflows/doc-site-build-only.yml
Original file line number Diff line number Diff line change
Expand Up @@ -22,26 +22,18 @@ jobs:

steps:
- uses: actions/[email protected]
- 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/[email protected]
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/[email protected]
with:
Expand Down
16 changes: 4 additions & 12 deletions .github/workflows/doc-site-publish.yml
Original file line number Diff line number Diff line change
Expand Up @@ -22,26 +22,18 @@ jobs:

steps:
- uses: actions/[email protected]
- 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/[email protected]
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/[email protected]
with:
Expand Down
77 changes: 17 additions & 60 deletions .github/workflows/release.yml
Original file line number Diff line number Diff line change
Expand Up @@ -26,21 +26,12 @@ jobs:

steps:
- uses: actions/[email protected]
- 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/[email protected]
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'
Expand Down Expand Up @@ -78,21 +69,12 @@ jobs:

steps:
- uses: actions/[email protected]
- 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/[email protected]
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' }}
Expand Down Expand Up @@ -123,21 +105,12 @@ jobs:
runs-on: ubuntu-latest
steps:
- uses: actions/[email protected]
- 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/[email protected]
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:
Expand All @@ -161,22 +134,14 @@ jobs:
- uses: actions/[email protected]
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/[email protected]
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')
Expand Down Expand Up @@ -212,22 +177,14 @@ jobs:
- uses: actions/[email protected]
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/[email protected]
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/')
Expand Down

0 comments on commit 6477984

Please sign in to comment.