forked from tronprotocol/java-tron
-
Notifications
You must be signed in to change notification settings - Fork 0
92 lines (79 loc) · 2.78 KB
/
system-test.yml
File metadata and controls
92 lines (79 loc) · 2.78 KB
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
name: System Test
on:
push:
branches: [ 'master', 'release_**' ]
pull_request:
branches: [ 'develop', 'release_**' ]
types: [ opened, synchronize, reopened ]
concurrency:
group: ${{ github.workflow }}-${{ github.head_ref || github.ref }}
cancel-in-progress: true
jobs:
system-test:
name: System Test (JDK 8 / x86_64)
runs-on: ubuntu-latest
timeout-minutes: 60
steps:
- name: Set up JDK 8
uses: actions/setup-java@v4
with:
java-version: '8'
distribution: 'temurin'
- name: Clone system-test
uses: actions/checkout@v4
with:
repository: tronprotocol/system-test
ref: release_workflow
path: system-test
- name: Checkout java-tron
uses: actions/checkout@v4
with:
path: java-tron
- name: Cache Gradle packages
uses: actions/cache@v4
with:
path: |
~/.gradle/caches
~/.gradle/wrapper
key: ${{ runner.os }}-gradle-system-test-${{ hashFiles('java-tron/**/*.gradle', 'java-tron/**/gradle-wrapper.properties') }}
restore-keys: ${{ runner.os }}-gradle-system-test-
- name: Build java-tron
working-directory: java-tron
run: ./gradlew clean build -x test --no-daemon
- name: Copy config and start FullNode
run: |
cp system-test/testcase/src/test/resources/config-system-test.conf java-tron/
cd java-tron
nohup java -jar build/libs/FullNode.jar --witness -c config-system-test.conf > fullnode.log 2>&1 &
echo "FullNode started, waiting for it to be ready..."
MAX_ATTEMPTS=60
INTERVAL=5
for i in $(seq 1 $MAX_ATTEMPTS); do
if curl -s --fail "http://localhost:8090/wallet/getblockbynum?num=1" > /dev/null 2>&1; then
echo "FullNode is ready! (attempt $i)"
exit 0
fi
echo "Waiting... (attempt $i/$MAX_ATTEMPTS)"
sleep $INTERVAL
done
echo "FullNode failed to start within $((MAX_ATTEMPTS * INTERVAL)) seconds."
echo "=== FullNode log (last 50 lines) ==="
tail -50 fullnode.log || true
exit 1
- name: Run system tests
working-directory: system-test
run: |
if [ ! -f solcDIR/solc-linux-0.8.6 ]; then
echo "ERROR: solc binary not found at solcDIR/solc-linux-0.8.6"
exit 1
fi
cp solcDIR/solc-linux-0.8.6 solcDIR/solc
./gradlew clean --no-daemon
./gradlew --info stest --no-daemon
- name: Upload FullNode log
if: always()
uses: actions/upload-artifact@v4
with:
name: fullnode-log
path: java-tron/fullnode.log
if-no-files-found: warn