-
Notifications
You must be signed in to change notification settings - Fork 21
58 lines (58 loc) · 2.59 KB
/
Copy pathc-cpp.yml
File metadata and controls
58 lines (58 loc) · 2.59 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
name: C and C++ core
on:
push:
branches: [main]
paths: ['ports/c/**', 'ports/cpp/**', 'ports/bindings/**', 'ports/php/native/**', 'ports/conformance/**', 'apps/benchmark/src/*native-core.ts', '.github/workflows/c-cpp.yml']
pull_request:
paths: ['ports/c/**', 'ports/cpp/**', 'ports/bindings/**', 'ports/php/native/**', 'ports/conformance/**', 'apps/benchmark/src/*native-core.ts', '.github/workflows/c-cpp.yml']
permissions:
contents: read
jobs:
core:
strategy:
fail-fast: false
matrix:
include:
- os: ubuntu-latest
shared: 'ON'
- os: macos-latest
shared: 'ON'
- os: windows-latest
shared: 'OFF'
runs-on: ${{ matrix.os }}
steps:
- uses: actions/checkout@v7
- uses: actions/setup-python@v6
with:
python-version: '3.12'
- name: Configure
run: cmake -S ports/cpp -B ports/cpp/build -DCMAKE_BUILD_TYPE=Release -DBUILD_SHARED_LIBS=${{ matrix.shared }}
- run: cmake --build ports/cpp/build --config Release --parallel
- run: ctest --test-dir ports/cpp/build -C Release --output-on-failure --timeout 120
- name: Install without touching system directories
run: cmake --install ports/cpp/build --config Release --prefix "${{ runner.temp }}/hqtui-install"
- name: Build separate installed consumers
run: cmake -S ports/c/tests/consumer -B ports/c/build-consumer -DCMAKE_PREFIX_PATH="${{ runner.temp }}/hqtui-install"
- run: cmake --build ports/c/build-consumer --config Release --parallel
- run: ctest --test-dir ports/c/build-consumer -C Release --output-on-failure
safety-and-benchmark:
runs-on: ubuntu-latest
steps:
- uses: actions/checkout@v7
- uses: oven-sh/setup-bun@v2
with:
bun-version: '1.4.0'
- name: Sanitizer build
run: cmake -S ports/cpp -B ports/cpp/build-sanitize -DCMAKE_BUILD_TYPE=Debug -DHQTUI_SANITIZE=ON -DHQTUI_BUILD_BINDINGS=ON
- run: cmake --build ports/cpp/build-sanitize --parallel
- run: ctest --test-dir ports/cpp/build-sanitize --output-on-failure
- name: Optimized build
run: cmake -S ports/cpp -B ports/cpp/build-release -DCMAKE_BUILD_TYPE=Release -DHQTUI_LTO=ON
- run: cmake --build ports/cpp/build-release --parallel
- name: Verify matched workload and capture timings
shell: bash
run: bun apps/benchmark/src/compare-native-core.ts 2000 3 | tee native-core-benchmark.json
- uses: actions/upload-artifact@v7
with:
name: native-core-benchmark
path: native-core-benchmark.json