deal with todo-lists #30
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
name: WeDPR-Component ci for full node | |
on: | |
push: | |
paths-ignore: | |
- "docs/**" | |
- "python/**" | |
- "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 | |
jobs: | |
build: | |
name: build all | |
runs-on: ${{ matrix.os }} | |
continue-on-error: true | |
strategy: | |
fail-fast: false | |
matrix: | |
os: [macos-12, 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/workflow.yml') }} | |
restore-keys: | | |
build-all-${{ matrix.os }}-${{ github.base_ref }}-${{ hashFiles('.github/workflows/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 -DTESTS=ON -DCOVERAGE=ON -DCMAKE_TOOLCHAIN_FILE=${{ env.VCPKG_ROOT }}/scripts/buildsystems/vcpkg.cmake ../ || cat /Users/runner/work/WeDPR-Component/WeDPR-Component/vcpkg/buildtrees/libhdfs3/config-x64-osx-dbg-err.log | |
- name: Build for macOS | |
if: runner.os == 'macOS' | |
run: | | |
bash -x cpp/tools/install_depends.sh -o macos | |
mkdir -p cpp/build && cd cpp/build && cmake -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 ctest | |
build_centos: | |
name: build_centos full node | |
runs-on: ${{ matrix.os }} | |
continue-on-error: true | |
strategy: | |
fail-fast: false | |
matrix: | |
os: [ubuntu-latest] | |
container: | |
image: docker.io/centos:7 | |
volumes: | |
- /usr/local/share/vcpkg:/usr/local/share/vcpkg | |
steps: | |
- name: Check disk space | |
run: df . -h | |
- name: Free disk space | |
run: | | |
sudo docker rmi $(docker image ls -aq) >/dev/null 2>&1 || true | |
sudo rm -rf /usr/share/dotnet /usr/local/lib/android /opt/ghc \ | |
/usr/local/share/powershell /usr/share/swift /usr/local/.ghcup || true | |
- 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 | |
- uses: actions/checkout@v3 | |
with: | |
fetch-depth: 5 | |
- 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/workflow.yml') }} | |
restore-keys: | | |
centos-notest-all-${{ matrix.os }}-${{ github.base_ref }}-${{ hashFiles('.github/workflows/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 wget lcov java-11-openjdk-devel git make gcc gcc-c++ glibc-static glibc-devel cmake3 ccache devtoolset-11 libzstd-devel zlib-devel flex bison python-devel python3-devel | |
yum install -y git | |
- uses: actions-rs/toolchain@v1 | |
with: | |
toolchain: nightly-2022-07-28 | |
override: true | |
- name: Build | |
run: | | |
bash -x cpp/tools/install_depends.sh -o centos | |
alias cmake='cmake3' | |
. /opt/rh/devtoolset-11/enable | |
mkdir -p cpp/build | |
cd cpp/build | |
cmake3 -DCMAKE_BUILD_TYPE=Release -DTESTS=ON -DCMAKE_TOOLCHAIN_FILE=/usr/local/share/vcpkg/scripts/buildsystems/vcpkg.cmake ../ | |
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 |