Skip to content

Commit

Permalink
fix github action ci not trigger on release branch (#1714)
Browse files Browse the repository at this point in the history
Change-Id: I4e8873be93197e3024deb0acf61cab4ded868a69
  • Loading branch information
javeme authored Dec 31, 2021
1 parent 8eea685 commit 8fe485d
Show file tree
Hide file tree
Showing 3 changed files with 31 additions and 10 deletions.
31 changes: 21 additions & 10 deletions .github/workflows/ci.yml
Original file line number Diff line number Diff line change
Expand Up @@ -4,19 +4,24 @@ on:
push:
branches:
- master
- /^release-.*$/
- /^test-.*$/
- 'release-*'
- 'test-*'
pull_request:
branches:
- master
- /^release-.*$/
- /^test-.*$/
- '**'

jobs:
build:
runs-on: ubuntu-20.04
env:
TRAVIS_DIR: hugegraph-dist/src/assembly/travis
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:
Expand Down Expand Up @@ -48,9 +53,10 @@ jobs:
- name: Prepare env and service
run: |
$TRAVIS_DIR/install-backend.sh ${{ matrix.BACKEND }}
$TRAVIS_DIR/install-backend.sh $BACKEND
- name: Init Mysql Env
- 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
Expand All @@ -65,9 +71,14 @@ jobs:

- name: Run test
run: |
mvn test -P core-test,${{ matrix.BACKEND }}
$TRAVIS_DIR/run-api-test.sh ${{ matrix.BACKEND }}
$TRAVIS_DIR/run-unit-test.sh ${{ matrix.BACKEND }}
$TRAVIS_DIR/run-core-test.sh $BACKEND
$TRAVIS_DIR/run-api-test.sh $BACKEND
$TRAVIS_DIR/run-unit-test.sh $BACKEND
- 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
Expand Down
7 changes: 7 additions & 0 deletions hugegraph-dist/src/assembly/travis/run-core-test.sh
Original file line number Diff line number Diff line change
@@ -0,0 +1,7 @@
#!/bin/bash

set -ev

BACKEND=$1

mvn test -P core-test,$BACKEND
3 changes: 3 additions & 0 deletions hugegraph-dist/src/assembly/travis/run-tinkerpop-test.sh
Original file line number Diff line number Diff line change
Expand Up @@ -2,6 +2,9 @@

set -ev

BACKEND=$1
SUITE=$2

if [[ "$SUITE" == "structure" || "$SUITE" == "tinkerpop" ]]; then
mvn test -P tinkerpop-structure-test,$BACKEND
fi
Expand Down

0 comments on commit 8fe485d

Please sign in to comment.