| # 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. |
| |
| name: GraphAr Java-Info CI |
| |
| on: |
| # Trigger the workflow on push or pull request, |
| # but only for the main branch |
| push: |
| branches: |
| - main |
| paths: |
| - 'maven-projects/info/**' |
| - '.github/workflows/java-info.yml' |
| pull_request: |
| branches: |
| - main |
| paths: |
| - 'maven-projects/info/**' |
| - '.github/workflows/java-info.yml' |
| |
| concurrency: |
| group: ${{ github.repository }}-${{ github.event.number || github.head_ref || github.sha }}-${{ github.workflow }} |
| cancel-in-progress: true |
| |
| jobs: |
| test: |
| runs-on: ubuntu-latest |
| env: |
| GAR_TEST_DATA: ${{ github.workspace }}/graphar-testing/ |
| steps: |
| - uses: actions/checkout@v4 |
| with: |
| submodules: true |
| |
| - name: Install dependencies |
| run: | |
| git clone https://github.com/apache/incubator-graphar-testing.git $GAR_TEST_DATA --depth 1 |
| |
| - name: Code Format Check |
| working-directory: maven-projects/info |
| run: | |
| export JAVA_HOME=${JAVA_HOME_11_X64} |
| mvn --no-transfer-progress spotless:check |
| |
| - name: Build Java Docs |
| working-directory: maven-projects/info |
| run: | |
| export JAVA_HOME=${JAVA_HOME_11_X64} |
| mvn --no-transfer-progress javadoc:javadoc |
| |
| - name: Run test |
| working-directory: maven-projects/info |
| run: | |
| export JAVA_HOME=${JAVA_HOME_11_X64} |
| mvn --no-transfer-progress clean test -Dspotless.check.skip=true |
| |
| - name: Generate JaCoCo Coverage Report |
| working-directory: maven-projects/info |
| run: | |
| export JAVA_HOME=${JAVA_HOME_11_X64} |
| mvn jacoco:report --no-transfer-progress |
| |
| - name: Upload coverage to Codecov |
| uses: codecov/codecov-action@v4 |
| with: |
| flags: java-info |
| files: "./maven-projects/info/target/site/jacoco/jacoco.xml" |
| token: ${{ secrets.CODECOV_TOKEN }} |