Skip to content

Commit 7eacfea

Browse files
committed
add timeout for system-test; add master for push; trigger PR lint if event is edited
1 parent e560afe commit 7eacfea

2 files changed

Lines changed: 26 additions & 5 deletions

File tree

.github/workflows/pr-check.yml

Lines changed: 6 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,9 +1,11 @@
11
name: PR Check
22

33
on:
4+
push:
5+
branches: [ 'master', 'release_**' ]
46
pull_request:
57
branches: [ 'develop', 'release_**' ]
6-
types: [ opened, synchronize, reopened ]
8+
types: [ opened, edited, synchronize, reopened ]
79

810
concurrency:
911
group: ${{ github.workflow }}-${{ github.head_ref || github.ref }}
@@ -129,6 +131,7 @@ jobs:
129131
130132
build:
131133
name: Build ${{ matrix.os-name }}(JDK ${{ matrix.java }} / ${{ matrix.arch }})
134+
if: github.event.action != 'edited'
132135
needs: [pr-lint, checkstyle]
133136
runs-on: ${{ matrix.runner }}
134137
strategy:
@@ -175,6 +178,7 @@ jobs:
175178

176179
docker-build-rockylinux:
177180
name: Build rockylinux (JDK 8 / x86_64)
181+
if: github.event.action != 'edited'
178182
needs: [pr-lint, checkstyle]
179183
runs-on: ubuntu-latest
180184

@@ -241,6 +245,7 @@ jobs:
241245

242246
docker-build-debian11:
243247
name: Build debian11 (JDK 8 / x86_64)
248+
if: github.event.action != 'edited'
244249
needs: [pr-lint, checkstyle]
245250
runs-on: ubuntu-latest
246251

.github/workflows/system-test.yml

Lines changed: 20 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,8 @@
11
name: System Test
22

33
on:
4+
push:
5+
branches: [ 'master', 'release_**' ]
46
pull_request:
57
branches: [ 'develop', 'release_**' ]
68
types: [ opened, synchronize, reopened ]
@@ -13,6 +15,7 @@ jobs:
1315
system-test:
1416
name: System Test (JDK 8 / x86_64)
1517
runs-on: ubuntu-latest
18+
timeout-minutes: 60
1619

1720
steps:
1821
- name: Set up JDK 8
@@ -50,10 +53,23 @@ jobs:
5053
cp system-test/testcase/src/test/resources/config-system-test.conf java-tron/
5154
cd java-tron
5255
nohup java -jar build/libs/FullNode.jar --witness -c config-system-test.conf > fullnode.log 2>&1 &
53-
echo "FullNode started, waiting 30 seconds..."
54-
sleep 30
55-
echo "=== FullNode log (last 30 lines) ==="
56-
tail -30 fullnode.log || true
56+
echo "FullNode started, waiting for it to be ready..."
57+
58+
MAX_ATTEMPTS=60
59+
INTERVAL=5
60+
for i in $(seq 1 $MAX_ATTEMPTS); do
61+
if curl -s --fail "http://localhost:9090/wallet/getblockbynum?num=1" > /dev/null 2>&1; then
62+
echo "FullNode is ready! (attempt $i)"
63+
exit 0
64+
fi
65+
echo "Waiting... (attempt $i/$MAX_ATTEMPTS)"
66+
sleep $INTERVAL
67+
done
68+
69+
echo "FullNode failed to start within $((MAX_ATTEMPTS * INTERVAL)) seconds."
70+
echo "=== FullNode log (last 50 lines) ==="
71+
tail -50 fullnode.log || true
72+
exit 1
5773
5874
- name: Run system tests
5975
working-directory: system-test

0 commit comments

Comments
 (0)