]> git.lizzy.rs Git - irrlicht.git/blob - .github/workflows/build.yml
2cf7d603b1f34a24d1d208c91de2cc5d30295e15
[irrlicht.git] / .github / workflows / build.yml
1 name: build
2
3 # build on c/cpp changes or workflow changes
4 on:
5   - push
6   - pull_request
7
8 jobs:
9
10   linux-gl:
11     runs-on: ubuntu-latest
12     container:
13       image: ubuntu:bionic
14       env: { LANG: "C.UTF-8" }
15     steps:
16       - uses: actions/checkout@v3
17       - name: Install deps
18         run: |
19           apt-get update
20           apt-get install g++ cmake libxi-dev libgl1-mesa-dev libpng-dev libjpeg-dev zlib1g-dev -qyy
21
22       - name: Build
23         run: |
24           cmake .
25           make VERBOSE=1 -j2
26
27       - name: Package
28         run: |
29           make DESTDIR=$PWD/_install install
30           tar -c -I "gzip -9" -f irrlicht-linux.tar.gz -C ./_install/usr/local .
31
32       - uses: actions/upload-artifact@v3
33         with:
34           name: irrlicht-linux
35           path: ./irrlicht-linux.tar.gz
36
37   linux-gles:
38     runs-on: ubuntu-latest
39     container:
40       image: ubuntu:bionic
41       env: { LANG: "C.UTF-8" }
42     steps:
43       - uses: actions/checkout@v3
44       - name: Install deps
45         run: |
46           apt-get update
47           apt-get install g++ cmake libxi-dev libgles2-mesa-dev libpng-dev libjpeg-dev zlib1g-dev xvfb -qyy
48
49       - name: Build
50         run: |
51           cmake . -DBUILD_EXAMPLES=1 -DENABLE_OPENGL=OFF -DENABLE_GLES2=ON
52           make -j2
53
54       - name: Test (headless)
55         run: |
56           cd bin/Linux
57           ./AutomatedTest null
58
59       - name: Test (Xvfb)
60         run: |
61           cd bin/Linux
62           LIBGL_ALWAYS_SOFTWARE=true xvfb-run ./AutomatedTest ogles2
63
64   linux-sdl:
65     runs-on: ubuntu-latest
66     container:
67       image: ubuntu:jammy
68       env: { LANG: "C.UTF-8" }
69     steps:
70       - uses: actions/checkout@v3
71       - name: Install deps
72         run: |
73           apt-get update
74           apt-get install g++ cmake libsdl2-dev libpng-dev libjpeg-dev zlib1g-dev -qyy
75
76       - name: Build
77         run: |
78           cmake . -DBUILD_EXAMPLES=1 -DUSE_SDL2=ON
79           make -j2
80
81       - name: Test (headless)
82         run: |
83           cd bin/Linux
84           ./AutomatedTest null
85
86   linux-sdl-gl3:
87     runs-on: ubuntu-latest
88     container:
89       image: ubuntu:jammy
90       env: { LANG: "C.UTF-8" }
91     steps:
92       - uses: actions/checkout@v3
93       - name: Install deps
94         run: |
95           apt-get update
96           apt-get install g++ cmake libsdl2-dev libpng-dev libjpeg-dev zlib1g-dev xvfb -qyy
97
98       - name: Build
99         run: |
100           cmake . -DBUILD_EXAMPLES=1 -DUSE_SDL2=ON -DENABLE_OPENGL3=ON
101           make -j2
102
103       - name: Test (headless)
104         run: |
105           cd bin/Linux
106           ./AutomatedTest null
107
108       - name: Test (Xvfb)
109         run: |
110           cd bin/Linux
111           LIBGL_ALWAYS_SOFTWARE=true xvfb-run ./AutomatedTest opengl3
112
113   linux-sdl-gles2:
114     runs-on: ubuntu-latest
115     container:
116       image: ubuntu:jammy
117       env: { LANG: "C.UTF-8" }
118     steps:
119       - uses: actions/checkout@v3
120       - name: Install deps
121         run: |
122           apt-get update
123           apt-get install g++ cmake libsdl2-dev libpng-dev libjpeg-dev zlib1g-dev xvfb -qyy
124
125       - name: Build
126         run: |
127           cmake . -DBUILD_EXAMPLES=1 -DUSE_SDL2=ON -DENABLE_GLES2=ON
128           make -j2
129
130       - name: Test (headless)
131         run: |
132           cd bin/Linux
133           ./AutomatedTest null
134
135       - name: Test (Xvfb)
136         run: |
137           cd bin/Linux
138           LIBGL_ALWAYS_SOFTWARE=true xvfb-run ./AutomatedTest gles2
139
140   win32:
141     runs-on: ubuntu-20.04
142     steps:
143       - uses: actions/checkout@v3
144       - name: Install compiler
145         run: |
146           sudo apt-get update && sudo apt-get install cmake -qyy
147           wget http://minetest.kitsunemimi.pw/mingw-w64-i686_11.2.0_ubuntu20.04.tar.xz -O mingw.tar.xz
148           sudo tar -xaf mingw.tar.xz -C /usr
149
150       - name: Build
151         run: |
152           ./scripts/ci-build-mingw.sh package
153         env:
154           CC: i686-w64-mingw32-gcc
155           CXX: i686-w64-mingw32-g++
156
157       - uses: actions/upload-artifact@v3
158         with:
159           name: irrlicht-win32
160           path: ./irrlicht-win32.zip
161
162   win64:
163     runs-on: ubuntu-20.04
164     steps:
165       - uses: actions/checkout@v3
166       - name: Install compiler
167         run: |
168           sudo apt-get update && sudo apt-get install cmake -qyy
169           wget http://minetest.kitsunemimi.pw/mingw-w64-x86_64_11.2.0_ubuntu20.04.tar.xz -O mingw.tar.xz
170           sudo tar -xaf mingw.tar.xz -C /usr
171
172       - name: Build
173         run: |
174           ./scripts/ci-build-mingw.sh package
175         env:
176           CC: x86_64-w64-mingw32-gcc
177           CXX: x86_64-w64-mingw32-g++
178
179       - uses: actions/upload-artifact@v3
180         with:
181           name: irrlicht-win64
182           path: ./irrlicht-win64.zip
183
184   macos:
185     runs-on: macos-latest
186     steps:
187       - uses: actions/checkout@v3
188       - name: Install deps
189         run: |
190           brew update
191           brew install cmake libpng jpeg
192
193       - name: Build
194         run: |
195           cmake . -DCMAKE_FIND_FRAMEWORK=LAST -DBUILD_EXAMPLES=1
196           make -j3
197
198       - name: Test (headless)
199         run: |
200           ./bin/OSX/AutomatedTest null
201
202   msvc:
203     name: VS 2019 ${{ matrix.config.arch }}
204     runs-on: windows-2019
205     env:
206       VCPKG_VERSION: 14e7bb4ae24616ec54ff6b2f6ef4e8659434ea44
207         # 2022.05.10
208       vcpkg_packages: zlib libpng libjpeg-turbo opengl-registry
209     strategy:
210       fail-fast: false
211       matrix:
212         config:
213           -
214             arch: x86
215             generator: "-G'Visual Studio 16 2019' -A Win32"
216             vcpkg_triplet: x86-windows
217           -
218             arch: x64
219             generator: "-G'Visual Studio 16 2019' -A x64"
220             vcpkg_triplet: x64-windows
221
222     steps:
223       - name: Checkout
224         uses: actions/checkout@v3
225
226       - name: Restore from cache and run vcpkg
227         uses: lukka/run-vcpkg@v7
228         with:
229           vcpkgArguments: ${{env.vcpkg_packages}}
230           vcpkgDirectory: '${{ github.workspace }}\vcpkg'
231           appendedCacheKey: ${{ matrix.config.vcpkg_triplet }}
232           vcpkgGitCommitId: ${{ env.VCPKG_VERSION }}
233           vcpkgTriplet: ${{ matrix.config.vcpkg_triplet }}
234
235       - name: CMake
236         run: |
237             cmake ${{matrix.config.generator}}  `
238             -DCMAKE_TOOLCHAIN_FILE="${{ github.workspace }}\vcpkg\scripts\buildsystems\vcpkg.cmake"  `
239             -DCMAKE_BUILD_TYPE=Release .
240
241       - name: Build
242         run: cmake --build . --config Release
243
244       - name: Create artifact folder
245         run: |
246           mkdir artifact/
247           mkdir artifact/lib/
248
249       - name: Move dlls into artifact folder
250         run: move bin\Win32-VisualStudio\Release\* artifact\lib\
251
252       - name: Move includes into artifact folder
253         run: move include artifact/
254
255       - name: Upload Artifact
256         uses: actions/upload-artifact@v3
257         with:
258           name: msvc-${{ matrix.config.arch }}
259           path: artifact/