-
Notifications
You must be signed in to change notification settings - Fork 6
245 lines (242 loc) · 9.74 KB
/
cpp_full_node_workflow.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
169
170
171
172
173
174
175
176
177
178
179
180
181
182
183
184
185
186
187
188
189
190
191
192
193
194
195
196
197
198
199
200
201
202
203
204
205
206
207
208
209
210
211
212
213
214
215
216
217
218
219
220
221
222
223
224
225
226
227
228
229
230
231
232
233
234
235
236
237
238
239
240
241
242
243
244
245
name: WeDPR-Component ci for full node
on:
push:
paths-ignore:
- "docs/**"
- "python/**"
- "cpp/wedpr-transport/sdk-wrapper/python/bindings/**"
- "Changelog.md"
- "README.md"
pull_request:
paths-ignore:
- "docs/**"
- "python/**"
- "Changelog.md"
- "README.md"
release:
types: [published, push]
concurrency:
group: ${{ github.workflow }}-${{ github.event.pull_request.number || github.ref }}
cancel-in-progress: true
env:
RUST_BACKTRACE: 1
ACTIONS_ALLOW_USE_UNSECURE_NODE_VERSION: true
ACTIONS_RUNNER_FORCED_INTERNAL_NODE_VERSION: node16
ACTIONS_RUNNER_FORCE_ACTIONS_NODE_VERSION: node16
jobs:
build:
name: build all
runs-on: ${{ matrix.os }}
continue-on-error: true
strategy:
fail-fast: false
matrix:
os: [macos-13, ubuntu-20.04]
steps:
- uses: actions/checkout@v2
with:
fetch-depth: 5
- uses: actions-rs/toolchain@v1
with:
toolchain: nightly-2022-07-28
override: true
- name: Prepare vcpkg
if: runner.os != 'Windows'
uses: friendlyanon/setup-vcpkg@v1
with: { committish: 51b14cd4e1230dd51c11ffeff6f7d53c61cc5297 }
- uses: actions/cache@v2
id: deps_cache
with:
path: |
deps/
c:/vcpkg
!c:/vcpkg/.git
!c:/vcpkg/buildtrees
!c:/vcpkg/packages
!c:/vcpkg/downloads
key: build-all-${{ matrix.os }}-${{ github.base_ref }}-${{ hashFiles('.github/workflows/cpp_full_node_workflow.yml') }}
restore-keys: |
build-all-${{ matrix.os }}-${{ github.base_ref }}-${{ hashFiles('.github/workflows/cpp_full_node_workflow.yml') }}
build-all-${{ matrix.os }}-${{ github.base_ref }}-
build-all-${{ matrix.os }}-
- name: Build for linux
if: runner.os == 'Linux'
run: |
sudo apt install -y lcov ccache wget libgmp-dev python3-dev
export GCC='gcc-10'
export CXX='g++-10'
sudo bash -x cpp/tools/install_depends.sh -o ubuntu
mkdir -p cpp/build && cd cpp/build && cmake -DBUILD_STATIC=ON -DTESTS=ON -DCOVERAGE=ON -DCMAKE_TOOLCHAIN_FILE=${{ env.VCPKG_ROOT }}/scripts/buildsystems/vcpkg.cmake ../
echo "Disk usage before delete files: "`df -lh`
du -sch ${{ env.VCPKG_ROOT }}/buildtrees/*
du -sch ${{ env.VCPKG_ROOT }}/buildtrees/grpc/src/*
rm -rf ${{ env.VCPKG_ROOT }}/buildtrees/*/src
rm -rf ${{ env.VCPKG_ROOT }}/buildtrees/*/*-dbg
rm -rf ${{ env.VCPKG_ROOT }}/buildtrees/*/*-rel
echo "Disk usage after delete files: "`df -lh`
make -j3
- name: Build for macOS
if: runner.os == 'macOS'
run: |
bash -x cpp/tools/install_depends.sh -o macos
brew install libiconv
brew reinstall m4 autoconf libtool automake
echo "## m4:"`which m4`
export DYLD_LIBRARY_PATH=/usr/local/opt/libiconv/lib:${DYLD_LIBRARY_PATH}
export LDFLAGS="-L/usr/local/opt/libiconv/lib"
export CPPFLAGS="-I/usr/local/opt/libiconv/include"
export PATH="/usr/bin:${PATH}"
mkdir -p cpp/build && cd cpp/build
cmake -DBUILD_STATIC=ON -DTESTS=ON -DCOVERAGE=ON -DCMAKE_TOOLCHAIN_FILE=${{ env.VCPKG_ROOT }}/scripts/buildsystems/vcpkg.cmake ../
make -j3
- uses: actions/upload-artifact@v4
if: runner.os == 'macOS'
with:
name: ppc-air-node-macOS
path: ./cpp/build/bin/ppc-air-node
- uses: actions/upload-artifact@v4
if: runner.os == 'macOS'
with:
name: ppc-pro-node-macOS
path: ./cpp/build/bin/ppc-pro-node
- uses: actions/upload-artifact@v4
if: runner.os == 'macOS'
with:
name: ppc-gateway-service-macOS
path: ./cpp/build/bin/ppc-gateway-service
- name: Test
if: runner.os != 'Windows'
run: |
cd cpp/build && CTEST_OUTPUT_ON_FAILURE=TRUE make test ARGS="--output-on-failure"
- name: Publish Error macos
if: always()
uses: actions/upload-artifact@v4
with:
name: build-x64-osx-dbg-err.log
path: /Users/runner/work/WeDPR-Component/WeDPR-Component/vcpkg/buildtrees/gsasl/build-x64-osx-dbg-err.log
- name: Publish Error macos
if: always()
uses: actions/upload-artifact@v4
with:
name: autoconf-x64-osx-err.log
path: /Users/runner/work/WeDPR-Component/WeDPR-Component/vcpkg/buildtrees/gsasl/autoconf-x64-osx-err.log
build_centos:
name: build_centos full node
runs-on: ubuntu-latest
continue-on-error: true
strategy:
fail-fast: false
matrix:
container:
- centos-7.9
container:
image: docker.io/centos:7
volumes:
- /usr/local/share/vcpkg:/usr/local/share/vcpkg
- /node20217:/node20217:rw,rshared
- ${{ matrix.container == 'centos-7.9' && '/node20217:/__e/node20:ro,rshared' || ' ' }}
steps:
- name: install nodejs20glibc2.17
if: ${{ matrix.container == 'centos-7.9' }}
run: |
curl -LO https://unofficial-builds.nodejs.org/download/release/v20.9.0/node-v20.9.0-linux-x64-glibc-217.tar.xz
tar -xf node-v20.9.0-linux-x64-glibc-217.tar.xz --strip-components 1 -C /node20217
- name: Check out the repo
uses: actions/checkout@v4
- uses: actions/cache@v3
id: deps_cache
with:
path: |
deps/
/usr/local/share/vcpkg/buildtrees
/usr/local/share/vcpkg/packages
/home/runner/.ccache
/Users/runner/.ccache/
key: centos-notest-all-${{ matrix.os }}-${{ github.base_ref }}-${{ hashFiles('.github/workflows/cpp_full_node_workflow.yml') }}
restore-keys: |
centos-notest-all-${{ matrix.os }}-${{ github.base_ref }}-${{ hashFiles('.github/workflows/cpp_full_node_workflow.yml') }}
centos-notest-all-${{ matrix.os }}-${{ github.base_ref }}-
centos-notest-all-${{ matrix.os }}-
- name: Prepare centos tools
run: |
rpm -ivh https://cbs.centos.org/kojifiles/packages/centos-release-scl-rh/2/3.el7.centos/noarch/centos-release-scl-rh-2-3.el7.centos.noarch.rpm
rpm -ivh https://cbs.centos.org/kojifiles/packages/centos-release-scl/2/3.el7.centos/noarch/centos-release-scl-2-3.el7.centos.noarch.rpm
sed -i s/mirror.centos.org/mirrors.aliyun.com/g /etc/yum.repos.d/*.repo
sed -i s/^#.*baseurl=http/baseurl=http/g /etc/yum.repos.d/*.repo
sed -i s/^mirrorlist=http/#mirrorlist=http/g /etc/yum.repos.d/*.repo
cat /etc/yum.repos.d/*.repo
yum clean all
yum makecache
yum update -y
yum install -y epel-release centos-release-scl centos-release-scl-rh
yum install -y https://packages.endpointdev.com/rhel/7/os/x86_64/endpoint-repo.x86_64.rpm
yum install -y libtool wget java-11-openjdk-devel git autoconf automake make gcc gcc-c++ glibc-static glibc-devel cmake3 ccache devtoolset-11 libzstd-devel zlib-devel flex bison python-devel python3-devel
- uses: actions-rs/toolchain@v1
with:
toolchain: nightly-2022-07-28
override: true
- name: Prepare vcpkg
if: runner.os != 'Windows'
uses: friendlyanon/setup-vcpkg@v1
with: { committish: 51b14cd4e1230dd51c11ffeff6f7d53c61cc5297 }
- name: Check disk space
run: df . -h
- name: Free disk space
run: |
du -sch /usr/share/*
du -sch /opt/*
- name: Check disk space
run: |
df . -h
du /usr/ -hx -d 4 --threshold=1G | sort -hr | head
df /tmp
du /tmp | sort -n
ls -lh /tmp
- name: upgradeDepends
run: |
wget http://ftp.gnu.org/gnu/automake/automake-1.14.1.tar.gz
tar -xf automake-1.14.1.tar.gz
cd automake-1.14.1
./configure && make -j4 && make install
cd ..
- name: DependenciesBuild
run: |
bash -x cpp/tools/install_depends.sh -o centos
alias cmake='cmake3'
. /opt/rh/devtoolset-11/enable
rm -rf python
mkdir -p cpp/build
cd cpp/build
cmake3 -DCMAKE_TOOLCHAIN_FILE=${{ env.VCPKG_ROOT }}/scripts/buildsystems/vcpkg.cmake -DBUILD_STATIC=ON -DCMAKE_BUILD_TYPE=Release -DTESTS=ON ../
- name: FreeDiskSpace
run: |
df -lh
du -sch /__w/WeDPR-Component/WeDPR-Component/vcpkg/buildtrees/*
du -sch /__w/WeDPR-Component/WeDPR-Component/vcpkg/buildtrees/grpc/src/*
rm -rf /__w/WeDPR-Component/WeDPR-Component/vcpkg/buildtrees/grpc/src
rm -rf /__w/WeDPR-Component/WeDPR-Component/vcpkg/buildtrees/grpc/*-dbg
rm -rf /__w/WeDPR-Component/WeDPR-Component/vcpkg/buildtrees/openssl/src
rm -rf /__w/WeDPR-Component/WeDPR-Component/vcpkg/buildtrees/openssl/*-dbg
rm -rf /__w/WeDPR-Component/WeDPR-Component/vcpkg/buildtrees/*/*-dbg
df -lh
- name: Compile
run: |
alias cmake='cmake3'
. /opt/rh/devtoolset-11/enable
cd cpp/build && cmake3 --build . --parallel 3
#- name: Test
# run: |
# export OMP_NUM_THREADS=1
# cd build && CTEST_OUTPUT_ON_FAILURE=TRUE make test
- uses: actions/upload-artifact@v3
with:
name: ppc-air-node-x64
path: ./cpp/build/bin/ppc-air-node
- uses: actions/upload-artifact@v3
with:
name: ppc-pro-node-x64
path: ./cpp/build/bin/ppc-pro-node
- uses: actions/upload-artifact@v3
with:
name: ppc-gateway-service-x64
path: ./cpp/build/bin/ppc-gateway-service