Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

fix: night build matrix #193

Merged
merged 4 commits into from
Jun 4, 2024
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
65 changes: 35 additions & 30 deletions .github/workflows/nightly-pekko.yml
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
name: Nightly Test
name: Nightly Build and Test

on:
workflow_dispatch:
Expand All @@ -15,65 +15,61 @@ env:
PEKKO_TEST_TIMEFACTOR: 10.0
EVENT_NAME: ${{ github.event_name }}

jobs:
test:
name: Build and Test with Pekko ${{ matrix.pekko-version }}
jobs:
compile-and-test:
name: Build and Test
runs-on: ubuntu-22.04
strategy:
fail-fast: false
matrix:
include:
- { java-version: 8, scala-version: 2.12, pekko-version: '1.0.x' }
- { java-version: 8, scala-version: 2.12, pekko-version: 'main' }
- { java-version: 8, scala-version: 2.13, pekko-version: '1.0.x' }
- { java-version: 8, scala-version: 2.13, pekko-version: 'main' }
- { java-version: 8, scala-version: 3.3, pekko-version: '1.0.x' }
- { java-version: 8, scala-version: 3.3, pekko-version: 'main' }
SCALA_VERSION: [2.12, 2.13, 3]
JDK: [8]
PEKKO_VERSION: ['main', '1.0.x']
steps:
- name: Checkout
uses: actions/checkout@v4
with:
fetch-depth: 0
fetch-tags: true

- name: Checkout GitHub merge
if: github.event.pull_request
run: |-
git fetch origin pull/${{ github.event.pull_request.number }}/merge:scratch
git checkout scratch

- name: Setup Java ${{ matrix.java-version }}
- name: Set up JDK ${{ matrix.JDK }}
uses: actions/setup-java@v4
with:
distribution: temurin
java-version: ${{ matrix.java-version }}
java-version: ${{ matrix.JDK }}

- name: Cache Coursier cache
uses: coursier/cache-action@v6

- name: Run tests with Scala ${{ matrix.scala-version }} and Java ${{ matrix.java-version }} with Pekko ${{ matrix.pekko-version }}
run: sbt -Dpekko.build.pekko.version=${{ matrix.pekko-version }} "++${{ matrix.scala-version }} test"
Copy link
Member Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

A space is missing here.

- name: Cache Build Target
uses: actions/cache@v4
with:
path: project/**/target
key: build-target-${{ hashFiles('**/*.sbt', 'project/build.properties', 'project/**/*.scala') }}

- name: Compile everything
run: sbt -Dpekko.build.pekko.version=${{ matrix.PEKKO_VERSION }} "++ ${{ matrix.SCALA_VERSION }}" Test/compile

- name: Run all tests JDK ${{ matrix.JDK }}, Scala ${{ matrix.SCALA_VERSION }}, Pekko ${{ matrix.PEKKO_VERSION }}
run: sbt -Dpekko.build.pekko.version=${{ matrix.PEKKO_VERSION }} "++ ${{ matrix.SCALA_VERSION }} test"

- name: Print logs on failure
if: ${{ failure() }}
run: find . -name "*.log" -exec ./scripts/cat-log.sh {} \;

integration-test:
name: Integration tests with Pekko ${{ matrix.pekko-version }}
name: Integration tests
runs-on: ubuntu-22.04
strategy:
fail-fast: false
matrix:
PEKKO_VERSION: ['main', '1.0.x']
steps:
- name: Checkout
uses: actions/checkout@v4
with:
fetch-depth: 0
fetch-tags: true

- name: Checkout GitHub merge
if: github.event.pull_request
run: |-
git fetch origin pull/${{ github.event.pull_request.number }}/merge:scratch
git checkout scratch

- name: Setup Java 8
uses: actions/setup-java@v4
with:
Expand All @@ -83,8 +79,17 @@ jobs:
- name: Cache Coursier cache
uses: coursier/cache-action@v6

- name: Cache Build Target
uses: actions/cache@v4
with:
path: project/**/target
key: build-target-${{ hashFiles('**/*.sbt', 'project/build.properties', 'project/**/*.scala') }}

- name: Compile everything
run: sbt -Dpekko.build.pekko.version=${{ matrix.PEKKO_VERSION }} "++ ${{ matrix.SCALA_VERSION }}" tests/IntegrationTest/compile

- name: Run multi-broker and long running integration tests
run: sbt -Dpekko.build.pekko.version=${{ matrix.pekko-version }} "tests/IntegrationTest/test"
run: sbt -Dpekko.build.pekko.version=${{ matrix.PEKKO_VERSION }} "tests/IntegrationTest/test"

- name: Print logs on failure
if: ${{ failure() }}
Expand Down
2 changes: 2 additions & 0 deletions build.sbt
Original file line number Diff line number Diff line change
Expand Up @@ -15,6 +15,8 @@ sourceDistName := "apache-pekko-connectors-kafka"
sourceDistIncubating := false

ThisBuild / reproducibleBuildsCheckResolver := Resolver.ApacheMavenStagingRepo
// FIXME can we optimized it? https://github.com/apache/pekko-connectors-kafka/pull/193
ThisBuild / resolvers ++= (if (isSnapshot.value) Seq(Resolver.ApacheMavenSnapshotsRepo) else Seq())

addCommandAlias("verifyCodeStyle", "scalafmtCheckAll; scalafmtSbtCheck; +headerCheckAll; javafmtCheckAll")
addCommandAlias("applyCodeStyle", "+headerCreateAll; scalafmtAll; scalafmtSbt; javafmtAll")
Expand Down