blob: c1ed82f18ec01f4cc5c35dacb253be7a6b58f4b2 [file] [log] [blame]
name: hugegraph ci
on:
push:
branches:
- master
- 'release-*'
- 'test-*'
pull_request:
branches:
- '**'
jobs:
build:
runs-on: ubuntu-20.04
env:
TRAVIS_DIR: hugegraph-dist/src/assembly/travis
REPORT_DIR: target/site/jacoco
BACKEND: ${{ matrix.BACKEND }}
TRIGGER_BRANCH_NAME: ${{ github.ref_name }}
HEAD_BRANCH_NAME: ${{ github.head_ref }}
BASE_BRANCH_NAME: ${{ github.base_ref }}
TARGET_BRANCH_NAME: ${{ github.base_ref != '' && github.base_ref || github.ref_name }}
RELEASE_BRANCH: ${{ startsWith(github.ref_name, 'release-') || startsWith(github.ref_name, 'test-') || startsWith(github.base_ref, 'release-') }}
strategy:
fail-fast: false
matrix:
BACKEND: [memory, cassandra, scylladb, hbase, rocksdb, mysql, postgresql]
JAVA_VERSION: ['8']
steps:
- name: Install JDK ${{ matrix.JAVA_VERSION }}
uses: actions/setup-java@v2
with:
java-version: ${{ matrix.JAVA_VERSION }}
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 compile -Dmaven.javadoc.skip=true | grep -v "Downloading\|Downloaded"
- name: Prepare env and service
run: |
$TRAVIS_DIR/install-backend.sh $BACKEND
- name: Init MySQL Env
if: ${{ env.BACKEND == 'mysql' }}
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: 'test' # Optional, default value is "test". The specified database which will be create
mysql root password: "******" # 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: Run test
run: |
$TRAVIS_DIR/run-core-test.sh $BACKEND
$TRAVIS_DIR/run-api-test.sh $BACKEND $REPORT_DIR
$TRAVIS_DIR/run-unit-test.sh $BACKEND
- name: Run Raft test
if: ${{ env.BACKEND == 'rocksdb' }}
run: |
$TRAVIS_DIR/run-api-test-for-raft.sh $BACKEND $REPORT_DIR
- name: Run TinkerPop test
if: ${{ env.RELEASE_BRANCH == 'true' }}
run: |
$TRAVIS_DIR/run-tinkerpop-test.sh $BACKEND tinkerpop
- name: Upload coverage to Codecov
uses: codecov/codecov-action@v1
with:
file: ${{ env.REPORT_DIR }}/*.xml