-
Notifications
You must be signed in to change notification settings - Fork 38
76 lines (64 loc) · 2.42 KB
/
build-pr.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
name: Build PR
# Builds and runs tests on each push to a branch PR'ed against main.
on:
pull_request:
paths-ignore:
- 'docs/**'
- 'design/**'
- 'planning/**'
branches:
- main
jobs:
build:
runs-on: self-hosted
steps:
- uses: actions/checkout@v3
- name: Set up Go
uses: actions/setup-go@v4
with:
go-version: 1.20.4
# Makes sure the artifacts are built correctly
- name: Build
run: go build -v ./...
# Makes sure the binaries for the eth2network are avail for all other tests
- name: Download eth2network binaries
run: go test ./... -v -count=1 -run TestEnsureBinariesAreAvail
# Close specified ports using lsof before testing / local port list compiled from ./integration/constants.go
- name: Close Integration Test Ports
run: |
killall -9 geth-v1.12.2 || true
killall -9 beacon-chain-v4.0.6 || true
killall -9 validator-v4.0.6 || true
lowest_port=8000 # Lowest starting port
highest_port=58000 # Highest port considering the offset
additional_ports=(80 81 99) # Additional specific ports
# Find processes listening on ports within the range and kill them
for pid in $(lsof -iTCP:$lowest_port-$highest_port -sTCP:LISTEN -t); do
echo "Killing process $pid on one of the ports from $lowest_port to $highest_port"
kill $pid || true
done
# Close additional specific ports
for port in "${additional_ports[@]}"; do
for pid in $(lsof -ti TCP:$port); do
echo "Killing process $pid on port $port"
kill $pid || true
done
done
- name: Test
run: go test --failfast -v ./... -count=1 -timeout 5m
- name: Store simulation logs
uses: actions/upload-artifact@v3
if: failure()
with:
name: ci-logs
path: |
integration/.build/simulations/sim-log-*.txt
integration/.build/noderunner/noderunner-*.txt
integration/.build/wallet_extension/wal-ext-*.txt
integration/.build/eth2/*
integration/.build/faucet/*
integration/.build/tenscan/*
integration/.build/tengateway/*
integration/.build/contractdeployer/*
integration/.build/smartcontracts/*
retention-days: 1