Skip to content

Commit

Permalink
Merge pull request #242 from kevin-lee/update-gh-actions
Browse files Browse the repository at this point in the history
Update GitHub Actions: Replace `olafurpg/setup-scala` with `actions/setup-java` and `sbt/setup-sbt`
  • Loading branch information
kevin-lee authored Oct 18, 2024
2 parents 849940f + 336045e commit 03105d1
Show file tree
Hide file tree
Showing 3 changed files with 33 additions and 79 deletions.
22 changes: 7 additions & 15 deletions .github/workflows/build.yml
Original file line number Diff line number Diff line change
Expand Up @@ -15,26 +15,18 @@ jobs:
strategy:
matrix:
scala:
- { name: "Scala 2", version: "2.12.18", binary-version: "2.12", java-version: "[email protected]", params: "" }
- { name: "Scala 2", version: "2.13.12", binary-version: "2.13", java-version: "[email protected]", params: "" }
- { name: "Scala 3.1", version: "3.3.1", binary-version: "3", java-version: "[email protected]", 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'
Expand Down
13 changes: 2 additions & 11 deletions .github/workflows/coverage.yml
Original file line number Diff line number Diff line change
Expand Up @@ -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' }}
Expand Down
77 changes: 24 additions & 53 deletions .github/workflows/release.yml
Original file line number Diff line number Diff line change
Expand Up @@ -8,7 +8,8 @@ on:
- '*'

env:
GH_JAVA_VERSION: "[email protected]"
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:
Expand All @@ -19,26 +20,18 @@ jobs:
strategy:
matrix:
scala:
- { name: "Scala 2", version: "2.12.18", binary-version: "2.12", java-version: "[email protected]", params: "" }
- { name: "Scala 2", version: "2.13.12", binary-version: "2.13", java-version: "[email protected]", params: "" }
- { name: "Scala 3.1", version: "3.3.1", binary-version: "3", java-version: "[email protected]", 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:
Expand All @@ -53,24 +46,16 @@ jobs:
strategy:
matrix:
scala:
- { name: "Scala 2", version: "2.13.12", binary-version: "2.13", java-version: "[email protected]" }
- { 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:
Expand All @@ -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:
Expand All @@ -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 }}
Expand Down

0 comments on commit 03105d1

Please sign in to comment.