Skip to content

Commit 12c252e

Browse files
authored
Add CI workflow for Node++ cross-platform testing
1 parent da396e1 commit 12c252e

File tree

1 file changed

+40
-0
lines changed

1 file changed

+40
-0
lines changed

.github/workflows/main.yml

Lines changed: 40 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,40 @@
1+
name: Nodepp C++ Cross-Platform CI
2+
3+
on:
4+
push:
5+
branches: [ main ]
6+
pull_request:
7+
branches: [ main ]
8+
9+
jobs:
10+
build_and_test:
11+
# 1. Define the runners for the matrix strategy
12+
strategy:
13+
fail-fast: false
14+
matrix:
15+
os: [ubuntu-latest, macos-latest, windows-latest]
16+
17+
# 2. Use the matrix variable to set the runner OS
18+
runs-on: ${{ matrix.os }}
19+
20+
steps:
21+
- name: ⬇️ Checkout code
22+
uses: actions/checkout@v4
23+
24+
# --- 🧪 Unit Test Compilation and Run ---
25+
26+
- name: 🧪 Unit Test (Linux/macOS)
27+
# Uses -lssl -lcrypto -lpthread flags
28+
if: runner.os != 'Windows'
29+
run: |
30+
echo "Running Unix-like Unit Test build..." ; cd ./test
31+
g++ -o main main.cpp -I../include -lpthread ; ./main
32+
33+
- name: 🧪 Unit Test (Windows)
34+
# Uses -lssl -lcrypto -lws2_32 flags
35+
if: runner.os == 'Windows'
36+
run: |
37+
echo "Running Windows Unit Test build..." ; cd ./test
38+
g++ -o main main.cpp -I../include -lws2_32; ./main.exe
39+
40+
# --- End of the workflow ---

0 commit comments

Comments
 (0)