Skip to content

Commit a116e71

Browse files
committed
Add GitHub Actions CI for Linux, macOS, and Windows
1 parent 89047d9 commit a116e71

3 files changed

Lines changed: 80 additions & 2 deletions

File tree

.github/workflows/ci.yml

Lines changed: 70 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,70 @@
1+
name: CI
2+
3+
on:
4+
push:
5+
branches: [master, main]
6+
pull_request:
7+
branches: [master, main]
8+
9+
jobs:
10+
build:
11+
strategy:
12+
fail-fast: false
13+
matrix:
14+
include:
15+
- os: ubuntu-latest
16+
name: Linux (GCC)
17+
cmake_args: -DCMAKE_BUILD_TYPE=Release
18+
- os: macos-latest
19+
name: macOS (Apple Clang)
20+
cmake_args: -DCMAKE_BUILD_TYPE=Release
21+
- os: windows-latest
22+
name: Windows (MSVC)
23+
cmake_args: -DCMAKE_BUILD_TYPE=Release
24+
25+
name: ${{ matrix.name }}
26+
runs-on: ${{ matrix.os }}
27+
28+
steps:
29+
- uses: actions/checkout@v4
30+
31+
# ── System dependencies ────────────────────────────────────
32+
- name: Install Linux dependencies
33+
if: runner.os == 'Linux'
34+
run: |
35+
sudo apt-get update
36+
sudo apt-get install -y \
37+
libgl-dev \
38+
libx11-dev libxrandr-dev libxinerama-dev libxcursor-dev libxi-dev \
39+
libgtk-3-dev \
40+
python3-dev
41+
42+
# ── Python setup ───────────────────────────────────────────
43+
- uses: actions/setup-python@v5
44+
with:
45+
python-version: '3.12'
46+
47+
- name: Install Python test dependencies
48+
run: pip install pyarrow polars pandas numpy pytest
49+
50+
# ── Cache FetchContent downloads ───────────────────────────
51+
- name: Cache FetchContent
52+
uses: actions/cache@v4
53+
with:
54+
path: build/_deps
55+
key: deps-${{ runner.os }}-${{ hashFiles('cmake/Dependencies.cmake') }}
56+
restore-keys: deps-${{ runner.os }}-
57+
58+
# ── Build ──────────────────────────────────────────────────
59+
- name: Configure
60+
run: cmake -B build ${{ matrix.cmake_args }}
61+
62+
- name: Build
63+
run: cmake --build build --config Release --parallel
64+
65+
# ── Test ───────────────────────────────────────────────────
66+
- name: C++ tests
67+
run: ctest --test-dir build --config Release --output-on-failure
68+
69+
- name: Python tests
70+
run: python -m pytest tests/python -v

CMakeLists.txt

Lines changed: 8 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -74,7 +74,11 @@ target_include_directories(cellwright_core PUBLIC
7474
)
7575

7676
if(CMAKE_SYSTEM_PROCESSOR MATCHES "x86_64|AMD64")
77-
target_compile_options(cellwright_core PRIVATE -mavx2 -mfma)
77+
if(MSVC)
78+
target_compile_options(cellwright_core PRIVATE /arch:AVX2)
79+
else()
80+
target_compile_options(cellwright_core PRIVATE -mavx2 -mfma)
81+
endif()
7882
endif()
7983

8084
target_link_libraries(cellwright_core PUBLIC
@@ -127,8 +131,10 @@ if(APPLE)
127131
"-framework IOKit"
128132
"-framework CoreVideo"
129133
)
130-
elseif(UNIX)
134+
elseif(UNIX AND NOT WIN32)
131135
target_link_libraries(cellwright PRIVATE GL dl)
136+
elseif(WIN32)
137+
target_link_libraries(cellwright PRIVATE opengl32)
132138
endif()
133139

134140
# ── Plugins ──────────────────────────────────────────────────────

cmake/Dependencies.cmake

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -47,6 +47,8 @@ target_link_libraries(imgui_glfw_opengl3 PUBLIC glfw)
4747

4848
if(APPLE)
4949
target_link_libraries(imgui_glfw_opengl3 PUBLIC "-framework OpenGL")
50+
elseif(WIN32)
51+
target_link_libraries(imgui_glfw_opengl3 PUBLIC opengl32)
5052
elseif(UNIX)
5153
target_link_libraries(imgui_glfw_opengl3 PUBLIC GL)
5254
endif()

0 commit comments

Comments
 (0)