Skip to content

Commit

Permalink
feat: fix build example with folly
Browse files Browse the repository at this point in the history
  • Loading branch information
devillove084 committed Nov 3, 2024
1 parent 84bcb0f commit 8f82cbb
Showing 1 changed file with 25 additions and 27 deletions.
52 changes: 25 additions & 27 deletions .github/workflows/ci.yml
Original file line number Diff line number Diff line change
@@ -1,44 +1,35 @@
name: CI

on:
'on':
push:
branches:
- main
pull_request:
branches:
- main

concurrency:
group: ${{ github.workflow }}-${{ github.ref }}-${{ github.event_name }}
group: '${{ github.workflow }}-${{ github.ref }}-${{ github.event_name }}'
cancel-in-progress: true

jobs:
check:
runs-on: ubuntu-latest
steps:
- uses: actions/checkout@v4

# - name: Install deps
# run: sudo apt-get install libfmt-dev libgflags-dev

- name: Format
run: cargo fmt --all -- --check

- name: Clippy
working-directory: cxx-async
run: cargo clippy -- -D warnings

build:
runs-on: ${{ matrix.os }}
runs-on: '${{ matrix.os }}'
strategy:
matrix:
os:
- ubuntu-latest
# - macos-latest
# - windows-latest

steps:
- uses: actions/checkout@v4

- name: Install dependencies
run: |
sudo apt-get update
Expand All @@ -48,13 +39,13 @@ jobs:
make \
gcc \
g++ \
clang \
autoconf \
automake \
libtool \
python3-pip \
ninja-build \
libgflags-dev \
libboost-all-dev \
libdouble-conversion-dev \
libevent-dev \
libgflags-dev \
Expand All @@ -70,15 +61,19 @@ jobs:
libiberty-dev
- name: Build fmt
working-directory: /tmp/
run: |
git clone https://github.com/fmtlib/fmt.git && cd fmt
rm _build -rf; mkdir _build -p && cd _build
cmake .. -DCMAKE_CXX_COMPILER=/usr/bin/clang++ -DCMAKE_C_COMPILER=/usr/bin/clang -DFMT_TEST=OFF
cmake .. -DCMAKE_CXX_COMPILER=/usr/bin/clang++ \
-DCMAKE_C_COMPILER=/usr/bin/clang \
-DFMT_TEST=OFF
make -j$(nproc)
sudo make install
sudo ldconfig
- name: Build fast_float
working-directory: /tmp/
run: |
git clone https://github.com/fastfloat/fast_float.git && cd fast_float
rm _build -rf; mkdir _build -p && cd _build
Expand All @@ -90,11 +85,19 @@ jobs:
make -j$(nproc)
sudo make install
sudo ldconfig
- name: Build Folly
working-directory: /tmp/
run: |
git clone https://github.com/facebook/folly.git
cd folly
python3 build/fbcode_builder/getdeps.py --shared-libs build --no-tests boost
install_dir=$(python3 ./build/fbcode_builder/getdeps.py show-inst-dir)
boost_inst_dir=$(dirname "$install_dir")
boost_paths=$(find "$boost_inst_dir" -maxdepth 1 -type d -name "boost*")
sudo cp -avf $boost_paths/include /usr/local
sudo cp -avf $boost_paths/lib /usr/local
sudo ldconfig
rm _build -rf
mkdir _build && cd _build
cmake .. -DBUILD_SHARED_LIBS=ON \
Expand All @@ -108,13 +111,8 @@ jobs:
make -j$(nproc)
sudo make install
sudo ldconfig
# - name: Install dependencies on linux
# if: matrix.os == 'ubuntu-latest'
# run: sudo apt-get install libfmt-dev libgflags-dev

- name: Build
working-directory: cxx-async
run: |
cargo build
run: |
cargo build

0 comments on commit 8f82cbb

Please sign in to comment.