-
Notifications
You must be signed in to change notification settings - Fork 14
123 lines (103 loc) · 3.68 KB
/
ci.yml
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
# This is a basic workflow to help you get started with Actions
name: CI
# Controls when the workflow will run
on:
pull_request:
types: [ opened, synchronize, reopened ]
branches: main
workflow_dispatch:
# A workflow run is made up of one or more jobs that can run sequentially or in parallel
jobs:
# This workflow contains a single job called "build"
case-format-check:
# The type of runner that the job will run on
runs-on: ubuntu-latest
# Steps represent a sequence of tasks that will be executed as part of the job
steps:
# Checks-out your repository under $GITHUB_WORKSPACE, so your job can access it
- uses: actions/checkout@v3
- name: Set up JDK 8 for x64
if: ${{ env.Job-Status }} == 2
uses: actions/setup-java@v3
with:
java-version: '8'
distribution: 'adopt'
architecture: x64
- name: Start case format check
id: case_format_check
run: |
cd $GITHUB_WORKSPACE
./run.sh -c 2>&1 | tee result.log
if [ "$(cat ./result.log | grep -i -E 'WARN|ERROR' | grep -v "grep" | wc -l)" -gt 0 ]; then echo 'case format check failed.'; exit 1; fi
- uses: actions/upload-artifact@v2
if: ${{ always() }}
continue-on-error: true
with:
name: log
path: |
${{ github.workspace }}
retention-days: 7
dist-bvt-linux-x86:
runs-on: ubuntu-latest
name: BVT Test on Ubuntu/x64
timeout-minutes: 30
steps:
- name: checkout head
uses: actions/checkout@v2
with:
repository: matrixorigin/matrixone
path: ./head
ref: main
- name: Set up Go
uses: ./head/.github/actions/setup_env
- name: Build MatrixOne
run: |
cd $GITHUB_WORKSPACE/head && make clean && make build
git rev-parse --short HEAD
echo "base sha: ${{ github.event.pull_request.base.sha }}"
echo "head sha: ${{ github.event.pull_request.head.sha }}"
- name: Start MO
run: |
cd $GITHUB_WORKSPACE/head
./optools/run_bvt.sh $GITHUB_WORKSPACE/head launch-tae-CN-tae-DN
- name: Clone test-tool repository
uses: actions/checkout@v2
with:
fetch-depth: '3'
path: ./mo-tester
- name: Set up JDK 8 for x64
uses: actions/setup-java@v3
with:
java-version: '8'
distribution: 'adopt'
architecture: x64
- name: Start BVT Test
id: bvt_on_pr_version
run: |
timedatectl status
sudo timedatectl set-timezone "Asia/Shanghai"
timedatectl status
sleep 60s
cd $GITHUB_WORKSPACE/mo-tester
./run.sh -n -g -p $GITHUB_WORKSPACE/head/test/distributed/cases 2>&1
- name: Check MO-Server Status
if: ${{ always() }}
run: |
if [ "$(ps -ef | grep 'mo-service' | grep -v "grep" | wc -l)" -gt 0 ]; then pkill -9 mo-service; else echo 'current mo-service has already crashed'; exit 1; fi
- name: remove some files
if: ${{ always() }}
continue-on-error: true
run: |
cd $GITHUB_WORKSPACE
if [ -d "./head/mo-server" ]; then rm -rf ./head/mo-server; fi
if [ -d "./base/" ]; then rm -rf ./base/; fi
rm -rf ./mo-tester/.git
rm -rf ./mo-tester/lib
- uses: actions/upload-artifact@v2
if: ${{ always() }}
continue-on-error: true
with:
name: linux_x86_ci_reports
path: |
${{ github.workspace }}
retention-days: 7