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

on:
push:
branches: [ 'main', 'master', 'release_**' ]
pull_request:
branches: [ 'main', 'master', 'develop', 'release_**' ]
types: [ opened, synchronize, reopened ]
paths-ignore: [ '**/*.md', '.gitignore', '**/.gitignore', '.editorconfig',
'.gitattributes', 'docs/**', '.github/ISSUE_TEMPLATE/**',
'.github/PULL_REQUEST_TEMPLATE/**', '.github/CODEOWNERS' ]
workflow_dispatch:

concurrency:
group: ${{ github.workflow }}-${{ github.event.pull_request.number || github.ref }}
cancel-in-progress: true

permissions:
contents: read

jobs:
checkstyle:
name: Checkstyle
runs-on: ubuntu-22.04
timeout-minutes: 30

steps:
- name: Checkout code
uses: actions/checkout@v5

- name: Set up JDK 8
uses: actions/setup-java@v5
with:
java-version: '8'
distribution: 'temurin'

- name: Cache Gradle packages
uses: actions/cache@v5
with:
path: |
~/.gradle/caches
~/.gradle/wrapper
key: ubuntu-22.04-x86_64-jdk8-gradle-${{ hashFiles('**/*.gradle', '**/gradle-wrapper.properties') }}
restore-keys: ubuntu-22.04-x86_64-jdk8-gradle-

- name: Run checkstyle
run: ./gradlew checkstyleMain --continue --no-daemon

- name: Upload checkstyle reports
if: failure()
uses: actions/upload-artifact@v6
with:
name: checkstyle-reports
path: '*/build/reports/checkstyle/'

unit-test:
name: Unit Tests (JDK ${{ matrix.java }} / ${{ matrix.arch }})
runs-on: ${{ matrix.runner }}
timeout-minutes: 60
strategy:
fail-fast: false
matrix:
include:
- java: '8'
runner: ubuntu-22.04
arch: x86_64
- java: '17'
runner: ubuntu-24.04-arm
arch: aarch64

steps:
- name: Checkout code
uses: actions/checkout@v5

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

- name: Check Java version
run: java -version

- name: Cache Gradle packages
uses: actions/cache@v5
with:
path: |
~/.gradle/caches
~/.gradle/wrapper
key: ${{ matrix.runner }}-${{ matrix.arch }}-jdk${{ matrix.java }}-gradle-${{ hashFiles('**/*.gradle', '**/gradle-wrapper.properties') }}
restore-keys: ${{ matrix.runner }}-${{ matrix.arch }}-jdk${{ matrix.java }}-gradle-

- name: Run unit tests
# --continue: keep running remaining modules after a failure so the log
# shows every failing case in one run (failures still fail this step).
run: ./gradlew clean test --continue --no-daemon

- name: Upload test reports
if: failure()
uses: actions/upload-artifact@v6
with:
name: test-reports-jdk${{ matrix.java }}-${{ matrix.arch }}
path: |
*/build/reports/tests/test/
*/build/test-results/test/
1 change: 1 addition & 0 deletions build.gradle
Original file line number Diff line number Diff line change
Expand Up @@ -144,6 +144,7 @@ subprojects {
checkstyle {
toolVersion = "8.29"
configFile = file("../config/checkstyle/checkStyleAll.xml")
maxWarnings = 0
}
checkstyleMain {
source = 'src/main/java'
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -55,7 +55,8 @@ public ApiWrapperBuilder(String grpcEndpoint) {
*/
public ApiWrapperBuilder withTLS(File certFile) {
Preconditions.checkNotNull(certFile, "certFile is null");
Preconditions.checkArgument(certFile.exists(), "cert file does not exist: " + certFile.getAbsolutePath());
Preconditions.checkArgument(certFile.exists(),
"cert file does not exist: " + certFile.getAbsolutePath());
this.useTLS = true;
this.trustCert = certFile;
return this;
Expand Down