]> git.lizzy.rs Git - irrlicht.git/blob - .github/workflows/build.yml
Update workflow to address deprecations
[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           sed '/#define _IRR_COMPILE_WITH_OGLES2_/ s|^//||g' -i include/IrrCompileConfig.h
52           sed '/#define _IRR_COMPILE_WITH_OPENGL_/ s|^|//|g' -i include/IrrCompileConfig.h
53           cmake . -DBUILD_EXAMPLES=1
54           make -j2
55
56       - name: Test (headless)
57         run: |
58           cd bin/Linux
59           ./AutomatedTest null
60
61       - name: Test (Xvfb)
62         run: |
63           cd bin/Linux
64           LIBGL_ALWAYS_SOFTWARE=true xvfb-run ./AutomatedTest
65
66   linux-sdl:
67     runs-on: ubuntu-latest
68     container:
69       image: ubuntu:jammy
70       env: { LANG: "C.UTF-8" }
71     steps:
72       - uses: actions/checkout@v3
73       - name: Install deps
74         run: |
75           apt-get update
76           apt-get install g++ cmake libsdl2-dev libpng-dev libjpeg-dev zlib1g-dev -qyy
77
78       - name: Build
79         run: |
80           sed '/#define _IRR_COMPILE_WITH_SDL_DEVICE_/ s|^//||g' -i include/IrrCompileConfig.h
81           cmake . -DBUILD_EXAMPLES=1
82           make -j2
83
84       - name: Test (headless)
85         run: |
86           cd bin/Linux
87           ./AutomatedTest null
88
89   win32:
90     runs-on: ubuntu-20.04
91     steps:
92       - uses: actions/checkout@v3
93       - name: Install compiler
94         run: |
95           sudo apt-get update && sudo apt-get install cmake -qyy
96           wget http://minetest.kitsunemimi.pw/mingw-w64-i686_11.2.0_ubuntu20.04.tar.xz -O mingw.tar.xz
97           sudo tar -xaf mingw.tar.xz -C /usr
98
99       - name: Build
100         run: |
101           ./scripts/ci-build-mingw.sh package
102         env:
103           CC: i686-w64-mingw32-gcc
104           CXX: i686-w64-mingw32-g++
105
106       - uses: actions/upload-artifact@v3
107         with:
108           name: irrlicht-win32
109           path: ./irrlicht-win32.zip
110
111   win64:
112     runs-on: ubuntu-20.04
113     steps:
114       - uses: actions/checkout@v3
115       - name: Install compiler
116         run: |
117           sudo apt-get update && sudo apt-get install cmake -qyy
118           wget http://minetest.kitsunemimi.pw/mingw-w64-x86_64_11.2.0_ubuntu20.04.tar.xz -O mingw.tar.xz
119           sudo tar -xaf mingw.tar.xz -C /usr
120
121       - name: Build
122         run: |
123           ./scripts/ci-build-mingw.sh package
124         env:
125           CC: x86_64-w64-mingw32-gcc
126           CXX: x86_64-w64-mingw32-g++
127
128       - uses: actions/upload-artifact@v3
129         with:
130           name: irrlicht-win64
131           path: ./irrlicht-win64.zip
132
133   macos:
134     runs-on: macos-latest
135     steps:
136       - uses: actions/checkout@v3
137       - name: Install deps
138         run: |
139           brew update
140           brew install cmake libpng jpeg
141
142       - name: Build
143         run: |
144           cmake . -DCMAKE_FIND_FRAMEWORK=LAST -DBUILD_EXAMPLES=1
145           make -j3
146
147       - name: Test (headless)
148         run: |
149           ./bin/OSX/AutomatedTest null
150
151   msvc:
152     name: VS 2019 ${{ matrix.config.arch }}
153     runs-on: windows-2019
154     env:
155       VCPKG_VERSION: 14e7bb4ae24616ec54ff6b2f6ef4e8659434ea44
156         # 2022.05.10
157       vcpkg_packages: zlib libpng libjpeg-turbo opengl-registry
158     strategy:
159       fail-fast: false
160       matrix:
161         config:
162           -
163             arch: x86
164             generator: "-G'Visual Studio 16 2019' -A Win32"
165             vcpkg_triplet: x86-windows
166           -
167             arch: x64
168             generator: "-G'Visual Studio 16 2019' -A x64"
169             vcpkg_triplet: x64-windows
170
171     steps:
172       - name: Checkout
173         uses: actions/checkout@v3
174
175       - name: Restore from cache and run vcpkg
176         uses: lukka/run-vcpkg@v7
177         with:
178           vcpkgArguments: ${{env.vcpkg_packages}}
179           vcpkgDirectory: '${{ github.workspace }}\vcpkg'
180           appendedCacheKey: ${{ matrix.config.vcpkg_triplet }}
181           vcpkgGitCommitId: ${{ env.VCPKG_VERSION }}
182           vcpkgTriplet: ${{ matrix.config.vcpkg_triplet }}
183
184       - name: CMake
185         run: |
186             cmake ${{matrix.config.generator}}  `
187             -DCMAKE_TOOLCHAIN_FILE="${{ github.workspace }}\vcpkg\scripts\buildsystems\vcpkg.cmake"  `
188             -DCMAKE_BUILD_TYPE=Release .
189
190       - name: Build
191         run: cmake --build . --config Release
192
193       - name: Create artifact folder
194         run: |
195           mkdir artifact/
196           mkdir artifact/lib/
197
198       - name: Move dlls into artifact folder
199         run: move bin\Win32-VisualStudio\Release\* artifact\lib\
200
201       - name: Move includes into artifact folder
202         run: move include artifact/
203
204       - name: Upload Artifact
205         uses: actions/upload-artifact@v3
206         with:
207           name: msvc-${{ matrix.config.arch }}
208           path: artifact/