Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

feat: fix build example with cppcoro #15

Merged
merged 1 commit into from
Nov 19, 2024
Merged
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
48 changes: 48 additions & 0 deletions .github/workflows/ci.yml
Original file line number Diff line number Diff line change
Expand Up @@ -187,6 +187,54 @@ jobs:
sudo cp -r $HOME/.local/lib/* /usr/lib/
sudo ldconfig

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

build_and_test_cppcoro_example:
runs-on: ubuntu-latest
strategy:
matrix:
os:
- ubuntu-latest

steps:
- uses: actions/checkout@v4

# Cache cppcoro
- name: Cache cppcoro
id: cache-cppcoro
uses: actions/cache@v4
with:
path: |
~/.local/include/cppcoro/**
~/.local/lib/libcppcoro*
key: cppcoro-${{ runner.os }}-dev

- name: Build cppcoro
if: steps.cache-cppcoro.outputs.cache-hit != 'true'
run: |
cd /tmp
git clone https://github.com/andreasbuhr/cppcoro.git && cd cppcoro
rm -rf _build; mkdir -p _build && cd _build
cmake .. -DCMAKE_CXX_COMPILER=/usr/bin/clang++ \
-DCMAKE_C_COMPILER=/usr/bin/clang \
-DCMAKE_INSTALL_PREFIX=$HOME/.local \
-DCMAKE_CXX_FLAGS="-O3" \
-DBUILD_SHARED_LIBS=TRUE
make -j$(nproc)
make install
sudo ldconfig
cd ../../
rm -rf /tmp/cppcoro

- name: Copy dependencies to sys
run: |
sudo cp -r $HOME/.local/include/* /usr/include/
sudo cp -r $HOME/.local/lib/* /usr/lib/
sudo ldconfig

- name: Build
working-directory: cxx-async
run: |
Expand Down