Skip to content
Open
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
165 changes: 165 additions & 0 deletions .github/workflows/build-macos.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,165 @@
name: build-macos

on:
push:
branches: [ master ]
pull_request:
branches: [ master ]

jobs:
check_format:
runs-on: macos-latest
steps:
- uses: actions/checkout@v5
- name: Set up JDK 17
uses: actions/setup-java@v5
with:
distribution: temurin
java-version: 17
Comment on lines +13 to +18
Copy link
Contributor

Choose a reason for hiding this comment

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

🛠️ Refactor suggestion

Enable Maven cache on macOS jobs too.

Same rationale as Linux: add cache: maven to all setup-java steps.

       - name: Set up JDK 17
-        uses: actions/setup-java@v5
+        uses: actions/setup-java@v5
         with:
           distribution: temurin
           java-version: 17
+          cache: maven

Also applies to: 27-32, 43-48, 59-64, 75-80, 91-96, 107-112, 123-128, 139-144, 155-160

🤖 Prompt for AI Agents
.github/workflows/build-macos.yml around lines 13-18: the actions/setup-java@v5
step is missing the Maven cache option; add "cache: maven" under the with: block
for that step, and repeat the same change for the other setup-java occurrences
referenced (lines 27-32, 43-48, 59-64, 75-80, 91-96, 107-112, 123-128, 139-144,
155-160) so every setup-java invocation includes with: distribution: temurin,
java-version: 17 and cache: maven.

- name: Check format
run: mvn clean install -DskipTests=true -Dmaven.javadoc.skip=true -B -V
&& sh ./tools/check_format.sh

test_jraft_core:
needs: check_format
runs-on: macos-latest
steps:
- uses: actions/checkout@v5
- name: Set up JDK 17
uses: actions/setup-java@v5
with:
distribution: temurin
java-version: 17
- name: Maven Test
run: mvn clean install -DskipTests=true -Dmaven.javadoc.skip=true -B -V
&& (mvn --projects jraft-core test
|| mvn --projects jraft-core test
|| mvn --projects jraft-core test)
Comment on lines +34 to +37
Copy link
Contributor

Choose a reason for hiding this comment

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

🛠️ Refactor suggestion

Switch from chained “||” retries to a proper retry with backoff; also build only required modules.

Mirror the Linux suggestions: use a retry step and -pl/-am to avoid building the whole repo per job.

-      - name: Maven Test
-        run: mvn clean install -DskipTests=true -Dmaven.javadoc.skip=true -B -V
-          && (mvn --projects jraft-core test
-            || mvn --projects jraft-core test
-            || mvn --projects jraft-core test)
+      - name: Maven Test (targeted + retry)
+        shell: bash
+        run: |
+          for i in 1 2 3; do
+            mvn -pl jraft-core -am -Dmaven.javadoc.skip=true -B -V test && break
+            echo "Retry #$i failed; sleeping..." && sleep $((i*10))
+          done

Apply for each module section accordingly.

Also applies to: 50-53, 66-69, 82-85, 98-101, 114-117, 130-133, 146-149, 162-165


test_rheakv_core:
needs: check_format
runs-on: macos-latest
steps:
- uses: actions/checkout@v5
- name: Set up JDK 17
uses: actions/setup-java@v5
with:
distribution: temurin
java-version: 17
- name: Maven Test
run: mvn clean install -DskipTests=true -Dmaven.javadoc.skip=true -B -V
&& (mvn --projects jraft-rheakv/rheakv-core test
|| mvn --projects jraft-rheakv/rheakv-core test
|| mvn --projects jraft-rheakv/rheakv-core test)

test_rheakv_pd:
needs: check_format
runs-on: macos-latest
steps:
- uses: actions/checkout@v5
- name: Set up JDK 17
uses: actions/setup-java@v5
with:
distribution: temurin
java-version: 17
- name: Maven Test
run: mvn clean install -DskipTests=true -Dmaven.javadoc.skip=true -B -V
&& (mvn --projects jraft-rheakv/rheakv-pd test
|| mvn --projects jraft-rheakv/rheakv-pd test
|| mvn --projects jraft-rheakv/rheakv-pd test)

test_rpc_grpc_impl:
needs: check_format
runs-on: macos-latest
steps:
- uses: actions/checkout@v5
- name: Set up JDK 17
uses: actions/setup-java@v5
with:
distribution: temurin
java-version: 17
- name: Maven Test
run: mvn clean install -DskipTests=true -Dmaven.javadoc.skip=true -B -V
&& (mvn --projects jraft-extension/rpc-grpc-impl test
|| mvn --projects jraft-extension/rpc-grpc-impl test
|| mvn --projects jraft-extension/rpc-grpc-impl test)

