-
Notifications
You must be signed in to change notification settings - Fork 0
62 lines (59 loc) · 2.3 KB
/
Copy pathci.yml
File metadata and controls
62 lines (59 loc) · 2.3 KB
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
name: CI
on:
push:
branches: [master, main]
pull_request:
jobs:
# host 测试: posix × {openssl, wolfssl}, ASan 跑测试。
# libcoro 由 asyncweb 的 find_package-or-FetchContent 自动拉取 (未装 => 源码)。
# test_sync_http / test_async_http 依赖外部网络 (postman-echo), CI 里排除。
test:
runs-on: ubuntu-latest
strategy:
fail-fast: false
matrix:
ssl: [openssl, wolfssl]
steps:
- uses: actions/checkout@v4
- name: Install OpenSSL (openssl backend)
if: matrix.ssl == 'openssl'
run: sudo apt-get update && sudo apt-get install -y libssl-dev
- name: Configure
run: >
cmake -B build
-DASYNCWEB_STANDALONE=ON
-DASYNCWEB_OS_BACKEND=posix
-DASYNCWEB_SSL_BACKEND=${{ matrix.ssl }}
-DCMAKE_C_FLAGS="-fsanitize=address -fno-omit-frame-pointer -g"
-DCMAKE_EXE_LINKER_FLAGS="-fsanitize=address"
- name: Build
run: cmake --build build -j
- name: Test (exclude external-network)
working-directory: build
env:
ASAN_OPTIONS: detect_leaks=1
run: ctest --output-on-failure -E 'test_sync_http|test_async_http'
# 安装 + 下游 find_package smoke test (openssl 后端, 用 examples/)。
# 先装 libcoro, 再装 asyncweb, 再用 find_package(asyncweb) 构建 examples。
install-smoke:
runs-on: ubuntu-latest
steps:
- uses: actions/checkout@v4
- name: Install deps
run: sudo apt-get update && sudo apt-get install -y libssl-dev
- name: Install libcoro
run: |
git clone --depth 1 https://github.com/StealthIM/libcoro.git /tmp/libcoro
cmake -S /tmp/libcoro -B /tmp/libcoro/build \
-DLIBCORO_OS_BACKEND=epoll -DCMAKE_INSTALL_PREFIX="$PWD/_inst"
cmake --build /tmp/libcoro/build --target install -j
- name: Install asyncweb
run: |
cmake -B build \
-DASYNCWEB_OS_BACKEND=posix -DASYNCWEB_SSL_BACKEND=openssl \
-DCMAKE_PREFIX_PATH="$PWD/_inst" -DCMAKE_INSTALL_PREFIX="$PWD/_inst"
cmake --build build --target install -j
- name: Build examples via find_package
run: |
cmake -S examples -B examples/build -DCMAKE_PREFIX_PATH="$PWD/_inst"
cmake --build examples/build -j