-
Notifications
You must be signed in to change notification settings - Fork 172
161 lines (146 loc) · 5.06 KB
/
c-cpp.yml
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
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
124
125
126
127
128
129
130
131
132
133
134
135
136
137
138
139
140
141
142
143
144
145
146
147
148
149
150
151
152
153
154
155
156
157
158
159
160
161
name: C/C++ CI
on:
push:
branches: [ "**" ]
pull_request:
branches: [ "**" ]
# https://github.com/git-lfs/git-lfs/issues/5749
env:
GIT_CLONE_PROTECTION_ACTIVE: false
jobs:
build:
name: "Android (Ubuntu)"
runs-on: ubuntu-latest
steps:
- uses: actions/checkout@v4
with:
submodules: recursive
- name: Set up NDK
uses: nttld/setup-ndk@v1
with:
ndk-version: r25c
- name: Set up JDK
uses: actions/setup-java@v4
with:
java-version: 17
distribution: 'oracle'
- name: Assemble APK debug
run: |
cd build/android
chmod +x ./gradlew
./gradlew assembleDebug
cmake-build:
strategy:
fail-fast: false
matrix:
config:
- {
name: "Windows - MSVC 2022",
os: windows-latest,
build_type: "Debug",
cc: "cl",
cxx: "cl",
generators: "Visual Studio 17 2022",
cmake_args: "-DIGL_WITH_TRACY=ON -DIGL_WITH_TESTS=ON"
}
- {
name: "Windows - MSVC 2022 (no OpenGL)",
os: windows-latest,
build_type: "Debug",
cc: "cl",
cxx: "cl",
generators: "Visual Studio 17 2022",
cmake_args: "-DIGL_WITH_TRACY=ON -DIGL_WITH_TESTS=ON -DIGL_WITH_OPENGL=OFF"
}
- {
name: "Ubuntu - Clang",
os: ubuntu-latest,
build_type: "Debug",
cc: "clang",
cxx: "clang++",
generators: "Unix Makefiles",
cmake_args: "-DIGL_WITH_TRACY=ON"
}
- {
name: "Ubuntu - GCC",
os: ubuntu-latest,
build_type: "Debug",
cc: "gcc",
cxx: "g++",
generators: "Unix Makefiles",
# TODO: Fix killing GCC process on Github CI when IGL_WITH_SHELL is ON.
cmake_args: "-DIGL_WITH_TRACY=ON -DIGL_WITH_SHELL=OFF"
}
# https://github.com/emscripten-core/emscripten/pull/20802#issuecomment-1858114093
# - {
# name: "Emscripten (Ubuntu)",
# os: ubuntu-latest,
# build_type: "Debug",
# cc: "emcc",
# cxx: "em++",
# generators: "Ninja",
# }
- {
name: "macOS - Clang (Xcode)",
os: macos-latest,
build_type: "Debug",
cc: "clang",
cxx: "clang++",
generators: "Xcode",
cmake_args: "-DIGL_WITH_VULKAN=OFF"
}
- {
name: "macOS - Clang (Unix Makefiles)",
os: macos-latest,
build_type: "Debug",
cc: "clang",
cxx: "clang++",
generators: "Unix Makefiles",
cmake_args: "-DIGL_WITH_VULKAN=OFF"
}
runs-on: ${{ matrix.config.os }}
steps:
- uses: actions/checkout@v4
with:
submodules: recursive
- if: startsWith(matrix.config.os, 'windows')
run: |
git config --system core.longpaths true
- if: startsWith(matrix.config.name, 'Emscripten')
run: |
sudo sed -i 's/azure\.//' /etc/apt/sources.list
sudo apt-get update
sudo apt-get install -y clang emscripten xorg-dev libxinerama-dev libxcursor-dev libgles2-mesa-dev libegl1-mesa-dev libglfw3-dev libglew-dev libstdc++-12-dev
- if: startsWith(matrix.config.name, 'Ubuntu' )
run: |
sudo sed -i 's/azure\.//' /etc/apt/sources.list
sudo apt-get update
sudo apt-get install -y clang xorg-dev libxinerama-dev libxcursor-dev libgles2-mesa-dev libegl1-mesa-dev libglfw3-dev libglew-dev libstdc++-12-dev
- name: Prepare Vulkan SDK
uses: humbletim/[email protected]
with:
vulkan-query-version: 1.3.296.0
vulkan-components: Vulkan-Headers, Vulkan-Loader
vulkan-use-cache: true
- name: Get the number of CPU cores
uses: SimenB/github-actions-cpu-cores@v2
- name: Build
shell: bash
env:
CC: ${{ matrix.config.cc }}
CXX: ${{ matrix.config.cxx }}
if: ${{ matrix.config.name != 'Emscripten (Ubuntu)' }}
run: |
cmake ${{ env.CMAKE_GENERATOR }} -S "${{ github.workspace }}" -B build ${{ matrix.config.cmake_args }}
cd build
cmake --build . --parallel ${{ steps.cpu-cores.outputs.count }}
- name: Build Emscripten
shell: bash
env:
CC: ${{ matrix.config.cc }}
CXX: ${{ matrix.config.cxx }}
if: ${{ matrix.config.name == 'Emscripten (Ubuntu)' }}
run: |
emcmake cmake ${{ env.CMAKE_GENERATOR }} -S "${{ github.workspace }}" -B build ${{ matrix.config.cmake_args }}
cd build
cmake --build . --parallel ${{ steps.cpu-cores.outputs.count }}