From d69eaa732ced8feaccaab97ecf4469c7d011efda Mon Sep 17 00:00:00 2001 From: Yury-Fridlyand Date: Wed, 13 Sep 2023 15:46:46 -0700 Subject: [PATCH] Add GHA. Signed-off-by: Yury-Fridlyand --- .github/workflows/java-benchmark.yml | 42 ++++++++++++++++++++ .github/workflows/java.yml | 57 ++++++++++++++++++++++++++++ 2 files changed, 99 insertions(+) create mode 100644 .github/workflows/java-benchmark.yml create mode 100644 .github/workflows/java.yml diff --git a/.github/workflows/java-benchmark.yml b/.github/workflows/java-benchmark.yml new file mode 100644 index 0000000000..910a71cc81 --- /dev/null +++ b/.github/workflows/java-benchmark.yml @@ -0,0 +1,42 @@ +name: Java client benchmarks + +on: + workflow_dispatch: + inputs: + name: + required: false + type: string + +run-name: ${{ inputs.name == '' && format('{0} @ {1}', github.ref_name, github.sha) || inputs.name }} + +jobs: + build: + strategy: + matrix: + java: + - 11 + - 17 + runs-on: ubuntu-latest + + steps: + - uses: actions/checkout@v3 + + - name: Set up JDK ${{ matrix.java }} + uses: actions/setup-java@v3 + with: + distribution: "temurin" + java-version: ${{ matrix.java }} + + # TODO: uncomment once benchmark implemented + # - name: Run benchmarks + # working-directory: java/jabushka + # run: ./gradlew -Pbenchmark :benchmark:jedis :benchmark:lettuce :benchmark:jabushka + + - name: Upload test reports + if: always() + continue-on-error: true + uses: actions/upload-artifact@v2 + with: + name: test-reports-${{ matrix.java }} + path: | + java/jabushka/benchmarks/build/** diff --git a/.github/workflows/java.yml b/.github/workflows/java.yml new file mode 100644 index 0000000000..1851d39f34 --- /dev/null +++ b/.github/workflows/java.yml @@ -0,0 +1,57 @@ +name: SQL Java CI + +on: + pull_request: + push: + paths: + - "java/**" + - ".github/workflows/java.yml" + +# Run only most latest job on a branch and cancel previous ones +concurrency: + group: ${{ github.head_ref || github.ref }} + cancel-in-progress: true + +jobs: + build: + strategy: + # Run all jobs + fail-fast: false + matrix: + java: + - 11 + - 17 + runs-on: ubuntu-latest + + steps: + - uses: actions/checkout@v3 + + - name: Set up JDK ${{ matrix.java }} + uses: actions/setup-java@v3 + with: + distribution: "temurin" + java-version: ${{ matrix.java }} + + - name: Install and run protoc (protobuf) + run: | + sudo apt update + sudo apt install protobuf-compiler + protoc -Iprotobuf=babushka-core/src/protobuf/ --java_out=java/jabushka/jabushka babushka-core/src/protobuf/*.proto + + - name: Build rust part + working-directory: java + run: cargo build + + - name: Build with Gradle + working-directory: java/jabushka + run: ./gradlew --continue build + + - name: Upload test reports + if: always() + continue-on-error: true + uses: actions/upload-artifact@v2 + with: + name: test-reports-${{ matrix.java }} + path: | + java/jabushka/jabushka/build/** + java/jabushka/integTest/build/**