11name : CMake
2+ concurrency :
3+ group : build-${{ github.ref }}
4+ cancel-in-progress : true
25
36on :
47 push :
@@ -12,49 +15,46 @@ jobs:
1215 fail-fast : false
1316 matrix :
1417 arch : [x64]
15- os : [ubuntu-18 .04, ubuntu-latest ]
18+ os : [ubuntu-20 .04, ubuntu-22.04 ]
1619 compiler : [gcc, clang]
1720 runs-on : ${{ matrix.os }}
18-
21+ env :
22+ MATRIX_COMPILER : ${{matrix.compiler}}
23+ MATRIX_OS : ${{matrix.os}}
1924 steps :
20- - uses : actions/checkout@v2
21-
25+ - uses : actions/checkout@v3
2226 - name : Get dependencies
2327 run : |
24- sudo apt update
28+ sudo apt-get update && sudo apt-get upgrade
2529 sudo mk/linux/setupBuildDeps.sh
26-
27- - name : Bulid MegaGlest With GCC Compiler
28- if : ${{ matrix.compiler == 'gcc' }}
29- env :
30- CC : gcc
31- CXX : g++
32- run : mk/linux/build-mg.sh
30+ - name : Build
31+ run : |
32+ if [ "${MATRIX_COMPILER}" = "clang" ]; then
33+ EXTRA_OPTS="-f"
34+ fi
35+ mk/linux/build-mg.sh -m -d ${EXTRA_OPTS}
36+ make -C mk/linux/build -j$(nproc) VERBOSE=1
3337
34- - name : Bulid MegaGlest With Clang Compiler
35- if : ${{ matrix.compiler == 'clang' }}
36- env :
37- CC : clang
38- CXX : clang++
39- run : mk/linux/build-mg.sh
40-
41- - name : Prepare Snapshot
42- if : ${{ matrix.compiler == 'gcc' && matrix.os == 'ubuntu-latest' }}
38+ build-linux-other :
39+ strategy :
40+ fail-fast : false
41+ matrix :
42+ compiler : [10, 12] # 11 is on 22.04 by default, tested above
43+ runs-on : ubuntu-22.04
44+ env :
45+ CC : gcc-${{matrix.compiler}}
46+ CXX : g++-${{matrix.compiler}}
47+ steps :
48+ - uses : actions/checkout@v3
49+ - name : Get dependencies
4350 run : |
44- cp mk/shared/*.ini mk/linux/
45- strip -g mk/linux/megaglest mk/linux/megaglest_editor mk/linux/megaglest_g3dviewer
46-
47- - name : Create Mega Glest Snapshot
48- if : ${{ matrix.compiler == 'gcc' && matrix.os == 'ubuntu-latest' }}
49- uses : actions/upload-artifact@v2
50- with :
51- name : megaglest-${{ matrix.arch }}-${{ matrix.os }}-${{ matrix.compiler }}
52- path : |
53- mk/linux/megaglest
54- mk/linux/megaglest_editor
55- mk/linux/megaglest_g3dviewer
56- mk/linux/*.ini
57- !mk/linux/glest-dev.ini
51+ sudo apt-get update && sudo apt-get upgrade
52+ sudo apt-get install -y $CXX
53+ sudo mk/linux/setupBuildDeps.sh
54+ - name : Build
55+ run : |
56+ mk/linux/build-mg.sh -d -m
57+ make -C mk/linux/build -j$(nproc) VERBOSE=1
5858
5959 build-win64 :
6060 # The CMake configure and build commands are platform agnostic and should work equally
@@ -72,16 +72,16 @@ jobs:
7272 runs-on : windows-latest
7373
7474 steps :
75- - uses : actions/checkout@v2
76-
75+ - uses : actions/checkout@v3
76+
7777 - name : Cache Vcpkg Libs
7878 uses : actions/cache@v2
7979 env :
8080 cache-name : cache-vcpkg-deps
8181 with :
8282 path : c:/vcpkg/installed
8383 key : vcpkg-deps
84-
84+
8585 - name : Install Dependencies
8686 run : |
8787 vcpkg integrate install
@@ -121,15 +121,15 @@ jobs:
121121 - name : Build Mega Glest
122122 # Build your program with the given configuration
123123 run : cmake --build ${{github.workspace}}/build --config Release --target ALL_BUILD
124-
124+
125125 - name : Prepare Snapshot
126126 run : |
127127 cd mk/windoze
128128 cp ..\shared\*.ini .
129129 $7zPath = $(Get-Command 7z).Source
130130 cp $7zPath .
131131 cd ../..
132-
132+
133133 - name : Create Mega Glest Snapshot
134134 uses : actions/upload-artifact@v2
135135 with :
@@ -154,7 +154,7 @@ jobs:
154154 # - name: Get dependencies
155155 # run: |
156156 # brew install pkg-config cmake sdl2 lua jpeg libpng freetype ftgl libogg glew libvorbis cppunit fribidi miniupnpc curl wxmac xquartz zstd xml2 openldap
157-
157+
158158 # - name: Bulid MegaGlest With Clang Compiler
159159 # if: ${{ matrix.compiler == 'clang' }}
160160 # env:
@@ -166,6 +166,6 @@ jobs:
166166 # mk/macos/build-mg.sh
167167 # - name: Test
168168 # working-directory: ${{github.workspace}}/build
169- # Execute tests defined by the CMake configuration.
169+ # Execute tests defined by the CMake configuration.
170170 # See https://cmake.org/cmake/help/latest/manual/ctest.1.html for more detail
171171 # run: ctest -C ${{env.BUILD_TYPE}}
0 commit comments