diff --git a/.github/workflows/ci.yml b/.github/workflows/ci.yml index c57dd86415..81783b847e 100644 --- a/.github/workflows/ci.yml +++ b/.github/workflows/ci.yml @@ -30,55 +30,44 @@ jobs: JAVA_VERSION: [ '8', '11' ] steps: - - name: Install JDK ${{ matrix.JAVA_VERSION }} - 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@v4 with: fetch-depth: 2 - - name: Use staged maven repo - if: ${{ env.USE_STAGE == 'true' }} - run: | - cp $HOME/.m2/settings.xml /tmp/settings.xml - cp -vf .github/configs/settings.xml $HOME/.m2/settings.xml - - - name: Compile - run: | - mvn clean compile -U -Dmaven.javadoc.skip=true -ntp - - - name: Install JDK 8 + # TODO: Remove this step after install-backend.sh updated + - name: Install Java8 for backend uses: actions/setup-java@v3 with: java-version: '8' distribution: 'zulu' - - name: Prepare env and service + - name: Prepare backend environment run: | $TRAVIS_DIR/install-backend.sh $BACKEND - - name: Install JDK ${{ matrix.JAVA_VERSION }} + - name: Install Java ${{ matrix.JAVA_VERSION }} uses: actions/setup-java@v3 with: java-version: ${{ matrix.JAVA_VERSION }} distribution: 'zulu' - - name: use staged maven repo settings + - name: Cache Maven packages + uses: actions/cache@v3 + with: + path: ~/.m2 + key: ${{ runner.os }}-m2-${{ hashFiles('**/pom.xml') }} + restore-keys: ${{ runner.os }}-m2 + + - name: Use staged maven repo settings if: ${{ env.USE_STAGE == 'true' }} run: | cp $HOME/.m2/settings.xml /tmp/settings.xml - mv -vf .github/configs/settings.xml $HOME/.m2/settings.xml + cp -vf .github/configs/settings.xml $HOME/.m2/settings.xml && cat $HOME/.m2/settings.xml + + - name: Compile + run: | + mvn clean compile -U -Dmaven.javadoc.skip=true -ntp - name: Run unit test run: | @@ -106,4 +95,5 @@ jobs: - name: Upload coverage to Codecov uses: codecov/codecov-action@v3 with: + token: ${{ secrets.CODECOV_TOKEN }} file: ${{ env.REPORT_DIR }}/*.xml diff --git a/hugegraph-server/hugegraph-dist/src/assembly/travis/install-backend.sh b/hugegraph-server/hugegraph-dist/src/assembly/travis/install-backend.sh index 64c53a875b..21e2f11e6b 100755 --- a/hugegraph-server/hugegraph-dist/src/assembly/travis/install-backend.sh +++ b/hugegraph-server/hugegraph-dist/src/assembly/travis/install-backend.sh @@ -31,12 +31,14 @@ fi case $BACKEND in cassandra) + # TODO: replace it with docker "$TRAVIS_DIR"/install-cassandra.sh ;; scylladb) "$TRAVIS_DIR"/install-scylladb.sh ;; hbase) + # TODO: replace it with hbase2.3+ to avoid java8 env "$TRAVIS_DIR"/install-hbase.sh ;; mysql) diff --git a/hugegraph-server/hugegraph-dist/src/assembly/travis/install-cassandra.sh b/hugegraph-server/hugegraph-dist/src/assembly/travis/install-cassandra.sh index 2bdfe0bf6a..d83d890dee 100755 --- a/hugegraph-server/hugegraph-dist/src/assembly/travis/install-cassandra.sh +++ b/hugegraph-server/hugegraph-dist/src/assembly/travis/install-cassandra.sh @@ -17,7 +17,6 @@ # set -ev -TRAVIS_DIR=`dirname $0` CASS_DOWNLOAD_ADDRESS="http://archive.apache.org/dist/cassandra" CASS_VERSION="4.0.10" CASS_PACKAGE="apache-cassandra-${CASS_VERSION}" diff --git a/hugegraph-server/hugegraph-dist/src/assembly/travis/install-hbase.sh b/hugegraph-server/hugegraph-dist/src/assembly/travis/install-hbase.sh index 9de48f277e..bdee3e75ab 100755 --- a/hugegraph-server/hugegraph-dist/src/assembly/travis/install-hbase.sh +++ b/hugegraph-server/hugegraph-dist/src/assembly/travis/install-hbase.sh @@ -17,7 +17,7 @@ # set -ev -TRAVIS_DIR=`dirname $0` +TRAVIS_DIR=$(dirname $0) HBASE_DOWNLOAD_ADDRESS="http://archive.apache.org/dist/hbase" HBASE_VERSION="2.0.2" HBASE_PACKAGE="hbase-${HBASE_VERSION}"