Skip to content

Commit 452b5a7

Browse files
committed
feat: Add GitHub Actions workflow for building across multiple platforms
1 parent 1c7e5b1 commit 452b5a7

File tree

1 file changed

+50
-0
lines changed

1 file changed

+50
-0
lines changed

.github/workflows/build.yml

Lines changed: 50 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,50 @@
1+
name: Build
2+
3+
on:
4+
push:
5+
branches: [ main ]
6+
pull_request:
7+
branches: [ main ]
8+
9+
jobs:
10+
build:
11+
strategy:
12+
matrix:
13+
os: [ubuntu-latest, windows-latest, macos-latest]
14+
include:
15+
- os: ubuntu-latest
16+
platform: linux
17+
- os: windows-latest
18+
platform: windows
19+
- os: macos-latest
20+
platform: macos
21+
22+
runs-on: ${{ matrix.os }}
23+
24+
steps:
25+
- uses: actions/checkout@v4
26+
27+
- name: Set up CMake
28+
run: |
29+
cmake --version
30+
if [ "${{ matrix.platform }}" = "linux" ]; then
31+
sudo apt-get update
32+
sudo apt-get install -y ninja-build
33+
fi
34+
35+
- name: Configure CMake
36+
run: |
37+
mkdir build
38+
cd build
39+
cmake .. -DCMAKE_BUILD_TYPE=Release
40+
41+
- name: Build Examples
42+
run: |
43+
cd build
44+
cmake --build . --config Release
45+
46+
- name: Upload artifacts
47+
uses: actions/upload-artifact@v4
48+
with:
49+
name: examples-${{ matrix.platform }}
50+
path: build/examples/screen_info/

0 commit comments

Comments
 (0)