| # TODO: refactor it later |
| name: hugegraph-toolchain ci |
| |
| on: |
| push: |
| branches: |
| - master |
| - /^release-.*$/ |
| - /^test-.*$/ |
| pull_request: |
| branches: |
| - master |
| - /^release-.*$/ |
| - /^test-.*$/ |
| |
| jobs: |
| build: |
| runs-on: ubuntu-20.04 |
| env: |
| TRAVIS_DIR: assembly/travis |
| STATIC_DIR: assembly/static |
| COMMIT_ID: 1d031c5905cbef008dd5fb468576b0e6a9445181 |
| DB_USER: root |
| DB_PASS: root |
| DB_DATABASE: load_test |
| steps: |
| - name: Install JDK 8 |
| uses: actions/setup-java@v2 |
| with: |
| java-version: '8' |
| distribution: 'zulu' |
| |
| - name: Cache Maven packages |
| uses: actions/cache@v2 |
| with: |
| path: ~/.m2 |
| key: ${{ runner.os }}-m2-${{ hashFiles('**/pom.xml') }} |
| restore-keys: ${{ runner.os }}-m2 |
| |
| - name: Checkout |
| uses: actions/checkout@v2 |
| with: |
| fetch-depth: 2 |
| |
| - name: Compile |
| run: | |
| mvn install:install-file -Dfile=$STATIC_DIR/lib/ojdbc8-12.2.0.1.jar -DgroupId=com.oracle -DartifactId=ojdbc8 -Dversion=12.2.0.1 -Dpackaging=jar |
| mvn compile -Dmaven.javadoc.skip=true | grep -v "Downloading\|Downloaded" |
| |
| - name: Init Mysql Env |
| uses: mirromutth/mysql-action@v1.1 |
| with: |
| host port: 3306 # Optional, default value is 3306. The port of host |
| container port: 3306 # Optional, default value is 3306. The port of container |
| character set server: 'utf8mb4' # Optional, default value is 'utf8mb4'. The '--character-set-server' option for mysqld |
| collation server: 'utf8mb4_general_ci' # Optional, default value is 'utf8mb4_general_ci'. The '--collation-server' option for mysqld |
| mysql version: '5.7' # Optional, default value is "latest". The version of the MySQL |
| mysql database: ${{ env.DB_DATABASE }} # Optional, default value is "test". The specified database which will be create |
| mysql root password: ${{ env.DB_PASS }} # Required if "mysql user" is empty, default is empty. The root superuser password |
| #mysql user: 'root' # Required if "mysql root password" is empty, default is empty. The superuser for the specified database. Can use secrets, too |
| #mysql password: ${{ secrets.DatabasePassword }} # Required if "mysql user" exists. The password for the "mysql user" |
| |
| - name: Prepare env and service |
| run: | |
| $TRAVIS_DIR/install-hadoop.sh |
| $TRAVIS_DIR/install-hugegraph-from-source.sh $COMMIT_ID |
| |
| - name: Run test |
| run: | |
| mvn test -P unit |
| mvn test -P file |
| mvn test -P hdfs |
| mvn test -P jdbc |
| |
| - name: Upload coverage to Codecov |
| uses: codecov/codecov-action@v1 |
| with: |
| file: target/jacoco.xml |