| name: hugegraph-hubble-ci |
| |
| on: |
| push: |
| branches: |
| - master |
| - /^release-.*$/ |
| - /^test-.*$/ |
| - /^v[0-9]\..*$/ |
| paths: |
| - hugegraph-hubble/** |
| - hugegraph-dist/** |
| - .github/workflows/** |
| - pom.xml |
| pull_request: |
| branches: |
| - master |
| - /^release-.*$/ |
| - /^test-.*$/ |
| - /^v[0-9]\..*$/ |
| paths: |
| - hugegraph-hubble/** |
| - hugegraph-dist/** |
| - .github/workflows/** |
| - pom.xml |
| |
| env: |
| TRAVIS_DIR: hugegraph-hubble/hubble-dist/assembly/travis |
| SERVER_VERSION: 0.12.0 |
| |
| jobs: |
| hubble-ci: |
| runs-on: ubuntu-20.04 |
| steps: |
| - name: Install JDK 8 |
| uses: actions/setup-java@v3 |
| with: |
| java-version: '8' |
| distribution: 'adopt' |
| |
| # we also should cache python & yarn & downloads to avoid useless work |
| - name: Cache Maven packages |
| uses: actions/cache@v3 |
| with: |
| path: ~/.m2/repository |
| key: ${{ runner.os }}-maven-${{ hashFiles('**/pom.xml') }} |
| restore-keys: | |
| ${{ runner.os }}-maven- |
| |
| - name: Get Yarn path |
| id: yarn-cache-dir-path |
| run: echo "::set-output name=dir::$(yarn cache dir)" |
| |
| - name: Ceche Yarn packages |
| uses: actions/cache@v3 |
| # use id to check `cache-hit` (`steps.yarn-cache.outputs.cache-hit != 'true'`) |
| id: yarn-cache |
| with: |
| path: ${{ steps.yarn-cache-dir-path.outputs.dir }} |
| key: ${{ runner.os }}-yarn-${{ hashFiles('**/yarn.lock') }} |
| restore-keys: | |
| ${{ runner.os }}-yarn- |
| |
| - name: Ceche Python packages |
| uses: actions/cache@v3 |
| with: |
| path: ~/.cache/pip |
| key: ${{ runner.os }}-pip-${{ hashFiles('**/requirements.txt') }} |
| restore-keys: | |
| ${{ runner.os }}-pip- |
| |
| - name: Checkout |
| uses: actions/checkout@v3 |
| with: |
| fetch-depth: 2 |
| |
| - name: Compile |
| run: | |
| cd hugegraph-hubble && ls * |
| mvn -e clean compile -Dmaven.javadoc.skip=true | grep -v "Downloading\|Downloaded" |
| |
| - name: Prepare env and service |
| run: | |
| sudo pip install -r ${TRAVIS_DIR}/requirements.txt |
| $TRAVIS_DIR/install-hugegraph.sh $SERVER_VERSION |
| |
| - name: Unit test |
| run: cd hugegraph-hubble && mvn test -P unit-test |
| |
| - name: API test |
| env: |
| CI: false |
| run: | |
| cd hugegraph-hubble && ls |
| hubble-dist/assembly/travis/run-api-test.sh |
| |
| - name: Upload coverage to Codecov |
| uses: codecov/codecov-action@v3.0.0 |
| with: |
| file: target/site/jacoco/*.xml |