test_leveldb_log_storage_impl:
needs: check_format
runs-on: macos-latest
steps:
- uses: actions/checkout@v5
- name: Set up JDK 17
uses: actions/setup-java@v5
with:
distribution: temurin
java-version: 17
- name: Maven Test
run: mvn clean install -DskipTests=true -Dmaven.javadoc.skip=true -B -V
&& (mvn --projects jraft-extension/leveldb-log-storage-impl test
|| mvn --projects jraft-extension/leveldb-log-storage-impl test
|| mvn --projects jraft-extension/leveldb-log-storage-impl test)

test_h2mvstore_log_storage_impl:
needs: check_format
runs-on: macos-latest
steps:
- uses: actions/checkout@v5
- name: Set up JDK 17
uses: actions/setup-java@v5
with:
distribution: temurin
java-version: 17
- name: Maven Test
run: mvn clean install -DskipTests=true -Dmaven.javadoc.skip=true -B -V
&& (mvn --projects jraft-extension/h2mvstore-log-storage-impl test
|| mvn --projects jraft-extension/h2mvstore-log-storage-impl test
|| mvn --projects jraft-extension/h2mvstore-log-storage-impl test)

test_mapdb_log_storage_impl:
needs: check_format
runs-on: macos-latest
steps:
- uses: actions/checkout@v5
- name: Set up JDK 17
uses: actions/setup-java@v5
with:
distribution: temurin
java-version: 17
- name: Maven Test
run: mvn clean install -DskipTests=true -Dmaven.javadoc.skip=true -B -V
&& (mvn --projects jraft-extension/mapdb-log-storage-impl test
|| mvn --projects jraft-extension/mapdb-log-storage-impl test
|| mvn --projects jraft-extension/mapdb-log-storage-impl test)

test_chroniclemap_log_storage_impl:
needs: check_format
runs-on: macos-latest
steps:
- uses: actions/checkout@v5
- name: Set up JDK 8
uses: actions/setup-java@v5
with:
distribution: temurin
java-version: 8
- name: Maven Test
run: mvn clean install -DskipTests=true -Dmaven.javadoc.skip=true -B -V
&& (mvn --projects jraft-extension/chronicle-map-log-storage-impl test
|| mvn --projects jraft-extension/chronicle-map-log-storage-impl test
|| mvn --projects jraft-extension/chronicle-map-log-storage-impl test)

test_bdb_log_storage_impl:
needs: check_format
runs-on: macos-latest
steps:
- uses: actions/checkout@v5
- name: Set up JDK 17
uses: actions/setup-java@v5
with:
distribution: temurin
java-version: 17
- name: Maven Test
run: mvn clean install -DskipTests=true -Dmaven.javadoc.skip=true -B -V
&& (mvn --projects jraft-extension/bdb-log-storage-impl test
|| mvn --projects jraft-extension/bdb-log-storage-impl test
|| mvn --projects jraft-extension/bdb-log-storage-impl test)
185 changes: 185 additions & 0 deletions .github/workflows/build-windows.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,185 @@
name: build-windows

on:
push:
branches: [ master ]
pull_request:
branches: [ master ]

jobs:
check_format:
runs-on: windows-latest
steps:
- uses: actions/checkout@v5
- name: Set up JDK 17
uses: actions/setup-java@v5
with:
distribution: temurin
java-version: 17
- name: Check format
shell: bash
run: |
mvn clean install -DskipTests=true -Dmaven.javadoc.skip=true -B -V
sh ./tools/check_format.sh

test_jraft_core:
needs: check_format
runs-on: windows-latest
steps:
- uses: actions/checkout@v5
- name: Set up JDK 17
uses: actions/setup-java@v5
with:
distribution: temurin
java-version: 17
- name: Maven Test
shell: bash
run: |
mvn clean install -DskipTests=true -Dmaven.javadoc.skip=true -B -V
(mvn --projects jraft-core test \
|| mvn --projects jraft-core test \
|| mvn --projects jraft-core test)

