From edb3a654d0182525576f6ff06f25aab7a90a7bc7 Mon Sep 17 00:00:00 2001 From: Marcos Pereira Date: Mon, 23 Aug 2021 05:02:17 -0400 Subject: [PATCH] GH Actions: Run validatePullRequest and MiMa (#30557) * GH Actions: run validatePullRequest instead of just compiling the tests * Run MiMa checks on GH Actions instead of Travis CI * Some clear names for workflow and steps * Add cache to bin compat step * Also run MiMa for master branch and tags * Use JDK 8 to validate pull request * Move validateCompile to pull request validation Also remove `update` and `Test/compile` from binary compatibility checks: - `validateCompile` runs for all configurations, so it overrides `Test/compile` - `update` is unnecessary for mima checks --- .../workflows/binary-compatibility-checks.yml | 37 ++++++++++++++ .github/workflows/build-test-prValidation.yml | 21 ++++---- .travis.yml | 49 ------------------- 3 files changed, 46 insertions(+), 61 deletions(-) create mode 100644 .github/workflows/binary-compatibility-checks.yml delete mode 100644 .travis.yml diff --git a/.github/workflows/binary-compatibility-checks.yml b/.github/workflows/binary-compatibility-checks.yml new file mode 100644 index 0000000000..fc98ff93b1 --- /dev/null +++ b/.github/workflows/binary-compatibility-checks.yml @@ -0,0 +1,37 @@ +name: Binary Compatibility + +on: + pull_request: + push: + branches: + - master + tags: + - v2.6.* + +jobs: + check-binary-compatibility: + name: Check / Binary Compatibility + runs-on: ubuntu-20.04 + strategy: + matrix: + # The versions of scala specified here are only used as `-Dakka.build.scalaVersion=...` + # which ignores the PATCH portion of the version id. These Scala versions don't need + # to be fully defined here then since Akka build handles which patch version will be used. + scalaVersion: [ "2.12", "2.13" ] + steps: + - name: Checkout + uses: actions/checkout@v2 + 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: Set up JDK 8 + uses: olafurpg/setup-scala@v10 + with: + java-version: adopt@1.8.0 + + - name: Cache Coursier cache + uses: coursier/cache-action@v6.2 + + - name: Report MiMa Binary Issues + run: sbt -jvm-opts .jvmopts-ci -Dakka.build.scalaVersion=${{ matrix.scalaVersion }} mimaReportBinaryIssues diff --git a/.github/workflows/build-test-prValidation.yml b/.github/workflows/build-test-prValidation.yml index 1deb8da360..5bd394353d 100644 --- a/.github/workflows/build-test-prValidation.yml +++ b/.github/workflows/build-test-prValidation.yml @@ -1,4 +1,4 @@ -name: PRValidation Workflow +name: Pull Requests on: pull_request: @@ -10,7 +10,7 @@ concurrency: jobs: check-code-style: - name: Checks + name: Check / Code Style runs-on: ubuntu-20.04 steps: - name: Checkout @@ -32,8 +32,6 @@ jobs: - name: Code style check run: |- - # MiMa is disabled in GHActions because it's already covered in Travis builds (travis runs for multiple scala versions) - # FIXME move MiMa checks to GHActions sbt -jvm-opts .jvmopts-ci \ -Dakka.mima.enabled=false \ -Dakka.ci-server=true \ @@ -43,10 +41,10 @@ jobs: -Dsbt.override.build.repos=false \ -Dsbt.log.noformat=false \ -Dakka.log.timestamps=true \ - scalafmtCheckAll scalafmtSbtCheck + scalafmtCheckAll scalafmtSbtCheck headerCheckAll - Check-Publish: - name: Check publishing locally + check-publish: + name: Check / Publish Local runs-on: ubuntu-20.04 steps: - name: Checkout @@ -79,8 +77,8 @@ jobs: publishLocal publishM2 - PR-Validation: - name: PR Validation + pull-request-validation: + name: Check / Tests runs-on: ubuntu-20.04 steps: - name: Checkout @@ -97,8 +95,7 @@ jobs: - name: Cache Coursier cache uses: coursier/cache-action@v6.2 - - name: Akka validatePR - # FIXME: Change this to validatePullRequest + - name: sbt validatePullRequest run: |- sbt -jvm-opts .jvmopts-ci \ -Dakka.mima.enabled=false \ @@ -111,7 +108,7 @@ jobs: -Dakka.test.multi-node=false \ -Dsbt.log.noformat=false \ -Dakka.log.timestamps=true \ - Test/compile + validateCompile validatePullRequest ## https://github.com/akka/akka/issues/30459 ## if success diff --git a/.travis.yml b/.travis.yml deleted file mode 100644 index 57ad718a06..0000000000 --- a/.travis.yml +++ /dev/null @@ -1,49 +0,0 @@ -version: ~> 1.0 - -language: scala - -sudo: false - -## The versions of scala specified here are only used as `-Dakka.build.scalaVersion=...` -## which ignores the PATCH portion of the version id. These scala version don't need -## to align with the version used in the build. -scala: - - "2.12.11" - - "2.13.3" - -before_install: curl -Ls https://git.io/jabba | bash && . ~/.jabba/jabba.sh -install: jabba install "adopt@~1.$TRAVIS_JDK.0-0" && jabba use "$_" && java -Xmx32m -version - -addons: - apt: - packages: - - graphviz - -before_cache: - - find $HOME/.ivy2 -name "ivydata-*.properties" -print -delete - - find $HOME/.sbt -name "*.lock" -print -delete - -cache: - directories: - - $HOME/.cache/coursier - - $HOME/.ivy2/cache - - $HOME/.sbt - - $HOME/.jabba/jdk - -# script for the default 'test' stage: -script: sbt -jvm-opts .jvmopts-ci -Dakka.build.scalaVersion=$TRAVIS_SCALA_VERSION ";update ;mimaReportBinaryIssues ;test:compile ;validateCompile ;headerCheckAll" - -stages: - - name: test - if: type == pull_request OR NOT tag =~ ^v - -env: - global: - - TRAVIS_JDK=8 - -# safelist -branches: - only: - - master - - release-2.5 - - /^v\d+\.\d+(\.\d+)?(-\S*)?$/