| name: "java-client-ci" |
| |
| on: |
| workflow_dispatch: |
| push: |
| branches: |
| - master |
| - /^release-.*$/ |
| paths: |
| - hugegraph-client/** |
| - hugegraph-dist/** |
| - .github/workflows/** |
| - pom.xml |
| pull_request: |
| paths: |
| - hugegraph-client/** |
| - hugegraph-dist/** |
| - .github/workflows/** |
| - pom.xml |
| |
| jobs: |
| client-ci: |
| runs-on: ubuntu-20.04 |
| env: |
| USE_STAGE: 'true' # Whether to include the stage repository. |
| TRAVIS_DIR: hugegraph-client/assembly/travis |
| # TODO: replace it with the (latest - n) commit id (n >= 15) |
| COMMIT_ID: 6a4041e |
| strategy: |
| fail-fast: false |
| matrix: |
| JAVA_VERSION: [ '8' ] |
| steps: |
| - name: Install JDK 8 |
| uses: actions/setup-java@v3 |
| with: |
| java-version: ${{ matrix.JAVA_VERSION }} |
| distribution: 'zulu' |
| |
| - name: Cache Maven packages |
| uses: actions/cache@v3 |
| with: |
| path: ~/.m2 |
| key: ${{ runner.os }}-m2-${{ hashFiles('**/pom.xml') }} |
| restore-keys: ${{ runner.os }}-m2 |
| |
| - name: Checkout |
| uses: actions/checkout@v3 |
| with: |
| fetch-depth: 2 |
| |
| - name: Use staged maven repo |
| if: ${{ env.USE_STAGE == 'true' }} |
| run: | |
| cp $HOME/.m2/settings.xml /tmp/settings.xml |
| mv -vf .github/configs/settings.xml $HOME/.m2/settings.xml |
| |
| - name: Compile |
| run: | |
| mvn -e compile -pl hugegraph-client -Dmaven.javadoc.skip=true -ntp |
| |
| - name: Prepare env and service |
| run: | |
| $TRAVIS_DIR/install-hugegraph-from-source.sh $COMMIT_ID |
| |
| - name: Run test |
| run: | |
| cd hugegraph-client && ls * |
| mvn test -Dtest=UnitTestSuite -ntp |
| mvn test -Dtest=ApiTestSuite |
| mvn test -Dtest=FuncTestSuite |
| |
| - name: Upload coverage to Codecov |
| uses: codecov/codecov-action@v3 |
| with: |
| token: ${{ secrets.CODECOV_TOKEN }} |
| file: target/jacoco.xml |