Skip to content

Commit 0dfb170

Browse files
authored
feat: added ci.yml for C++ CI
1 parent 709db8f commit 0dfb170

File tree

1 file changed

+39
-0
lines changed

1 file changed

+39
-0
lines changed

.github/workflows/ci.yml

Lines changed: 39 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,39 @@
1+
name: C++ CI
2+
3+
on:
4+
push:
5+
branches: [ main ]
6+
pull_request:
7+
branches: [ main ]
8+
9+
jobs:
10+
build:
11+
runs-on: ${{ matrix.os }}
12+
strategy:
13+
matrix:
14+
os: [ubuntu-latest, windows-latest, macos-latest]
15+
steps:
16+
- uses: actions/checkout@v4
17+
18+
- name: Install dependencies (vcpkg)
19+
uses: lukka/run-vcpkg@v11
20+
with:
21+
vcpkgJsonGlob: '**/vcpkg.json'
22+
vcpkgDirectory: '${{ github.workspace }}/vcpkg'
23+
runVcpkgInstall: true
24+
25+
- name: Configure CMake
26+
run: cmake -B build -S . -DCMAKE_TOOLCHAIN_FILE=${{ github.workspace }}/vcpkg/scripts/buildsystems/vcpkg.cmake
27+
28+
- name: Build (Windows)
29+
if: runner.os == 'Windows'
30+
run: cmake --build build
31+
shell: pwsh
32+
33+
- name: Build (Linux)
34+
if: runner.os == 'Linux'
35+
run: cmake --build build -- -j$(nproc)
36+
37+
- name: Build (macOS)
38+
if: runner.os == 'macOS'
39+
run: cmake --build build -- -j$(sysctl -n hw.logicalcpu)

0 commit comments

Comments
 (0)