From 0b626bebf3c7df17654295326623f328f447dd25 Mon Sep 17 00:00:00 2001 From: Enno Runne <458526+ennru@users.noreply.github.com> Date: Mon, 5 Dec 2022 12:36:33 +0100 Subject: [PATCH] ci: renovate GH workflows (#711) --- .github/workflows/checks.yml | 41 ++++++++++++++------------- .github/workflows/fossa.yml | 11 ++++--- .github/workflows/h2-test.yml | 39 ++++++++++++++++--------- .github/workflows/link-validator.yml | 13 +++++---- .github/workflows/mysql-tests.yml | 19 +++++++------ .github/workflows/oracle-tests.yml | 19 +++++++------ .github/workflows/postgres-tests.yml | 19 +++++++------ .github/workflows/release-drafter.yml | 12 ++++++-- .github/workflows/release.yml | 34 ++++++++++++---------- .github/workflows/sqlserver-tests.yml | 19 +++++++------ project/AutomaticModuleName.scala | 2 +- project/Dependencies.scala | 3 -- project/ProjectAutoPlugin.scala | 2 +- 13 files changed, 136 insertions(+), 97 deletions(-) diff --git a/.github/workflows/checks.yml b/.github/workflows/checks.yml index 1320f47d8..41a67a076 100644 --- a/.github/workflows/checks.yml +++ b/.github/workflows/checks.yml @@ -4,17 +4,20 @@ on: pull_request: push: branches: + - main - master - - migration-tool # remove before merging to master tags-ignore: [ v.* ] +permissions: + contents: read + jobs: check-code-style: name: Check Code Style runs-on: ubuntu-22.04 steps: - name: Checkout - uses: actions/checkout@v2 + uses: actions/checkout@v3.1.0 with: # we don't know what commit the last tag was it's safer to get entire repo so previousStableVersion resolves fetch-depth: 0 @@ -25,13 +28,13 @@ jobs: git fetch origin pull/${{ github.event.pull_request.number }}/merge:scratch git checkout scratch + - name: Cache Coursier cache + uses: coursier/cache-action@v6.4.0 + - name: Set up JDK 11 - uses: olafurpg/setup-scala@v10 + uses: coursier/setup-action@v1.3.0 with: - java-version: adopt@1.11.0-11 - - - name: Cache Coursier cache - uses: coursier/cache-action@v5 + jvm: temurin:1.11.0 - name: Code style check and binary-compatibility check # Run locally with: sbt 'verifyCodeStyle ; mimaReportBinaryIssues' @@ -42,7 +45,7 @@ jobs: runs-on: ubuntu-22.04 steps: - name: Checkout - uses: actions/checkout@v2 + uses: actions/checkout@v3.1.0 with: fetch-depth: 0 @@ -52,13 +55,13 @@ jobs: git fetch origin pull/${{ github.event.pull_request.number }}/merge:scratch git checkout scratch + - name: Cache Coursier cache + uses: coursier/cache-action@v6.4.0 + - name: Set up JDK 11 - uses: olafurpg/setup-scala@v10 + uses: coursier/setup-action@v1.3.0 with: - java-version: adopt@1.11.0-11 - - - name: Cache Coursier cache - uses: coursier/cache-action@v5 + jvm: temurin:1.11.0 - name: Compile all code with fatal warnings for Java 11, Scala 2.12 and Scala 2.13 # Run locally with: sbt 'clean ; +Test/compile ; +It/compile' @@ -69,7 +72,7 @@ jobs: runs-on: ubuntu-22.04 steps: - name: Checkout - uses: actions/checkout@v2 + uses: actions/checkout@v3.1.0 with: fetch-depth: 0 @@ -79,13 +82,13 @@ jobs: git fetch origin pull/${{ github.event.pull_request.number }}/merge:scratch git checkout scratch + - name: Cache Coursier cache + uses: coursier/cache-action@v6.4.0 + - name: Set up JDK 11 - uses: olafurpg/setup-scala@v10 + uses: coursier/setup-action@v1.3.0 with: - java-version: adopt@1.11.0-11 - - - name: Cache Coursier cache - uses: coursier/cache-action@v5 + jvm: temurin:1.11.0 - name: Create all API docs for artifacts/website and all reference docs run: sbt docs/paradox diff --git a/.github/workflows/fossa.yml b/.github/workflows/fossa.yml index 330eb883d..1e5284df3 100644 --- a/.github/workflows/fossa.yml +++ b/.github/workflows/fossa.yml @@ -5,6 +5,9 @@ on: schedule: - cron: '0 0 * * 0' # At 00:00 on Sunday +permissions: + contents: read + jobs: fossa: name: Fossa @@ -12,18 +15,18 @@ jobs: if: github.repository == 'akka/akka-persistence-jdbc' steps: - name: Checkout - uses: actions/checkout@v2 + uses: actions/checkout@v3.1.0 with: # we don't know what commit the last tag was it's safer to get entire repo so previousStableVersion resolves fetch-depth: 0 - name: Cache Coursier cache - uses: coursier/cache-action@v6 + uses: coursier/cache-action@v6.4.0 - name: Set up JDK 11 - uses: coursier/setup-action@v1 + uses: coursier/setup-action@v1.3.0 with: - jvm: adopt:11 + jvm: temurin:1.11.0 - name: FOSSA policy check run: |- diff --git a/.github/workflows/h2-test.yml b/.github/workflows/h2-test.yml index 0eda6924a..cd8d956b7 100644 --- a/.github/workflows/h2-test.yml +++ b/.github/workflows/h2-test.yml @@ -4,10 +4,13 @@ on: pull_request: push: branches: + - main - master - - migration-tool # remove before merging to master tags-ignore: [ v.* ] +permissions: + contents: read + jobs: test: name: Build and Test @@ -16,13 +19,21 @@ jobs: fail-fast: false matrix: include: - - { java-version: adopt@1.8, scala-version: 2.12.x, sbt-opts: '' } - - { java-version: adopt@1.8, scala-version: 2.13.x, sbt-opts: '' } - - { java-version: adopt@1.11.0-9, scala-version: 2.12.x, sbt-opts: '-J-XX:+UnlockExperimentalVMOptions -J-XX:+UseJVMCICompiler' } - - { java-version: adopt@1.11.0-9, scala-version: 2.13.x, sbt-opts: '-J-XX:+UnlockExperimentalVMOptions -J-XX:+UseJVMCICompiler' } + # leaving out some combinations (note that `checks.yml` doesn't run H2 test) + - { scalaVersion: "2.12", jdkVersion: "1.8.0", jvmName: "temurin:1.8.0", extraOpts: '' } + - { scalaVersion: "2.12", jdkVersion: "1.11.0", jvmName: "temurin:1.11.0", extraOpts: '-J-XX:+UnlockExperimentalVMOptions -J-XX:+UseJVMCICompiler' } + # { scalaVersion: "2.12", jdkVersion: "1.17.0", jvmName: "temurin:1.17.0", extraOpts: '' } + + - { scalaVersion: "2.13", jdkVersion: "1.8.0", jvmName: "temurin:1.8.0", extraOpts: '' } + # { scalaVersion: "2.13", jdkVersion: "1.11.0", jvmName: "temurin:1.11.0", extraOpts: '-J-XX:+UnlockExperimentalVMOptions -J-XX:+UseJVMCICompiler' } + - { scalaVersion: "2.13", jdkVersion: "1.17.0", jvmName: "temurin:1.17.0", extraOpts: '' } + + # { scalaVersion: "3.1", jdkVersion: "1.8.0", jvmName: "temurin:1.8.0", extraOpts: '' } + # { scalaVersion: "3.1", jdkVersion: "1.11.0", jvmName: "temurin:1.11.0", extraOpts: '-J-XX:+UnlockExperimentalVMOptions -J-XX:+UseJVMCICompiler' } + # { scalaVersion: "3.1", jdkVersion: "1.17.0", jvmName: "temurin:1.17.0", extraOpts: '' } steps: - name: Checkout - uses: actions/checkout@v2 + uses: actions/checkout@v3.1.0 with: fetch-depth: 0 @@ -32,16 +43,16 @@ jobs: git fetch origin pull/${{ github.event.pull_request.number }}/merge:scratch git checkout scratch - - name: Setup JDK ${{ matrix.java-version }} - uses: olafurpg/setup-scala@v10 - with: - java-version: ${{ matrix.java-version }} - - name: Cache Coursier cache - uses: coursier/cache-action@v5 + uses: coursier/cache-action@v6.4.0 + + - name: Set up JDK ${{ matrix.jdkVersion }} + uses: coursier/setup-action@v1.3.0 + with: + jvm: ${{ matrix.jvmName }} - - name: Run tests with Scala ${{ matrix.scala-version }} and Java ${{ matrix.java-version }} - run: sbt "++${{ matrix.scala-version }} test" ${{ matrix.sbt-opts }} + - name: Run tests with Scala ${{ matrix.scalaVersion }} on JDK ${{ matrix.jdkVersion }} + run: sbt "++ ${{ matrix.scalaVersion }} test" ${{ matrix.extraOpts }} - name: Print logs on failure if: ${{ failure() }} diff --git a/.github/workflows/link-validator.yml b/.github/workflows/link-validator.yml index 56d82ed69..310c1c3a6 100644 --- a/.github/workflows/link-validator.yml +++ b/.github/workflows/link-validator.yml @@ -6,13 +6,16 @@ on: schedule: - cron: '0 6 * * 1' +permissions: + contents: read + jobs: validate-links: runs-on: ubuntu-22.04 if: github.repository == 'akka/akka-persistence-jdbc' steps: - name: Checkout - uses: actions/checkout@v2 + uses: actions/checkout@v3.1.0 with: # See https://github.com/actions/checkout/issues/299#issuecomment-677674415 ref: ${{ github.event.pull_request.head.sha }} @@ -22,12 +25,12 @@ jobs: run: git fetch --depth=100 origin +refs/tags/*:refs/tags/* - name: Cache Coursier cache - uses: coursier/cache-action@v6 + uses: coursier/cache-action@v6.4.0 - - name: Set up JDK 11 and Coursier - uses: coursier/setup-action@v1 + - name: Set up JDK 11 + uses: coursier/setup-action@v1.3.0 with: - jvm: adopt:11 + jvm: temurin:1.11.0 apps: cs - name: sbt site diff --git a/.github/workflows/mysql-tests.yml b/.github/workflows/mysql-tests.yml index 57adacf18..b4f8e5aab 100644 --- a/.github/workflows/mysql-tests.yml +++ b/.github/workflows/mysql-tests.yml @@ -4,10 +4,13 @@ on: pull_request: push: branches: + - main - master - - migration-tool # remove before merging to master tags-ignore: [ v.* ] +permissions: + contents: read + jobs: integration-test: name: Integration Tests @@ -21,7 +24,7 @@ jobs: steps: - name: Checkout - uses: actions/checkout@v2 + uses: actions/checkout@v3.1.0 with: fetch-depth: 0 @@ -31,13 +34,13 @@ jobs: git fetch origin pull/${{ github.event.pull_request.number }}/merge:scratch git checkout scratch - - name: Set up JDK adopt@1.11.0-11 - uses: olafurpg/setup-scala@v10 - with: - java-version: adopt@1.11.0-11 - - name: Cache Coursier cache - uses: coursier/cache-action@v5 + uses: coursier/cache-action@v6.4.0 + + - name: Set up JDK 11 + uses: coursier/setup-action@v1.3.0 + with: + jvm: temurin:1.11.0 - name: Start docker run: ./scripts/launch-mysql.sh diff --git a/.github/workflows/oracle-tests.yml b/.github/workflows/oracle-tests.yml index db61b8e7c..b166cf880 100644 --- a/.github/workflows/oracle-tests.yml +++ b/.github/workflows/oracle-tests.yml @@ -4,10 +4,13 @@ on: pull_request: push: branches: + - main - master - - migration-tool # remove before merging to master tags-ignore: [ v.* ] +permissions: + contents: read + jobs: integration-test: name: Integration Tests @@ -21,7 +24,7 @@ jobs: steps: - name: Checkout - uses: actions/checkout@v2 + uses: actions/checkout@v3.1.0 with: fetch-depth: 0 @@ -31,13 +34,13 @@ jobs: git fetch origin pull/${{ github.event.pull_request.number }}/merge:scratch git checkout scratch - - name: Set up JDK adopt@1.11.0-11 - uses: olafurpg/setup-scala@v10 - with: - java-version: adopt@1.11.0-11 - - name: Cache Coursier cache - uses: coursier/cache-action@v5 + uses: coursier/cache-action@v6.4.0 + + - name: Set up JDK 11 + uses: coursier/setup-action@v1.3.0 + with: + jvm: temurin:1.11.0 - name: Start docker run: ./scripts/launch-oracle.sh diff --git a/.github/workflows/postgres-tests.yml b/.github/workflows/postgres-tests.yml index f8d7d29c0..f8327d4b8 100644 --- a/.github/workflows/postgres-tests.yml +++ b/.github/workflows/postgres-tests.yml @@ -4,10 +4,13 @@ on: pull_request: push: branches: + - main - master - - migration-tool # remove before merging to master tags-ignore: [ v.* ] +permissions: + contents: read + jobs: integration-test: name: Integration Tests @@ -21,7 +24,7 @@ jobs: steps: - name: Checkout - uses: actions/checkout@v2 + uses: actions/checkout@v3.1.0 with: fetch-depth: 0 @@ -31,13 +34,13 @@ jobs: git fetch origin pull/${{ github.event.pull_request.number }}/merge:scratch git checkout scratch - - name: Set up JDK adopt@1.11.0-11 - uses: olafurpg/setup-scala@v10 - with: - java-version: adopt@1.11.0-11 - - name: Cache Coursier cache - uses: coursier/cache-action@v5 + uses: coursier/cache-action@v6.4.0 + + - name: Set up JDK 11 + uses: coursier/setup-action@v1.3.0 + with: + jvm: temurin:1.11.0 - name: Start docker run: ./scripts/launch-postgres.sh diff --git a/.github/workflows/release-drafter.yml b/.github/workflows/release-drafter.yml index 2f7ececb1..f3bd837f7 100644 --- a/.github/workflows/release-drafter.yml +++ b/.github/workflows/release-drafter.yml @@ -7,13 +7,19 @@ on: - main - release-* +permissions: + contents: read + jobs: update_release_draft: runs-on: ubuntu-22.04 + if: github.repository == 'akka/akka-persistence-jdbc' + permissions: + contents: write steps: # Drafts your next Release notes as Pull Requests are merged - # https://github.com/raboof/release-drafter/releases - # fork of https://github.com/release-drafter/release-drafter/releases - - uses: raboof/release-drafter@v5 + # https://github.com/release-drafter/release-drafter/releases + # v5.21.1 + - uses: release-drafter/release-drafter@6df64e4ba4842c203c604c1f45246c5863410adb env: GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }} diff --git a/.github/workflows/release.yml b/.github/workflows/release.yml index 1a3311c8b..3a198a8a9 100644 --- a/.github/workflows/release.yml +++ b/.github/workflows/release.yml @@ -3,8 +3,12 @@ name: Release on: push: branches: + - main - master - tags: ["*"] + tags: ["v.*"] + +permissions: + contents: read jobs: release: @@ -17,7 +21,7 @@ jobs: runs-on: ubuntu-22.04 steps: - name: Checkout - uses: actions/checkout@v2 + uses: actions/checkout@v3.1.0 with: # we don't know what commit the last tag was it's safer to get entire repo so previousStableVersion resolves fetch-depth: 0 @@ -28,13 +32,13 @@ jobs: git fetch origin pull/${{ github.event.pull_request.number }}/merge:scratch git checkout scratch - - name: Setup Scala with JDK 8 - uses: olafurpg/setup-scala@v10 - with: - java-version: adopt@1.8.0-275 - - name: Cache Coursier cache - uses: coursier/cache-action@v5 + uses: coursier/cache-action@v6.4.0 + + - name: Set up JDK 8 + uses: coursier/setup-action@v1.3.0 + with: + jvm: temurin:1.8.0-352 - name: Publish artifacts for all Scala versions env: @@ -53,7 +57,7 @@ jobs: runs-on: ubuntu-22.04 steps: - name: Checkout - uses: actions/checkout@v2 + uses: actions/checkout@v3.1.0 with: # we don't know what commit the last tag was it's safer to get entire repo so previousStableVersion resolves fetch-depth: 0 @@ -64,14 +68,14 @@ jobs: git fetch origin pull/${{ github.event.pull_request.number }}/merge:scratch git checkout scratch - - name: Setup Scala with JDK 8 - uses: olafurpg/setup-scala@v10 + - name: Cache Coursier cache + uses: coursier/cache-action@v6.4.0 + + - name: Set up JDK 11 + uses: coursier/setup-action@v1.3.0 with: - java-version: adopt@1.11.0-9 + jvm: temurin:1.11.0 - - name: Cache Coursier cache - uses: coursier/cache-action@v5 - - name: Publish API and reference documentation env: GUSTAV_KEY: ${{ secrets.GUSTAV_KEY }} diff --git a/.github/workflows/sqlserver-tests.yml b/.github/workflows/sqlserver-tests.yml index a63c35424..9f016119a 100644 --- a/.github/workflows/sqlserver-tests.yml +++ b/.github/workflows/sqlserver-tests.yml @@ -4,10 +4,13 @@ on: pull_request: push: branches: + - main - master - - migration-tool # remove before merging to master tags-ignore: [ v.* ] +permissions: + contents: read + jobs: integration-test: name: Integration Tests @@ -21,7 +24,7 @@ jobs: steps: - name: Checkout - uses: actions/checkout@v2 + uses: actions/checkout@v3.1.0 with: fetch-depth: 0 @@ -31,13 +34,13 @@ jobs: git fetch origin pull/${{ github.event.pull_request.number }}/merge:scratch git checkout scratch - - name: Set up JDK adopt@1.11.0-11 - uses: olafurpg/setup-scala@v10 - with: - java-version: adopt@1.11.0-11 - - name: Cache Coursier cache - uses: coursier/cache-action@v5 + uses: coursier/cache-action@v6.4.0 + + - name: Set up JDK 11 + uses: coursier/setup-action@v1.3.0 + with: + jvm: temurin:1.11.0 - name: Start docker run: ./scripts/launch-sqlserver.sh diff --git a/project/AutomaticModuleName.scala b/project/AutomaticModuleName.scala index 59f894adf..1d8a56b6c 100644 --- a/project/AutomaticModuleName.scala +++ b/project/AutomaticModuleName.scala @@ -16,5 +16,5 @@ object AutomaticModuleName { private val AutomaticModuleName = "Automatic-Module-Name" def settings(name: String): Seq[Def.Setting[Task[Seq[PackageOption]]]] = - Seq(packageOptions in (Compile, packageBin) += Package.ManifestAttributes(AutomaticModuleName -> name)) + Seq(Compile / packageBin / packageOptions += Package.ManifestAttributes(AutomaticModuleName -> name)) } diff --git a/project/Dependencies.scala b/project/Dependencies.scala index c41c26f64..10b825b7f 100644 --- a/project/Dependencies.scala +++ b/project/Dependencies.scala @@ -1,9 +1,6 @@ import sbt._ object Dependencies { - val Nightly = sys.env.get("TRAVIS_EVENT_TYPE").contains("cron") - - // Keep in sync with .travis.yml val Scala212 = "2.12.17" val Scala213 = "2.13.10" val ScalaVersions = Seq(Scala213, Scala212) diff --git a/project/ProjectAutoPlugin.scala b/project/ProjectAutoPlugin.scala index b51b5c30e..98af15bc0 100644 --- a/project/ProjectAutoPlugin.scala +++ b/project/ProjectAutoPlugin.scala @@ -68,7 +68,7 @@ object ProjectAutoPlugin extends AutoPlugin { "-doc-version", version.value, "-sourcepath", - (baseDirectory in ThisBuild).value.toString, + (ThisBuild / baseDirectory).value.toString, "-skip-packages", "akka.pattern", // for some reason Scaladoc creates this "-doc-source-url", {