Skip to content

Commit 199507f

Browse files
authoredNov 16, 2023
Run Java's CI only on branch pushes to main. (valkey-io#624)
* Align indentation for java .yml files. All other .yml files use this indentation. * Run Java's CI only on branch pushes to main. We don't need to run CI on every push to every development branch.
1 parent a93d999 commit 199507f

File tree

2 files changed

+95
-94
lines changed

2 files changed

+95
-94
lines changed
 

‎.github/workflows/java-benchmark.yml

+39-39
Original file line numberDiff line numberDiff line change
@@ -1,46 +1,46 @@
11
name: Java client benchmarks
22

33
on:
4-
workflow_dispatch:
5-
inputs:
6-
name:
7-
required: false
8-
type: string
4+
workflow_dispatch:
5+
inputs:
6+
name:
7+
required: false
8+
type: string
99

1010
run-name: ${{ inputs.name == '' && format('{0} @ {1}', github.ref_name, github.sha) || inputs.name }}
1111

1212
jobs:
13-
java-benchmark:
14-
strategy:
15-
matrix:
16-
java:
17-
- 11
18-
- 17
19-
runs-on: ubuntu-latest
20-
21-
steps:
22-
- uses: actions/checkout@v4
23-
with:
24-
submodules: recursive
25-
26-
- name: Set up JDK ${{ matrix.java }}
27-
uses: actions/setup-java@v3
28-
with:
29-
distribution: "temurin"
30-
java-version: ${{ matrix.java }}
31-
32-
- name: Start Redis
33-
run: docker run -p 6379:6379 -p 8001:8001 -d redis/redis-stack
34-
35-
- name: Run benchmarks
36-
working-directory: java
37-
run: ./gradlew :benchmark:run
38-
39-
- name: Upload test reports
40-
if: always()
41-
continue-on-error: true
42-
uses: actions/upload-artifact@v3
43-
with:
44-
name: test-reports-${{ matrix.java }}
45-
path: |
46-
java/benchmarks/build/reports/**
13+
java-benchmark:
14+
strategy:
15+
matrix:
16+
java:
17+
- 11
18+
- 17
19+
runs-on: ubuntu-latest
20+
21+
steps:
22+
- uses: actions/checkout@v4
23+
with:
24+
submodules: recursive
25+
26+
- name: Set up JDK ${{ matrix.java }}
27+
uses: actions/setup-java@v3
28+
with:
29+
distribution: "temurin"
30+
java-version: ${{ matrix.java }}
31+
32+
- name: Start Redis
33+
run: docker run -p 6379:6379 -p 8001:8001 -d redis/redis-stack
34+
35+
- name: Run benchmarks
36+
working-directory: java
37+
run: ./gradlew :benchmark:run
38+
39+
- name: Upload test reports
40+
if: always()
41+
continue-on-error: true
42+
uses: actions/upload-artifact@v3
43+
with:
44+
name: test-reports-${{ matrix.java }}
45+
path: |
46+
java/benchmarks/build/reports/**

‎.github/workflows/java.yml

+56-55
Original file line numberDiff line numberDiff line change
@@ -1,69 +1,70 @@
11
name: Java CI
22

33
on:
4-
push:
5-
paths:
6-
- babushka-core/**
7-
- submodules/**
8-
- "java/**"
9-
- ".github/workflows/java.yml"
10-
pull_request:
11-
paths:
12-
- babushka-core/**
13-
- submodules/**
14-
- "java/**"
15-
- ".github/workflows/java.yml"
4+
push:
5+
branches: ["main"]
6+
paths:
7+
- babushka-core/**
8+
- submodules/**
9+
- "java/**"
10+
- ".github/workflows/java.yml"
11+
pull_request:
12+
paths:
13+
- babushka-core/**
14+
- submodules/**
15+
- "java/**"
16+
- ".github/workflows/java.yml"
1617

1718
# Run only most latest job on a branch and cancel previous ones
1819
concurrency:
19-
group: ${{ github.head_ref || github.ref }}
20-
cancel-in-progress: true
20+
group: ${{ github.head_ref || github.ref }}
21+
cancel-in-progress: true
2122

2223
jobs:
23-
build-and-test-java-client:
24-
strategy:
25-
# Run all jobs
26-
fail-fast: false
27-
matrix:
28-
java:
29-
- 11
30-
- 17
31-
runs-on: ubuntu-latest
24+
build-and-test-java-client:
25+
strategy:
26+
# Run all jobs
27+
fail-fast: false
28+
matrix:
29+
java:
30+
- 11
31+
- 17
32+
runs-on: ubuntu-latest
3233

33-
steps:
34-
- uses: actions/checkout@v4
35-
with:
36-
submodules: recursive
34+
steps:
35+
- uses: actions/checkout@v4
36+
with:
37+
submodules: recursive
3738

38-
- name: Set up JDK ${{ matrix.java }}
39-
uses: actions/setup-java@v3
40-
with:
41-
distribution: "temurin"
42-
java-version: ${{ matrix.java }}
39+
- name: Set up JDK ${{ matrix.java }}
40+
uses: actions/setup-java@v3
41+
with:
42+
distribution: "temurin"
43+
java-version: ${{ matrix.java }}
4344

44-
- name: Install and run protoc (protobuf)
45-
run: |
46-
sudo apt update
47-
sudo apt install -y protobuf-compiler
48-
mkdir -p java/client/src/main/java/org/babushka/javababushka/generated
49-
protoc -Iprotobuf=babushka-core/src/protobuf/ --java_out=java/client/src/main/java/org/babushka/javababushka/generated babushka-core/src/protobuf/*.proto
50-
- name: Build rust part
51-
working-directory: java
52-
run: cargo build
45+
- name: Install and run protoc (protobuf)
46+
run: |
47+
sudo apt update
48+
sudo apt install -y protobuf-compiler
49+
mkdir -p java/client/src/main/java/org/babushka/javababushka/generated
50+
protoc -Iprotobuf=babushka-core/src/protobuf/ --java_out=java/client/src/main/java/org/babushka/javababushka/generated babushka-core/src/protobuf/*.proto
51+
- name: Build rust part
52+
working-directory: java
53+
run: cargo build
5354

54-
- name: Start Redis
55-
run: docker run -p 6379:6379 -p 8001:8001 -d redis/redis-stack
55+
- name: Start Redis
56+
run: docker run -p 6379:6379 -p 8001:8001 -d redis/redis-stack
5657

57-
- name: Build java part
58-
working-directory: java
59-
run: ./gradlew --continue build
58+
- name: Build java part
59+
working-directory: java
60+
run: ./gradlew --continue build
6061

61-
- name: Upload test reports
62-
if: always()
63-
continue-on-error: true
64-
uses: actions/upload-artifact@v3
65-
with:
66-
name: test-reports-${{ matrix.java }}
67-
path: |
68-
java/client/build/reports/**
69-
java/integTest/build/reports/**
62+
- name: Upload test reports
63+
if: always()
64+
continue-on-error: true
65+
uses: actions/upload-artifact@v3
66+
with:
67+
name: test-reports-${{ matrix.java }}
68+
path: |
69+
java/client/build/reports/**
70+
java/integTest/build/reports/**

0 commit comments

Comments
 (0)
Please sign in to comment.