@@ -12,23 +12,41 @@ jobs:
12
12
build :
13
13
runs-on : ubuntu-20.04
14
14
env :
15
- TRAVIS_DIR : hugegraph-dist/src/assembly/travis
15
+ USE_STAGE : ' false' # Whether to include the stage repository.
16
+ TRAVIS_DIR : hugegraph-server/hugegraph-dist/src/assembly/travis
16
17
REPORT_DIR : target/site/jacoco
17
18
BACKEND : ${{ matrix.BACKEND }}
18
19
TRIGGER_BRANCH_NAME : ${{ github.ref_name }}
19
20
HEAD_BRANCH_NAME : ${{ github.head_ref }}
20
21
BASE_BRANCH_NAME : ${{ github.base_ref }}
21
22
TARGET_BRANCH_NAME : ${{ github.base_ref != '' && github.base_ref || github.ref_name }}
22
- RELEASE_BRANCH : ${{ startsWith(github.ref_name, 'release-') || startsWith(github.ref_name, 'test-') || startsWith(github.base_ref, 'release-') }}
23
+ RELEASE_BRANCH : ${{ startsWith(github.ref_name, 'release-') || startsWith(github.ref_name, 'test-') }}
24
+ RAFT_MODE : ${{ startsWith(github.head_ref, 'test') || startsWith(github.head_ref, 'raft') }}
23
25
24
26
strategy :
25
27
fail-fast : false
26
28
matrix :
27
- BACKEND : [ memory, cassandra, scylladb, hbase, rocksdb , mysql, postgresql ]
29
+ BACKEND : [ memory, rocksdb, hbase, cassandra , mysql, postgresql, scylladb ]
28
30
JAVA_VERSION : [ '8', '11' ]
29
31
30
32
steps :
31
- - name : Install JDK ${{ matrix.JAVA_VERSION }}
33
+ - name : Checkout
34
+ uses : actions/checkout@v4
35
+ with :
36
+ fetch-depth : 2
37
+
38
+ # TODO: Remove this step after install-backend.sh updated
39
+ - name : Install Java8 for backend
40
+ uses : actions/setup-java@v3
41
+ with :
42
+ java-version : ' 8'
43
+ distribution : ' zulu'
44
+
45
+ - name : Prepare backend environment
46
+ run : |
47
+ $TRAVIS_DIR/install-backend.sh $BACKEND && jps -l
48
+
49
+ - name : Install Java ${{ matrix.JAVA_VERSION }}
32
50
uses : actions/setup-java@v3
33
51
with :
34
52
java-version : ${{ matrix.JAVA_VERSION }}
@@ -41,30 +59,16 @@ jobs:
41
59
key : ${{ runner.os }}-m2-${{ hashFiles('**/pom.xml') }}
42
60
restore-keys : ${{ runner.os }}-m2
43
61
44
- - name : Checkout
45
- uses : actions/checkout@v3
46
- with :
47
- fetch-depth : 2
62
+ - name : Use staged maven repo settings
63
+ if : ${{ env.USE_STAGE == 'true' }}
64
+ run : |
65
+ cp $HOME/.m2/settings.xml /tmp/settings.xml
66
+ cp -vf .github/configs/settings.xml $HOME/.m2/settings.xml && cat $HOME/.m2/settings.xml
48
67
49
68
- name : Compile
50
69
run : |
51
70
mvn clean compile -U -Dmaven.javadoc.skip=true -ntp
52
71
53
- - name : Install JDK 8
54
- uses : actions/setup-java@v3
55
- with :
56
- java-version : ' 8'
57
- distribution : ' zulu'
58
- - name : Prepare env and service
59
- run : |
60
- $TRAVIS_DIR/install-backend.sh $BACKEND
61
-
62
- - name : Install JDK ${{ matrix.JAVA_VERSION }}
63
- uses : actions/setup-java@v3
64
- with :
65
- java-version : ${{ matrix.JAVA_VERSION }}
66
- distribution : ' zulu'
67
-
68
72
- name : Run unit test
69
73
run : |
70
74
$TRAVIS_DIR/run-unit-test.sh $BACKEND
77
81
run : |
78
82
$TRAVIS_DIR/run-api-test.sh $BACKEND $REPORT_DIR
79
83
84
+ # TODO: disable raft test in normal PR due to the always timeout problem
80
85
- name : Run raft test
81
- if : ${{ env.BACKEND == 'rocksdb' }}
86
+ if : ${{ env.RAFT_MODE == 'true' && env. BACKEND == 'rocksdb' }}
82
87
run : |
83
88
$TRAVIS_DIR/run-api-test-for-raft.sh $BACKEND $REPORT_DIR
84
89
88
93
$TRAVIS_DIR/run-tinkerpop-test.sh $BACKEND tinkerpop
89
94
90
95
- name : Upload coverage to Codecov
91
- uses : codecov/codecov-action@v3.0.0
96
+ uses : codecov/codecov-action@v3
92
97
with :
98
+ token : ${{ secrets.CODECOV_TOKEN }}
93
99
file : ${{ env.REPORT_DIR }}/*.xml
0 commit comments