]> git.lizzy.rs Git - irrlicht.git/blob - .github/workflows/build.yml
Add CI for the new OpenGL 3 driver
[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 -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   win32:
114     runs-on: ubuntu-20.04
115     steps:
116       - uses: actions/checkout@v3
117       - name: Install compiler
118         run: |
119           sudo apt-get update && sudo apt-get install cmake -qyy
120           wget http://minetest.kitsunemimi.pw/mingw-w64-i686_11.2.0_ubuntu20.04.tar.xz -O mingw.tar.xz
121           sudo tar -xaf mingw.tar.xz -C /usr
122
123       - name: Build
124         run: |
125           ./scripts/ci-build-mingw.sh package
126         env:
127           CC: i686-w64-mingw32-gcc
128           CXX: i686-w64-mingw32-g++
129
130       - uses: actions/upload-artifact@v3
131         with:
132           name: irrlicht-win32
133           path: ./irrlicht-win32.zip
134
135   win64:
136     runs-on: ubuntu-20.04
137     steps:
138       - uses: actions/checkout@v3
139       - name: Install compiler
140         run: |
141           sudo apt-get update && sudo apt-get install cmake -qyy
142           wget http://minetest.kitsunemimi.pw/mingw-w64-x86_64_11.2.0_ubuntu20.04.tar.xz -O mingw.tar.xz
143           sudo tar -xaf mingw.tar.xz -C /usr
144
145       - name: Build
146         run: |
147           ./scripts/ci-build-mingw.sh package
148         env:
149           CC: x86_64-w64-mingw32-gcc
150           CXX: x86_64-w64-mingw32-g++
151
152       - uses: actions/upload-artifact@v3
153         with:
154           name: irrlicht-win64
155           path: ./irrlicht-win64.zip
156
157   macos:
158     runs-on: macos-latest
159     steps:
160       - uses: actions/checkout@v3
161       - name: Install deps
162         run: |
163           brew update
164           brew install cmake libpng jpeg
165
166       - name: Build
167         run: |
168           cmake . -DCMAKE_FIND_FRAMEWORK=LAST -DBUILD_EXAMPLES=1
169           make -j3
170
171       - name: Test (headless)
172         run: |
173           ./bin/OSX/AutomatedTest null
174
175   msvc:
176     name: VS 2019 ${{ matrix.config.arch }}
177     runs-on: windows-2019
178     env:
179       VCPKG_VERSION: 14e7bb4ae24616ec54ff6b2f6ef4e8659434ea44
180         # 2022.05.10
181       vcpkg_packages: zlib libpng libjpeg-turbo opengl-registry
182     strategy:
183       fail-fast: false
184       matrix:
185         config:
186           -
187             arch: x86
188             generator: "-G'Visual Studio 16 2019' -A Win32"
189             vcpkg_triplet: x86-windows
190           -
191             arch: x64
192             generator: "-G'Visual Studio 16 2019' -A x64"
193             vcpkg_triplet: x64-windows
194
195     steps:
196       - name: Checkout
197         uses: actions/checkout@v3
198
199       - name: Restore from cache and run vcpkg
200         uses: lukka/run-vcpkg@v7
201         with:
202           vcpkgArguments: ${{env.vcpkg_packages}}
203           vcpkgDirectory: '${{ github.workspace }}\vcpkg'
204           appendedCacheKey: ${{ matrix.config.vcpkg_triplet }}
205           vcpkgGitCommitId: ${{ env.VCPKG_VERSION }}
206           vcpkgTriplet: ${{ matrix.config.vcpkg_triplet }}
207
208       - name: CMake
209         run: |
210             cmake ${{matrix.config.generator}}  `
211             -DCMAKE_TOOLCHAIN_FILE="${{ github.workspace }}\vcpkg\scripts\buildsystems\vcpkg.cmake"  `
212             -DCMAKE_BUILD_TYPE=Release .
213
214       - name: Build
215         run: cmake --build . --config Release
216
217       - name: Create artifact folder
218         run: |
219           mkdir artifact/
220           mkdir artifact/lib/
221
222       - name: Move dlls into artifact folder
223         run: move bin\Win32-VisualStudio\Release\* artifact\lib\
224
225       - name: Move includes into artifact folder
226         run: move include artifact/
227
228       - name: Upload Artifact
229         uses: actions/upload-artifact@v3
230         with:
231           name: msvc-${{ matrix.config.arch }}
232           path: artifact/