test_rheakv_core:
needs: check_format
runs-on: windows-latest
steps:
- uses: actions/checkout@v5
- name: Set up JDK 17
uses: actions/setup-java@v5
with:
distribution: temurin
java-version: 17
- name: Maven Test
shell: bash
run: |
mvn clean install -DskipTests=true -Dmaven.javadoc.skip=true -B -V
(mvn --projects jraft-rheakv/rheakv-core test \
|| mvn --projects jraft-rheakv/rheakv-core test \
|| mvn --projects jraft-rheakv/rheakv-core test)

test_rheakv_pd:
needs: check_format
runs-on: windows-latest
steps:
- uses: actions/checkout@v5
- name: Set up JDK 17
uses: actions/setup-java@v5
with:
distribution: temurin
java-version: 17
- name: Maven Test
shell: bash
run: |
mvn clean install -DskipTests=true -Dmaven.javadoc.skip=true -B -V
(mvn --projects jraft-rheakv/rheakv-pd test \
|| mvn --projects jraft-rheakv/rheakv-pd test \
|| mvn --projects jraft-rheakv/rheakv-pd test)

test_rpc_grpc_impl:
needs: check_format
runs-on: windows-latest
steps:
- uses: actions/checkout@v5
- name: Set up JDK 17
uses: actions/setup-java@v5
with:
distribution: temurin
java-version: 17
- name: Maven Test
shell: bash
run: |
mvn clean install -DskipTests=true -Dmaven.javadoc.skip=true -B -V
(mvn --projects jraft-extension/rpc-grpc-impl test \
|| mvn --projects jraft-extension/rpc-grpc-impl test \
|| mvn --projects jraft-extension/rpc-grpc-impl test)

test_leveldb_log_storage_impl:
needs: check_format
runs-on: windows-latest
steps:
- uses: actions/checkout@v5
- name: Set up JDK 17
uses: actions/setup-java@v5
with:
distribution: temurin
java-version: 17
- name: Maven Test
shell: bash
run: |
mvn clean install -DskipTests=true -Dmaven.javadoc.skip=true -B -V
(mvn --projects jraft-extension/leveldb-log-storage-impl test \
|| mvn --projects jraft-extension/leveldb-log-storage-impl test \
|| mvn --projects jraft-extension/leveldb-log-storage-impl test)

test_h2mvstore_log_storage_impl:
needs: check_format
runs-on: windows-latest
steps:
- uses: actions/checkout@v5
- name: Set up JDK 17
uses: actions/setup-java@v5
with:
distribution: temurin
java-version: 17
- name: Maven Test
shell: bash
run: |
mvn clean install -DskipTests=true -Dmaven.javadoc.skip=true -B -V
(mvn --projects jraft-extension/h2mvstore-log-storage-impl test \
|| mvn --projects jraft-extension/h2mvstore-log-storage-impl test \
|| mvn --projects jraft-extension/h2mvstore-log-storage-impl test)

test_mapdb_log_storage_impl:
needs: check_format
runs-on: windows-latest
steps:
- uses: actions/checkout@v5
- name: Set up JDK 17
uses: actions/setup-java@v5
with:
distribution: temurin
java-version: 17
- name: Maven Test
shell: bash
run: |
mvn clean install -DskipTests=true -Dmaven.javadoc.skip=true -B -V
(mvn --projects jraft-extension/mapdb-log-storage-impl test \
|| mvn --projects jraft-extension/mapdb-log-storage-impl test \
|| mvn --projects jraft-extension/mapdb-log-storage-impl test)

test_chroniclemap_log_storage_impl:
needs: check_format
runs-on: windows-latest
steps:
- uses: actions/checkout@v5
- name: Set up JDK 8
uses: actions/setup-java@v5
with:
distribution: temurin
java-version: 8
- name: Maven Test
shell: bash
run: |
mvn clean install -DskipTests=true -Dmaven.javadoc.skip=true -B -V
(mvn --projects jraft-extension/chronicle-map-log-storage-impl test \
|| mvn --projects jraft-extension/chronicle-map-log-storage-impl test \
|| mvn --projects jraft-extension/chronicle-map-log-storage-impl test)

test_bdb_log_storage_impl:
needs: check_format
runs-on: windows-latest
steps:
- uses: actions/checkout@v5
- name: Set up JDK 17
uses: actions/setup-java@v5
with:
distribution: temurin
java-version: 17
- name: Maven Test
shell: bash
run: |
mvn clean install -DskipTests=true -Dmaven.javadoc.skip=true -B -V
(mvn --projects jraft-extension/bdb-log-storage-impl test \
|| mvn --projects jraft-extension/bdb-log-storage-impl test \
|| mvn --projects jraft-extension/bdb-log-storage-impl test)
Loading
Loading