-
Notifications
You must be signed in to change notification settings - Fork 29
78 lines (74 loc) · 2.04 KB
/
buildci.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
---
name: build-metaprotocol
on:
workflow_dispatch:
push:
branches:
- "main"
- "master"
- "release/v*"
paths-ignore:
- "**/*.md"
- "**/*.png"
pull_request:
branches:
- "main"
- "master"
- "release/v*"
paths-ignore:
- "**/*.md"
- "**/*.png"
concurrency: ci-${{ github.ref }}
jobs:
BuildMetaProtocolBinary:
runs-on: self-hosted
timeout-minutes: 1440 # 12 hours
strategy:
fail-fast: true
matrix:
protocal: [dubbo]
name: Build MetaProtocolProxy
env:
LOG_DIR: /tmp/test_logs
LOG_PATH: /tmp/test_logs/${{ matrix.protocal }}.log
steps:
- name: Clean
run: |
sudo rm -rf /home/ubuntu/.cache/bazel
- name: Checkout
uses: actions/checkout@v4
- name: install dependency
run: |
./bazel/setup_clang.sh /home/ubuntu/clang+llvm-10.0.0-linux-gnu
- name: Build
run: |
make build
- name: setup hosts
env:
DNS_NAME_FOR_DUBBO: 127.0.0.1 org.apache.dubbo.samples.basic.api.demoservice
if: ${{ matrix.protocal == 'dubbo' }}
run: |
if [ `grep -c "$DNS_NAME_FOR_DUBBO" /etc/hosts` -eq 0 ];then
sudo echo "$DNS_NAME_FOR_DUBBO" | sudo tee -a /etc/hosts
cat /etc/hosts
fi
- name: run test
shell: bash -x -eo pipefail {0}
run: |
mkdir $LOG_DIR || true
sudo bash ${GITHUB_WORKSPACE}/test/${{ matrix.protocal }}/test.sh > $LOG_PATH 2>&1 &
echo $! > $LOG_DIR/cmd.pid
sleep 60
- name: check result
env:
EXPECT_LOG: Hello Aeraki, response from
shell: bash -x -eo pipefail {0}
run: |
grep "$EXPECT_LOG" $LOG_PATH
lines=`grep -c "$EXPECT_LOG" $LOG_PATH`
echo "find right text lines: $lines"
[ $lines -gt 0 ] && echo "assert ${{ matrix.protocal }} pass!!!"
- name: debug with ssh
if: ${{ failure() }}
uses: mxschmitt/action-tmate@v3
timeout-minutes: 20