1+ name : WeDPR-Component ci for full node
2+ on :
3+ push :
4+ paths-ignore :
5+ - " docs/**"
6+ - " python/**"
7+ - " cpp/wedpr-transport/sdk-wrapper/python/bindings/**"
8+ - " Changelog.md"
9+ - " README.md"
10+ pull_request :
11+ paths-ignore :
12+ - " docs/**"
13+ - " python/**"
14+ - " Changelog.md"
15+ - " README.md"
16+ release :
17+ types : [published, push]
18+ concurrency :
19+ group : ${{ github.workflow }}-${{ github.event.pull_request.number || github.ref }}
20+ cancel-in-progress : true
21+
22+ env :
23+ RUST_BACKTRACE : 1
24+ ACTIONS_ALLOW_USE_UNSECURE_NODE_VERSION : true
25+ ACTIONS_RUNNER_FORCED_INTERNAL_NODE_VERSION : node16
26+ ACTIONS_RUNNER_FORCE_ACTIONS_NODE_VERSION : node16
27+
28+ jobs :
29+ build :
30+ name : build all
31+ runs-on : ${{ matrix.os }}
32+ continue-on-error : true
33+ strategy :
34+ fail-fast : false
35+ matrix :
36+ os : [macos-13, ubuntu-20.04]
37+ steps :
38+ - uses : actions/checkout@v2
39+ with :
40+ fetch-depth : 5
41+ - uses : actions-rs/toolchain@v1
42+ with :
43+ toolchain : nightly-2022-07-28
44+ override : true
45+ - name : Prepare vcpkg
46+ if : runner.os != 'Windows'
47+ uses : friendlyanon/setup-vcpkg@v1
48+ with : { committish: 51b14cd4e1230dd51c11ffeff6f7d53c61cc5297 }
49+ - uses : actions/cache@v2
50+ id : deps_cache
51+ with :
52+ path : |
53+ deps/
54+ c:/vcpkg
55+ !c:/vcpkg/.git
56+ !c:/vcpkg/buildtrees
57+ !c:/vcpkg/packages
58+ !c:/vcpkg/downloads
59+ key : build-all-${{ matrix.os }}-${{ github.base_ref }}-${{ hashFiles('.github/workflows/cpp_full_node_workflow.yml') }}
60+ restore-keys : |
61+ build-all-${{ matrix.os }}-${{ github.base_ref }}-${{ hashFiles('.github/workflows/cpp_full_node_workflow.yml') }}
62+ build-all-${{ matrix.os }}-${{ github.base_ref }}-
63+ build-all-${{ matrix.os }}-
64+ - name : Build for linux
65+ if : runner.os == 'Linux'
66+ run : |
67+ sudo apt install -y lcov ccache wget libgmp-dev python3-dev
68+ export GCC='gcc-10'
69+ export CXX='g++-10'
70+ sudo bash -x cpp/tools/install_depends.sh -o ubuntu
71+ 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 ../
72+ echo "Disk usage before delete files: "`df -lh`
73+ du -sch ${{ env.VCPKG_ROOT }}/buildtrees/*
74+ du -sch ${{ env.VCPKG_ROOT }}/buildtrees/grpc/src/*
75+ rm -rf ${{ env.VCPKG_ROOT }}/buildtrees/*/src
76+ rm -rf ${{ env.VCPKG_ROOT }}/buildtrees/*/*-dbg
77+ rm -rf ${{ env.VCPKG_ROOT }}/buildtrees/*/*-rel
78+ echo "Disk usage after delete files: "`df -lh`
79+ make -j3
80+ - name : Build for macOS
81+ if : runner.os == 'macOS'
82+ run : |
83+ bash -x cpp/tools/install_depends.sh -o macos
84+ brew install libiconv
85+ brew reinstall m4 autoconf libtool automake
86+ echo "## m4:"`which m4`
87+ export DYLD_LIBRARY_PATH=/usr/local/opt/libiconv/lib:${DYLD_LIBRARY_PATH}
88+ export LDFLAGS="-L/usr/local/opt/libiconv/lib"
89+ export CPPFLAGS="-I/usr/local/opt/libiconv/include"
90+ export PATH="/usr/bin:${PATH}"
91+ mkdir -p cpp/build && cd cpp/build
92+ cmake -DBUILD_STATIC=ON -DTESTS=ON -DCOVERAGE=ON -DCMAKE_TOOLCHAIN_FILE=${{ env.VCPKG_ROOT }}/scripts/buildsystems/vcpkg.cmake ../
93+ make -j3
94+ - name : Publish Error
95+ if : always()
96+ uses : actions/upload-artifact@v4
97+ with :
98+ name : gperftools-build-err.log
99+ path : /home/runner/work/WeDPR-Component/WeDPR-Component/cpp/deps/src/gperftools-stamp/gperftools-build-err.log
100+ - uses : actions/upload-artifact@v4
101+ if : runner.os == 'macOS'
102+ with :
103+ name : ppc-air-node-macOS
104+ path : ./cpp/build/bin/ppc-air-node
105+ - uses : actions/upload-artifact@v4
106+ if : runner.os == 'macOS'
107+ with :
108+ name : ppc-pro-node-macOS
109+ path : ./cpp/build/bin/ppc-pro-node
110+ - uses : actions/upload-artifact@v4
111+ if : runner.os == 'macOS'
112+ with :
113+ name : ppc-gateway-service-macOS
114+ path : ./cpp/build/bin/ppc-gateway-service
115+ - name : Test
116+ if : runner.os != 'Windows'
117+ run : |
118+ cd cpp/build && CTEST_OUTPUT_ON_FAILURE=TRUE make test ARGS="--output-on-failure"
119+ - name : Publish Error
120+ if : always()
121+ uses : actions/upload-artifact@v4
122+ with :
123+ name : build-x64-linux-dbg-err.log
124+ path : /home/runner/work/WeDPR-Component/WeDPR-Component/vcpkg/buildtrees/gsasl/build-x64-linux-dbg-err.log
125+ - name : Publish Error macos
126+ if : always()
127+ uses : actions/upload-artifact@v4
128+ with :
129+ name : build-x64-osx-dbg-err.log
130+ path : /Users/runner/work/WeDPR-Component/WeDPR-Component/vcpkg/buildtrees/gsasl/build-x64-osx-dbg-err.log
131+ - name : Publish Error macos
132+ if : always()
133+ uses : actions/upload-artifact@v4
134+ with :
135+ name : autoconf-x64-osx-err.log
136+ path : /Users/runner/work/WeDPR-Component/WeDPR-Component/vcpkg/buildtrees/gsasl/autoconf-x64-osx-err.log
137+
138+ build_centos :
139+ name : build_centos full node
140+ runs-on : ubuntu-latest
141+ continue-on-error : true
142+ strategy :
143+ fail-fast : false
144+ matrix :
145+ container :
146+ - centos-7.9
147+ container :
148+ image : docker.io/centos:7
149+ volumes :
150+ - /usr/local/share/vcpkg:/usr/local/share/vcpkg
151+ - /node20217:/node20217:rw,rshared
152+ - ${{ matrix.container == 'centos-7.9' && '/node20217:/__e/node20:ro,rshared' || ' ' }}
153+ steps :
154+ - name : install nodejs20glibc2.17
155+ if : ${{ matrix.container == 'centos-7.9' }}
156+ run : |
157+ curl -LO https://unofficial-builds.nodejs.org/download/release/v20.9.0/node-v20.9.0-linux-x64-glibc-217.tar.xz
158+ tar -xf node-v20.9.0-linux-x64-glibc-217.tar.xz --strip-components 1 -C /node20217
159+ - name : Check out the repo
160+ uses : actions/checkout@v4
161+ - uses : actions/cache@v3
162+ id : deps_cache
163+ with :
164+ path : |
165+ deps/
166+ /usr/local/share/vcpkg/buildtrees
167+ /usr/local/share/vcpkg/packages
168+ /home/runner/.ccache
169+ /Users/runner/.ccache/
170+ key : centos-notest-all-${{ matrix.os }}-${{ github.base_ref }}-${{ hashFiles('.github/workflows/cpp_full_node_workflow.yml') }}
171+ restore-keys : |
172+ centos-notest-all-${{ matrix.os }}-${{ github.base_ref }}-${{ hashFiles('.github/workflows/cpp_full_node_workflow.yml') }}
173+ centos-notest-all-${{ matrix.os }}-${{ github.base_ref }}-
174+ centos-notest-all-${{ matrix.os }}-
175+ - name : Prepare centos tools
176+ run : |
177+ 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
178+ 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
179+ sed -i s/mirror.centos.org/mirrors.aliyun.com/g /etc/yum.repos.d/*.repo
180+ sed -i s/^#.*baseurl=http/baseurl=http/g /etc/yum.repos.d/*.repo
181+ sed -i s/^mirrorlist=http/#mirrorlist=http/g /etc/yum.repos.d/*.repo
182+ cat /etc/yum.repos.d/*.repo
183+ yum clean all
184+ yum makecache
185+ yum update -y
186+ yum install -y epel-release centos-release-scl centos-release-scl-rh
187+ yum install -y https://packages.endpointdev.com/rhel/7/os/x86_64/endpoint-repo.x86_64.rpm
188+ 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
189+ - uses : actions-rs/toolchain@v1
190+ with :
191+ toolchain : nightly-2022-07-28
192+ override : true
193+ - name : Prepare vcpkg
194+ if : runner.os != 'Windows'
195+ uses : friendlyanon/setup-vcpkg@v1
196+ with : { committish: 51b14cd4e1230dd51c11ffeff6f7d53c61cc5297 }
197+ - name : Check disk space
198+ run : df . -h
199+ - name : Free disk space
200+ run : |
201+ du -sch /usr/share/*
202+ du -sch /opt/*
203+ - name : Check disk space
204+ run : |
205+ df . -h
206+ du /usr/ -hx -d 4 --threshold=1G | sort -hr | head
207+ df /tmp
208+ du /tmp | sort -n
209+ ls -lh /tmp
210+ - name : upgradeDepends
211+ run : |
212+ wget http://ftp.gnu.org/gnu/automake/automake-1.14.1.tar.gz
213+ tar -xf automake-1.14.1.tar.gz
214+ cd automake-1.14.1
215+ ./configure && make -j4 && make install
216+ cd ..
217+ - name : DependenciesBuild
218+ run : |
219+ bash -x cpp/tools/install_depends.sh -o centos
220+ alias cmake='cmake3'
221+ . /opt/rh/devtoolset-11/enable
222+ rm -rf python
223+ mkdir -p cpp/build
224+ cd cpp/build
225+ cmake3 -DCMAKE_TOOLCHAIN_FILE=${{ env.VCPKG_ROOT }}/scripts/buildsystems/vcpkg.cmake -DBUILD_STATIC=ON -DCMAKE_BUILD_TYPE=Release -DTESTS=ON ../
226+ - name : FreeDiskSpace
227+ run : |
228+ df -lh
229+ du -sch /__w/WeDPR-Component/WeDPR-Component/vcpkg/buildtrees/*
230+ du -sch /__w/WeDPR-Component/WeDPR-Component/vcpkg/buildtrees/grpc/src/*
231+ rm -rf /__w/WeDPR-Component/WeDPR-Component/vcpkg/buildtrees/grpc/src
232+ rm -rf /__w/WeDPR-Component/WeDPR-Component/vcpkg/buildtrees/grpc/*-dbg
233+ rm -rf /__w/WeDPR-Component/WeDPR-Component/vcpkg/buildtrees/openssl/src
234+ rm -rf /__w/WeDPR-Component/WeDPR-Component/vcpkg/buildtrees/openssl/*-dbg
235+ rm -rf /__w/WeDPR-Component/WeDPR-Component/vcpkg/buildtrees/*/*-dbg
236+ df -lh
237+ - name : Compile
238+ run : |
239+ alias cmake='cmake3'
240+ . /opt/rh/devtoolset-11/enable
241+ cd cpp/build && cmake3 --build . --parallel 3
242+ # - name: Test
243+ # run: |
244+ # export OMP_NUM_THREADS=1
245+ # cd build && CTEST_OUTPUT_ON_FAILURE=TRUE make test
246+ - uses : actions/upload-artifact@v3
247+ with :
248+ name : ppc-air-node-x64
249+ path : ./cpp/build/bin/ppc-air-node
250+ - uses : actions/upload-artifact@v3
251+ with :
252+ name : ppc-pro-node-x64
253+ path : ./cpp/build/bin/ppc-pro-node
254+ - uses : actions/upload-artifact@v3
255+ with :
256+ name : ppc-gateway-service-x64
257+ path : ./cpp/build/bin/ppc-gateway-service
258+ - name : Publish Error macos
259+ if : always()
260+ uses : actions/upload-artifact@v4
261+ with :
262+ name : vcpkg-manifest-install.log
263+ path : /__w/WeDPR-Component/WeDPR-Component/cpp/build/vcpkg-manifest-install.log
264+ - name : Publish Error macos
265+ if : always()
266+ uses : actions/upload-artifact@v4
267+ with :
268+ name : autoconf-x64-linux-err.log
269+ path : /__w/WeDPR-Component/WeDPR-Component/vcpkg/buildtrees/gsasl/autoconf-x64-linux-err.log
0 commit comments