]> git.lizzy.rs Git - minetest.git/blob - .github/workflows/build.yml
Fully remove bitmap font support (#11863)
[minetest.git] / .github / workflows / build.yml
1 name: build
2
3 # build on c/cpp changes or workflow changes
4 on:
5   push:
6     paths:
7       - 'lib/**.[ch]'
8       - 'lib/**.cpp'
9       - 'src/**.[ch]'
10       - 'src/**.cpp'
11       - '**/CMakeLists.txt'
12       - 'cmake/Modules/**'
13       - 'util/buildbot/**'
14       - 'util/ci/**'
15       - '.github/workflows/**.yml'
16       - 'Dockerfile'
17       - '.dockerignore'
18   pull_request:
19     paths:
20       - 'lib/**.[ch]'
21       - 'lib/**.cpp'
22       - 'src/**.[ch]'
23       - 'src/**.cpp'
24       - '**/CMakeLists.txt'
25       - 'cmake/Modules/**'
26       - 'util/buildbot/**'
27       - 'util/ci/**'
28       - '.github/workflows/**.yml'
29       - 'Dockerfile'
30       - '.dockerignore'
31
32 jobs:
33   # This is our minor gcc compiler
34   gcc_6:
35     runs-on: ubuntu-18.04
36     steps:
37       - uses: actions/checkout@v2
38       - name: Install deps
39         run: |
40           source ./util/ci/common.sh
41           install_linux_deps g++-6
42
43       - name: Build
44         run: |
45           ./util/ci/build.sh
46         env:
47           CC: gcc-6
48           CXX: g++-6
49
50       - name: Test
51         run: |
52           ./bin/minetest --run-unittests
53
54   # This is the current gcc compiler (available in bionic)
55   gcc_8:
56     runs-on: ubuntu-18.04
57     steps:
58       - uses: actions/checkout@v2
59       - name: Install deps
60         run: |
61           source ./util/ci/common.sh
62           install_linux_deps g++-8
63
64       - name: Build
65         run: |
66           ./util/ci/build.sh
67         env:
68           CC: gcc-8
69           CXX: g++-8
70
71       - name: Test
72         run: |
73           ./bin/minetest --run-unittests
74
75   # This is our minor clang compiler
76   clang_3_9:
77     runs-on: ubuntu-18.04
78     steps:
79       - uses: actions/checkout@v2
80       - name: Install deps
81         run: |
82           source ./util/ci/common.sh
83           install_linux_deps clang-3.9 gdb
84
85       - name: Build
86         run: |
87           ./util/ci/build.sh
88         env:
89           CC: clang-3.9
90           CXX: clang++-3.9
91
92       - name: Unittest
93         run: |
94           ./bin/minetest --run-unittests
95
96       - name: Integration test + devtest
97         run: |
98           ./util/test_multiplayer.sh
99
100   # This is the current clang version
101   clang_9:
102     runs-on: ubuntu-18.04
103     steps:
104       - uses: actions/checkout@v2
105       - name: Install deps
106         run: |
107           source ./util/ci/common.sh
108           install_linux_deps clang-9 valgrind libluajit-5.1-dev
109
110       - name: Build
111         run: |
112           ./util/ci/build.sh
113         env:
114           CC: clang-9
115           CXX: clang++-9
116           CMAKE_FLAGS: "-DREQUIRE_LUAJIT=1"
117
118       - name: Test
119         run: |
120           ./bin/minetest --run-unittests
121
122       - name: Valgrind
123         run: |
124           valgrind --leak-check=full --leak-check-heuristics=all --undef-value-errors=no --error-exitcode=9 ./bin/minetest --run-unittests
125
126   # Build with prometheus-cpp (server-only)
127   clang_9_prometheus:
128     name: "clang_9 (PROMETHEUS=1)"
129     runs-on: ubuntu-18.04
130     steps:
131       - uses: actions/checkout@v2
132       - name: Install deps
133         run: |
134           source ./util/ci/common.sh
135           install_linux_deps --old-irr clang-9
136
137       - name: Build prometheus-cpp
138         run: |
139           ./util/ci/build_prometheus_cpp.sh
140
141       - name: Build
142         run: |
143           ./util/ci/build.sh
144         env:
145           CC: clang-9
146           CXX: clang++-9
147           CMAKE_FLAGS: "-DENABLE_PROMETHEUS=1 -DBUILD_CLIENT=0"
148
149       - name: Test
150         run: |
151           ./bin/minetestserver --run-unittests
152
153   docker:
154     name: "Docker image"
155     runs-on: ubuntu-18.04
156     steps:
157       - uses: actions/checkout@v2
158       - name: Build docker image
159         run: |
160           docker build . -t minetest:latest
161           docker run --rm minetest:latest /usr/local/bin/minetestserver --version
162
163   win32:
164     name: "MinGW cross-compiler (32-bit)"
165     runs-on: ubuntu-18.04
166     steps:
167       - uses: actions/checkout@v2
168       - name: Install compiler
169         run: |
170           sudo apt-get update -q && sudo apt-get install gettext -qyy
171           wget http://minetest.kitsunemimi.pw/mingw-w64-i686_9.2.0_ubuntu18.04.tar.xz -O mingw.tar.xz
172           sudo tar -xaf mingw.tar.xz -C /usr
173
174       - name: Build
175         run: |
176            EXISTING_MINETEST_DIR=$PWD ./util/buildbot/buildwin32.sh winbuild
177         env:
178           NO_MINETEST_GAME: 1
179           NO_PACKAGE: 1
180
181   win64:
182     name: "MinGW cross-compiler (64-bit)"
183     runs-on: ubuntu-18.04
184     steps:
185       - uses: actions/checkout@v2
186       - name: Install compiler
187         run: |
188           sudo apt-get update -q && sudo apt-get install gettext -qyy
189           wget http://minetest.kitsunemimi.pw/mingw-w64-x86_64_9.2.0_ubuntu18.04.tar.xz -O mingw.tar.xz
190           sudo tar -xaf mingw.tar.xz -C /usr
191
192       - name: Build
193         run: |
194           EXISTING_MINETEST_DIR=$PWD ./util/buildbot/buildwin64.sh winbuild
195         env:
196           NO_MINETEST_GAME: 1
197           NO_PACKAGE: 1
198
199   msvc:
200     name: VS 2019 ${{ matrix.config.arch }}-${{ matrix.type }}
201     runs-on: windows-2019
202     #### Disabled due to Irrlicht switch
203     if: false
204     #### Disabled due to Irrlicht switch
205     env:
206       VCPKG_VERSION: 0bf3923f9fab4001c00f0f429682a0853b5749e0
207 #                    2020.11
208       vcpkg_packages: irrlicht zlib zstd curl[winssl] openal-soft libvorbis libogg sqlite3 freetype luajit
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           - {
219               arch: x64,
220               generator: "-G'Visual Studio 16 2019' -A x64",
221               vcpkg_triplet: x64-windows
222             }
223         type: [portable]
224 #        type: [portable, installer]
225 # The installer type is working, but disabled, to save runner jobs.
226 # Enable it, when working on the installer.
227
228     steps:
229       - name: Checkout
230         uses: actions/checkout@v2
231
232       - name: Restore from cache and run vcpkg
233         uses: lukka/run-vcpkg@v5
234         with:
235           vcpkgArguments: ${{env.vcpkg_packages}}
236           vcpkgDirectory: '${{ github.workspace }}\vcpkg'
237           appendedCacheKey: ${{ matrix.config.vcpkg_triplet }}
238           vcpkgGitCommitId: ${{ env.VCPKG_VERSION }}
239           vcpkgTriplet: ${{ matrix.config.vcpkg_triplet }}
240
241       - name: CMake
242         run: |
243           cmake ${{matrix.config.generator}}  `
244           -DCMAKE_TOOLCHAIN_FILE="${{ github.workspace }}\vcpkg\scripts\buildsystems\vcpkg.cmake"  `
245           -DCMAKE_BUILD_TYPE=Release  `
246           -DENABLE_POSTGRESQL=OFF  `
247           -DRUN_IN_PLACE=${{ contains(matrix.type, 'portable') }} .
248
249       - name: Build
250         run: cmake --build . --config Release
251
252       - name: CPack
253         run: |
254           If ($env:TYPE -eq "installer")
255           {
256             cpack -G WIX -B "$env:GITHUB_WORKSPACE\Package"
257           }
258           ElseIf($env:TYPE -eq "portable")
259           {
260             cpack -G ZIP -B "$env:GITHUB_WORKSPACE\Package"
261           }
262         env:
263           TYPE: ${{matrix.type}}
264
265       - name: Package Clean
266         run: rm -r $env:GITHUB_WORKSPACE\Package\_CPack_Packages
267
268       - uses: actions/upload-artifact@v1
269         with:
270           name: msvc-${{ matrix.config.arch }}-${{ matrix.type }}
271           path: .\Package\