-
Notifications
You must be signed in to change notification settings - Fork 21
216 lines (210 loc) · 8.51 KB
/
cmake.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
162
163
164
165
166
167
168
169
170
171
172
173
174
175
176
177
178
179
180
181
182
183
184
185
186
187
188
189
190
191
192
193
194
195
196
197
198
199
200
201
202
203
204
205
206
207
208
209
210
211
212
213
214
215
216
name: Build
on:
push:
branches:
- master
- development
pull_request:
branches:
- master
- development
release:
types:
- created
jobs:
build-windows:
strategy:
matrix:
os: [[windows-latest,x64-windows,msvc]]
buildType: [Release]
runs-on: ${{ matrix.os[0] }}
steps:
- uses: actions/checkout@v2
- name: Checkout submodules
run: |
git submodule update --init -- "CMake"
git submodule update --init -- "external/vcpkg"
- name: Setup vcpkg
uses: lukka/run-vcpkg@v10
with:
vcpkgDirectory: '${{ github.workspace }}/external/vcpkg'
vcpkgJsonGlob: 'vcpkg.json'
- name: Create Build Environment
run: |
cmake -E make_directory ${{runner.workspace}}/build-${{ matrix.buildType }}
- name: Configure Warnings as errors (OFF)
if: github.event_name == 'push'
shell: bash
working-directory: ${{runner.workspace}}/build-${{ matrix.buildType }}
run: |
echo "PROJ_WAE=OFF" >> $GITHUB_ENV
- name: Configure Warnings as errors (ON)
if: github.event_name == 'pull_request'
shell: bash
working-directory: ${{runner.workspace}}/build-${{ matrix.buildType }}
run: |
echo "PROJ_WAE=ON" >> $GITHUB_ENV
- name: Configure CMake
id: configure
shell: bash
working-directory: ${{runner.workspace}}/build-${{ matrix.buildType }}
run: |
cmake $GITHUB_WORKSPACE -DCMAKE_BUILD_TYPE=${{ matrix.buildType }} -DCMAKE_TOOLCHAIN_FILE=$GITHUB_WORKSPACE/external/vcpkg/scripts/buildsystems/vcpkg.cmake -DCMAKE_INSTALL_PREFIX=$GITHUB_WORKSPACE/package/Castor3D -DPROJECTS_WARNINGS_AS_ERRORS=$PROJ_WAE --preset ci-vcpkg
- name: Build
if: steps.configure.conclusion == 'success'
id: build
working-directory: ${{runner.workspace}}/build-${{ matrix.buildType }}
shell: bash
run: |
cmake --build . --parallel 2 --config ${{ matrix.buildType }}
- name: Prepare success package
if: (github.event_name == 'push') && (steps.build.conclusion == 'success')
working-directory: ${{runner.workspace}}/build-${{ matrix.buildType }}
shell: bash
run: |
cmake --install . --config ${{ matrix.buildType }}
7z a $GITHUB_WORKSPACE/Castor3D-${{ matrix.os[1] }}.zip $GITHUB_WORKSPACE/package/Castor3D/
- name: Clean build folder
if: (steps.build.conclusion == 'success')
working-directory: ${{runner.workspace}}/build-${{ matrix.buildType }}
shell: bash
run: |
cmake --build . --config ${{ matrix.buildType }} --target clean
- name: Upload success package
if: (github.event_name == 'push') && (steps.build.conclusion == 'success')
uses: actions/upload-artifact@v2
with:
name: Castor3D-${{ matrix.os[1] }}.zip
path: ${{ github.workspace }}/Castor3D-${{ matrix.os[1] }}.zip
build-macos:
strategy:
matrix:
os: [[macos-latest,x64-osx,clang]]
buildType: [Release]
runs-on: ${{ matrix.os[0] }}
steps:
- uses: actions/checkout@v2
- name: Checkout submodules
run: |
git submodule update --init -- "CMake"
git submodule update --init -- "external/vcpkg"
- name: Setup vcpkg
uses: lukka/run-vcpkg@v10
with:
vcpkgDirectory: '${{ github.workspace }}/external/vcpkg'
vcpkgJsonGlob: 'vcpkg.json'
- name: Install necessary packages
shell: bash
run: |
brew install autoconf automake autoconf-archive
- name: Create Build Environment
run: |
cmake -E make_directory ${{runner.workspace}}/build-${{ matrix.buildType }}
- name: Configure CMake
id: configure
shell: bash
working-directory: ${{runner.workspace}}/build-${{ matrix.buildType }}
run: |
cmake $GITHUB_WORKSPACE -DCMAKE_BUILD_TYPE=${{ matrix.buildType }} -DCMAKE_TOOLCHAIN_FILE=$GITHUB_WORKSPACE/external/vcpkg/scripts/buildsystems/vcpkg.cmake -DCMAKE_INSTALL_PREFIX=$GITHUB_WORKSPACE/package/Castor3D --preset ci-vcpkg-osx
- name: Build
if: steps.configure.conclusion == 'success'
id: build
working-directory: ${{runner.workspace}}/build-${{ matrix.buildType }}
shell: bash
run: |
cmake --build . --parallel 2 --config ${{ matrix.buildType }}
- name: Prepare success package
if: (github.event_name == 'push') && (steps.build.conclusion == 'success')
working-directory: ${{runner.workspace}}/build-${{ matrix.buildType }}
shell: bash
run: |
cmake --install . --config ${{ matrix.buildType }}
7z a $GITHUB_WORKSPACE/Castor3D-${{ matrix.os[1] }}.zip $GITHUB_WORKSPACE/package/Castor3D/
- name: Clean build folder
if: (steps.build.conclusion == 'success')
working-directory: ${{runner.workspace}}/build-${{ matrix.buildType }}
shell: bash
run: |
cmake --build . --config ${{ matrix.buildType }} --target clean
- name: Upload success package
if: (github.event_name == 'push') && (steps.build.conclusion == 'success')
uses: actions/upload-artifact@v2
with:
name: Castor3D-${{ matrix.os[1] }}.zip
path: ${{ github.workspace }}/Castor3D-${{ matrix.os[1] }}.zip
build-linux-gcc:
strategy:
matrix:
os: [[ubuntu-latest,x64-linux,gcc]]
buildType: [Release]
runs-on: ${{ matrix.os[0] }}
steps:
- uses: actions/checkout@v2
- name: Checkout submodules
run: |
git submodule update --init -- "CMake"
git submodule update --init -- "external/vcpkg"
- name: Setup vcpkg
uses: lukka/run-vcpkg@v10
with:
vcpkgDirectory: '${{ github.workspace }}/external/vcpkg'
vcpkgJsonGlob: 'vcpkg.json'
- name: Install necessary G++ version
if: matrix.os[2] == 'gcc'
shell: bash
run: |
sudo apt-get update
sudo apt-get install -y --no-install-recommends ccache gcc-11 g++-11
echo "CC=gcc-11" >> $GITHUB_ENV
echo "CXX=g++-11" >> $GITHUB_ENV
- name: Create Build Environment
run: |
cmake -E make_directory ${{runner.workspace}}/build-${{ matrix.buildType }}
- name: Configure Warnings as errors (OFF)
if: github.event_name == 'push'
shell: bash
working-directory: ${{runner.workspace}}/build-${{ matrix.buildType }}
run: |
echo "PROJ_WAE=OFF" >> $GITHUB_ENV
- name: Configure Warnings as errors (ON)
if: github.event_name == 'pull_request'
shell: bash
working-directory: ${{runner.workspace}}/build-${{ matrix.buildType }}
run: |
echo "PROJ_WAE=ON" >> $GITHUB_ENV
- name: Install necessary packages
shell: bash
run: |
sudo apt-get install -y --no-install-recommends libxi-dev libgl1-mesa-dev libglu1-mesa-dev mesa-common-dev libxrandr-dev libxxf86vm-dev libxaw7-dev libwayland-dev libxcb1-dev libx11-xcb-dev pkg-config libgtk-3-dev libsecret-1-dev libgcrypt20-dev libsystemd-dev autoconf automake autoconf-archive
- name: Configure CMake
id: configure
shell: bash
working-directory: ${{runner.workspace}}/build-${{ matrix.buildType }}
run: |
cmake $GITHUB_WORKSPACE -DCMAKE_BUILD_TYPE=${{ matrix.buildType }} -DCMAKE_TOOLCHAIN_FILE=$GITHUB_WORKSPACE/external/vcpkg/scripts/buildsystems/vcpkg.cmake -DCMAKE_INSTALL_PREFIX=$GITHUB_WORKSPACE/package/Castor3D -DPROJECTS_WARNINGS_AS_ERRORS=$PROJ_WAE --preset ci-vcpkg
- name: Build
if: steps.configure.conclusion == 'success'
id: build
working-directory: ${{runner.workspace}}/build-${{ matrix.buildType }}
shell: bash
run: |
cmake --build . --parallel 2 --config ${{ matrix.buildType }}
- name: Prepare success package
if: (github.event_name == 'push') && (steps.build.conclusion == 'success')
working-directory: ${{runner.workspace}}/build-${{ matrix.buildType }}
shell: bash
run: |
cmake --install . --config ${{ matrix.buildType }}
7z a $GITHUB_WORKSPACE/Castor3D-${{ matrix.os[1] }}.zip $GITHUB_WORKSPACE/package/Castor3D/
- name: Clean build folder
if: (steps.build.conclusion == 'success')
working-directory: ${{runner.workspace}}/build-${{ matrix.buildType }}
shell: bash
run: |
cmake --build . --config ${{ matrix.buildType }} --target clean
- name: Upload success package
if: (github.event_name == 'push') && (steps.build.conclusion == 'success')
uses: actions/upload-artifact@v2
with:
name: Castor3D-${{ matrix.os[1] }}.zip
path: ${{ github.workspace }}/Castor3D-${{ matrix.os[1] }}.zip