-
Notifications
You must be signed in to change notification settings - Fork 0
81 lines (64 loc) · 1.93 KB
/
c-cpp.yml
File metadata and controls
81 lines (64 loc) · 1.93 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
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
name: Cross-Platform Build
on:
push:
branches: [ main, develop ]
pull_request:
branches: [ main ]
jobs:
build-linux:
runs-on: ubuntu-latest
steps:
- uses: actions/checkout@v4
- name: Install dependencies
run: |
sudo apt-get update
sudo apt-get install -y cmake g++ freeglut3-dev libglu1-mesa-dev
- name: Configure CMake
run: cmake -B build -DCMAKE_BUILD_TYPE=Release
- name: Build
run: cmake --build build --config Release
- name: Upload artifact
uses: actions/upload-artifact@v4
with:
name: rubiks-cube-linux
path: build/RubiksCube
build-macos:
runs-on: macos-latest
steps:
- uses: actions/checkout@v4
- name: Install dependencies
run: |
# OpenGL and GLUT are pre-installed on macOS
brew install cmake
- name: Configure CMake
run: cmake -B build -DCMAKE_BUILD_TYPE=Release
- name: Build
run: cmake --build build --config Release
- name: Upload artifact
uses: actions/upload-artifact@v4
with:
name: rubiks-cube-macos
path: build/RubiksCube
build-windows:
runs-on: windows-latest
steps:
- uses: actions/checkout@v4
- name: Setup MSVC
uses: microsoft/setup-msbuild@v2
- name: Install dependencies
run: |
# Install vcpkg
git clone https://github.com/Microsoft/vcpkg.git
.\vcpkg\bootstrap-vcpkg.bat
.\vcpkg\vcpkg install freeglut:x64-windows
- name: Configure CMake
run: |
cmake -B build -DCMAKE_BUILD_TYPE=Release `
-DCMAKE_TOOLCHAIN_FILE="${{github.workspace}}\vcpkg\scripts\buildsystems\vcpkg.cmake"
- name: Build
run: cmake --build build --config Release
- name: Upload artifact
uses: actions/upload-artifact@v4
with:
name: rubiks-cube-windows
path: build/Release/RubiksCube.exe