-
Notifications
You must be signed in to change notification settings - Fork 15
168 lines (132 loc) · 4.41 KB
/
validate.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
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
124
125
126
127
128
129
130
131
132
133
134
135
136
137
138
139
140
141
142
143
144
145
146
147
148
149
150
151
152
153
154
155
156
157
158
159
160
161
162
163
164
165
166
167
168
name: Validate
# This workflow validates that the project builds and passes tests
on: [ push, pull_request ]
jobs:
build:
name: Build
runs-on: ubuntu-latest
steps:
- name: Set up Go 1.x
uses: actions/setup-go@v2
with:
go-version: ^1.18
id: go
- name: Check out code into the Go module directory
uses: actions/checkout@v2
- id: go-cache-paths
run: |
echo "::set-output name=go-build::$(go env GOCACHE)"
echo "::set-output name=go-mod::$(go env GOMODCACHE)"
- name: Go Mod Cache
uses: actions/cache@v2
with:
path: ${{ steps.go-cache-paths.outputs.go-mod }}
key: ${{ runner.os }}-go-mod-${{ hashFiles('**/go.sum') }}
- name: Build
run: go build -v ./...
- name: Test
run: go run gotest.tools/gotestsum --junitfile report.xml --format testname -- -cpu 4 ./...
- name: Artifacts
uses: actions/upload-artifact@v2
with:
name: test-report-linux
path: report.xml
cli-test:
name: CLI Integration Test
runs-on: ubuntu-latest
steps:
- name: Set up Go 1.x
uses: actions/setup-go@v2
with:
go-version: ^1.18
id: go
- name: Check out code into the Go module directory
uses: actions/checkout@v2
- id: go-cache-paths
run: |
echo "::set-output name=go-build::$(go env GOCACHE)"
echo "::set-output name=go-mod::$(go env GOMODCACHE)"
- name: Go Mod Cache
uses: actions/cache@v2
with:
path: ${{ steps.go-cache-paths.outputs.go-mod }}
key: ${{ runner.os }}-go-mod-${{ hashFiles('**/go.sum') }}
- name: Build
run: go build ./cmd/accumulated
- name: Init main
run: ./accumulated init -w .nodes -n EastXeons -r EastXeons
# - name: Init follower
# run: |
# rm -rf .nodes
# ./accumulated init follower -w .nodes -n EastXeons -l tcp://127.0.2.1:3000
# - name: Run follower
# run: ./accumulated run -w .nodes/Node0 --ci-stop-after 5s
- name: Init localhost
run: |
rm -rf .nodes
./accumulated testnet -w .nodes -v 1 -f 0 --no-empty-blocks
# - name: Run and load test localhost
# run: |
# ./accumulated run -w .nodes/Node0 &
# PID=$!
# sleep 5
# ./accumulated loadtest -r tcp://127.0.1.1:26657 --wallets 10 --transactions 10
# kill -9 $PID
build-windows:
name: Build Windows
runs-on: windows-latest
steps:
- name: Set up Go 1.x
uses: actions/setup-go@v2
with:
go-version: ^1.18
id: go
- name: Check out code into the Go module directory
uses: actions/checkout@v2
- id: go-cache-paths
run: |
echo "::set-output name=go-build::$(go env GOCACHE)"
echo "::set-output name=go-mod::$(go env GOMODCACHE)"
- name: Go Mod Cache
uses: actions/cache@v2
with:
path: ${{ steps.go-cache-paths.outputs.go-mod }}
key: ${{ runner.os }}-go-mod-${{ hashFiles('**/go.sum') }}
- name: Build
run: go build -v ./...
- name: Test
run: go run gotest.tools/gotestsum --junitfile report.xml --format testname -- -cpu 4 ./...
- name: Artifacts
uses: actions/upload-artifact@v2
with:
name: test-report-windows
path: report.xml
build-macos:
name: Build macOS
runs-on: macos-latest
steps:
- name: Set up Go 1.x
uses: actions/setup-go@v2
with:
go-version: ^1.18
id: go
- name: Check out code into the Go module directory
uses: actions/checkout@v2
- id: go-cache-paths
run: |
echo "::set-output name=go-build::$(go env GOCACHE)"
echo "::set-output name=go-mod::$(go env GOMODCACHE)"
- name: Go Mod Cache
uses: actions/cache@v2
with:
path: ${{ steps.go-cache-paths.outputs.go-mod }}
key: ${{ runner.os }}-go-mod-${{ hashFiles('**/go.sum') }}
- name: Build
run: go build -v ./...
- name: Test
run: go run gotest.tools/gotestsum --junitfile report.xml --format testname -- -cpu 4 ./...
- name: Artifacts
uses: actions/upload-artifact@v2
with:
name: test-report-macos
path: report.xml