forked from axonweb3/axon
-
Notifications
You must be signed in to change notification settings - Fork 0
73 lines (71 loc) · 2.57 KB
/
somking_test.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
name: Somking test suit
on:
workflow_dispatch:
inputs:
axon_linux_release_tag:
description: 'Linux release tag to download && run somking test'
required: true
jobs:
Smoking-test:
runs-on: ubuntu-20.04
steps:
- uses: actions/checkout@v3
- name: Download&Unzip
run: |
tag="${{ github.event.inputs.axon_linux_release_tag }}"
package_name="axon_"$tag"_x86_64-unknown-linux-gnu.tar.gz"
curl -L https://github.com/${{ GITHUB.REPOSITORY }}/releases/download/$tag/$package_name -o $package_name
tar -zxf $package_name
rm -rf $package_name
mv axon_* axon
- name: Start axon
run: |
cd ${{ github.workspace }}/axon
./axon --config ${{ github.workspace }}/axon/config.toml --genesis ${{ github.workspace }}/axon/genesis_single_node.json > /tmp/log 2>&1 &
sleep 120
- name: Check Axon Status
run: |
first_block_json=$(echo '{
"id": 1,
"jsonrpc": "2.0",
"method": "eth_blockNumber",
"params": [
]
}' \
| tr -d '\n' \
| curl -H 'content-type: application/json' -d @- \
http://127.0.0.1:8000)
FIST_BLOCK_NUMBER=$(echo $first_block_json | jq --raw-output '.result')
FIST_BLOCK_NUMBER=$(printf %d $TIP_BLOCK_NUMBER)
echo $FIST_BLOCK_NUMBER
sleep 300
second_block_json=$(echo '{
"id": 1,
"jsonrpc": "2.0",
"method": "eth_blockNumber",
"params": [
]
}' \
| tr -d '\n' \
| curl -H 'content-type: application/json' -d @- \
http://127.0.0.1:8000)
SECOND_TIP_BLOCK_NUMBER=$(echo $second_block_json | jq --raw-output '.result')
SECOND_TIP_BLOCK_NUMBER=$(printf %d $SECOND_TIP_BLOCK_NUMBER)
echo $SECOND_TIP_BLOCK_NUMBER
if [ $FIST_BLOCK_NUMBER == $SECOND_TIP_BLOCK_NUMBER ]; then
echo "Tip block number No update in 5mins"
exit 1
fi
- name: Send some mail
if: failure()
uses: dawidd6/action-send-mail@v3
with:
server_address: smtp.163.com
server_port: 465
secure: true
username: ${{secrets.MAIL_USERNAME}}
password: ${{secrets.MAIL_PASSWORD}}
subject: Smoking test failed on release ${{ github.event.inputs.axon_linux_release_tag }}
body: Smoking test failed on release ${{ github.event.inputs.axon_linux_release_tag }},please have a check!
to: ${{secrets.MAIL_ADDRS}}
from: github_action