]> git.lizzy.rs Git - dragonfireclient.git/blob - .github/workflows/build.yml
2c4d3abd1e0e78acbbb49825bb048c09b430a3bf
[dragonfireclient.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   pull_request:
17     paths:
18       - 'lib/**.[ch]'
19       - 'lib/**.cpp'
20       - 'src/**.[ch]'
21       - 'src/**.cpp'
22       - '**/CMakeLists.txt'
23       - 'cmake/Modules/**'
24       - 'util/buildbot/**'
25       - 'util/ci/**'
26       - '.github/workflows/**.yml'
27
28 jobs:
29   # This is our minor gcc compiler
30   gcc_6:
31     runs-on: ubuntu-18.04
32     steps:
33       - uses: actions/checkout@v2
34       - name: Install compiler
35         run: |
36           sudo apt-get install g++-6 gcc-6 -qyy
37           source ./util/ci/common.sh
38           install_linux_deps
39
40       - name: Build
41         run: |
42           ./util/ci/build.sh
43         env:
44           CMAKE_FLAGS: "-DCMAKE_C_COMPILER=gcc-6 -DCMAKE_CXX_COMPILER=g++-6"
45
46       - name: Test
47         run: |
48           ./bin/minetest --run-unittests
49
50   # This is the current gcc compiler (available in bionic)
51   gcc_8:
52     runs-on: ubuntu-18.04
53     steps:
54       - uses: actions/checkout@v2
55       - name: Install compiler
56         run: |
57           sudo apt-get install g++-8 gcc-8 -qyy
58           source ./util/ci/common.sh
59           install_linux_deps
60
61       - name: Build
62         run: |
63           ./util/ci/build.sh
64         env:
65           CMAKE_FLAGS: "-DCMAKE_C_COMPILER=gcc-8 -DCMAKE_CXX_COMPILER=g++-8"
66
67       - name: Test
68         run: |
69           ./bin/minetest --run-unittests
70
71   # This is our minor clang compiler
72   clang_3_9:
73     runs-on: ubuntu-18.04
74     steps:
75       - uses: actions/checkout@v2
76       - name: Install compiler
77         run: |
78           sudo apt-get install clang-3.9 -qyy
79           source ./util/ci/common.sh
80           install_linux_deps
81
82       - name: Build
83         run: |
84           ./util/ci/build.sh
85         env:
86           CMAKE_FLAGS: "-DCMAKE_C_COMPILER=clang-3.9 -DCMAKE_CXX_COMPILER=clang++-3.9"
87
88       - name: Test
89         run: |
90           ./bin/minetest --run-unittests
91
92   # This is the current clang version
93   clang_9:
94     runs-on: ubuntu-18.04
95     steps:
96       - uses: actions/checkout@v2
97       - name: Install compiler
98         run: |
99           sudo apt-get install clang-9 valgrind -qyy
100           source ./util/ci/common.sh
101           install_linux_deps
102         env:
103           WITH_LUAJIT: 1
104
105       - name: Build
106         run: |
107           ./util/ci/build.sh
108         env:
109           CMAKE_FLAGS: "-DCMAKE_C_COMPILER=clang-9 -DCMAKE_CXX_COMPILER=clang++-9"
110
111       - name: Test
112         run: |
113           ./bin/minetest --run-unittests
114
115       - name: Valgrind
116         run: |
117           valgrind --leak-check=full --leak-check-heuristics=all --undef-value-errors=no --error-exitcode=9 ./bin/minetest --run-unittests
118
119
120   clang_9_prometheus:
121     runs-on: ubuntu-18.04
122     steps:
123       - uses: actions/checkout@v2
124       - name: Install compiler
125         run: |
126           sudo apt-get install clang-9 -qyy
127           source ./util/ci/common.sh
128           install_linux_deps
129
130       - name: Build prometheus-cpp
131         run: |
132           ./util/ci/build_prometheus_cpp.sh
133
134       - name: Build
135         run: |
136           ./util/ci/build.sh
137         env:
138           CMAKE_FLAGS: "-DCMAKE_C_COMPILER=clang-9 -DCMAKE_CXX_COMPILER=clang++-9 -DENABLE_PROMETHEUS=1"
139
140       - name: Test
141         run: |
142           ./bin/minetest --run-unittests
143
144   # Some builds doesn't require freetype, ensure it compiled properly
145   clang_9_no_freetype:
146     runs-on: ubuntu-18.04
147     steps:
148       - uses: actions/checkout@v2
149       - name: Install compiler
150         run: |
151           sudo apt-get install clang-9 -qyy
152           source ./util/ci/common.sh
153           install_linux_deps
154
155       - name: Build
156         run: |
157           ./util/ci/build.sh
158         env:
159           CMAKE_FLAGS: "-DCMAKE_C_COMPILER=clang-9 -DCMAKE_CXX_COMPILER=clang++-9 -DENABLE_FREETYPE=0"
160
161       - name: Test
162         run: |
163           ./bin/minetest --run-unittests
164
165   docker:
166     runs-on: ubuntu-18.04
167     steps:
168       - uses: actions/checkout@v2
169       - name: Build docker image
170         run: |
171           docker build .
172
173   win32:
174     runs-on: ubuntu-18.04
175     steps:
176       - uses: actions/checkout@v2
177       - name: Install compiler
178         run: |
179           wget http://minetest.kitsunemimi.pw/mingw-w64-i686_9.2.0_ubuntu18.04.tar.xz -O mingw.tar.xz
180           sudo tar -xaf mingw.tar.xz -C /usr
181
182       - name: Build
183         run: |
184            EXISTING_MINETEST_DIR=$PWD ./util/buildbot/buildwin32.sh winbuild
185         env:
186           NO_MINETEST_GAME: 1
187           NO_PACKAGE: 1
188
189   win64:
190     runs-on: ubuntu-18.04
191     steps:
192       - uses: actions/checkout@v2
193       - name: Install compiler
194         run: |
195           wget http://minetest.kitsunemimi.pw/mingw-w64-x86_64_9.2.0_ubuntu18.04.tar.xz -O mingw.tar.xz
196           sudo tar -xaf mingw.tar.xz -C /usr
197
198       - name: Build
199         run: |
200           EXISTING_MINETEST_DIR=$PWD ./util/buildbot/buildwin64.sh winbuild
201         env:
202           NO_MINETEST_GAME: 1
203           NO_PACKAGE: 1