| # Licensed to the Apache Software Foundation (ASF) under one |
| # or more contributor license agreements. See the NOTICE file |
| # distributed with this work for additional information |
| # regarding copyright ownership. The ASF licenses this file |
| # to you under the Apache License, Version 2.0 (the |
| # "License"); you may not use this file except in compliance |
| # with the License. You may obtain a copy of the License at |
| # |
| # http://www.apache.org/licenses/LICENSE-2.0 |
| # |
| # Unless required by applicable law or agreed to in writing, |
| # software distributed under the License is distributed on an |
| # "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY |
| # KIND, either express or implied. See the License for the |
| # specific language governing permissions and limitations |
| # under the License. |
| |
| # ------------------------------------------------------------- |
| # |
| # CI Check Java Workflow |
| # |
| # This workflow runs checks for Java code. |
| # Checks include: |
| # - Java Gradle build |
| # - TODO: Add checkstyle verification, will be done after #1753 |
| # - TODO: Add findbugs |
| # - TODO: License header check |
| # - TODO: Add code coverage |
| # - TODO: Add shell check for scripts under foreign/java |
| # |
| # This workflow can be triggered manually or by other workflows. |
| # |
| name: ci-check-java-sdk |
| |
| on: |
| workflow_dispatch: |
| workflow_call: |
| |
| jobs: |
| build: |
| name: Java build |
| runs-on: ubuntu-latest |
| steps: |
| - name: Checkout Code |
| uses: actions/checkout@v4 |
| |
| - name: Setup Java |
| uses: actions/setup-java@v4 |
| with: |
| java-version: '17' |
| distribution: 'temurin' |
| |
| # Configure Gradle for optimal use in GitHub Actions, including caching of downloaded dependencies. |
| # See: https://github.com/gradle/actions/blob/main/setup-gradle/README.md |
| - name: Setup Gradle |
| uses: gradle/actions/setup-gradle@af1da67850ed9a4cedd57bfd976089dd991e2582 # v4.0.0 |
| |
| - name: Build |
| run: foreign/java/dev-support/checks/build.sh build -x test -x checkstyleMain -x checkstyleTest |
| |
| test: |
| name: Unit test |
| needs: build |
| runs-on: ubuntu-latest |
| steps: |
| - name: Checkout Code |
| uses: actions/checkout@v4 |
| |
| - name: Setup Java |
| uses: actions/setup-java@v4 |
| with: |
| java-version: '17' |
| distribution: 'temurin' |
| |
| # Configure Gradle for optimal use in GitHub Actions, including caching of downloaded dependencies. |
| # See: https://github.com/gradle/actions/blob/main/setup-gradle/README.md |
| - name: Setup Gradle |
| uses: gradle/actions/setup-gradle@af1da67850ed9a4cedd57bfd976089dd991e2582 # v4.0.0 |
| |
| - name: Run tests |
| run: foreign/java/dev-support/checks/build.sh test |