-
-
Notifications
You must be signed in to change notification settings - Fork 60
94 lines (91 loc) · 2.9 KB
/
ci.yml
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
name: CI
on:
push:
branches: [ master ]
pull_request:
branches: [ master ]
env:
EM_VERSION: 2.0.13
EM_CACHE_DIR: 'emsdk-cache'
jobs:
clang_format_check:
runs-on: ubuntu-20.04
steps:
- uses: actions/checkout@v3
- uses: DoozyX/[email protected]
with:
source: 'benchmark src test'
extensions: 'hpp,cpp,ipp'
clangFormatVersion: 11
build_wasm:
runs-on: ubuntu-20.04
steps:
- uses: actions/checkout@v3
with:
submodules: recursive
- name: Setup cache for Emscripten
id: cache-system-libraries
uses: actions/cache@v3
with:
path: ${{env.EM_CACHE_DIR}}
key: ${{env.EM_VERSION}}-${{ runner.os }}
- uses: mymindstorm/setup-emsdk@v11
with:
version: ${{env.EM_VERSION}}
actions-cache-folder: ${{env.EM_CACHE_DIR}}
- name: Setup cache for game data
id: cache-game-data
uses: actions/cache@v3
with:
path: DUKE2
key: duke2-shareware
- name: Fetch game data
run: bash -c '[ -d DUKE2 ] || (wget https://archive.org/download/msdos_DUKE2_shareware/DUKE2.zip && unzip DUKE2.zip)'
- name: Run CMake
run: emcmake cmake -H. -Bbuild_wasm -DCMAKE_BUILD_TYPE=Release -DWARNINGS_AS_ERRORS=ON -DWEBASSEMBLY_GAME_PATH=$(pwd)/DUKE2
- name: Build
run: make -j2 -Cbuild_wasm
- uses: actions/upload-artifact@v3
with:
name: wasm_build
path: build_wasm/src/RigelEngine.*
build_linux:
runs-on: ubuntu-20.04
steps:
- uses: actions/checkout@v3
with:
submodules: recursive
- name: Install dependencies
run: sudo ./docker/ubuntu-deps.sh
- name: Run CMake (debug)
run: CC=gcc-8 CXX=g++-8 cmake -H. -Bbuild_dbg -DCMAKE_BUILD_TYPE=Debug -DWARNINGS_AS_ERRORS=ON -DBUILD_TESTS=ON
- name: Run CMake (release)
run: CC=gcc-8 CXX=g++-8 cmake -H. -Bbuild -DCMAKE_BUILD_TYPE=Release -DWARNINGS_AS_ERRORS=ON -DBUILD_TESTS=ON -DBUILD_BENCHMARKS=ON
- name: Build (debug)
run: cd build_dbg && make -j2
- name: Build (release)
run: cd build && make -j2
- name: Test (debug)
run: cd build_dbg && ctest
- name: Test (release)
run: cd build && ctest
build_osx:
runs-on: macos-11
steps:
- uses: actions/checkout@v3
with:
submodules: recursive
- name: Install dependencies
run: brew install sdl2 sdl2_mixer
- name: Run CMake (debug)
run: cmake -H. -Bbuild_dbg -DCMAKE_BUILD_TYPE=Debug -DWARNINGS_AS_ERRORS=ON -DBUILD_TESTS=ON
- name: Run CMake (release)
run: cmake -H. -Bbuild -DCMAKE_BUILD_TYPE=Release -DWARNINGS_AS_ERRORS=ON -DBUILD_TESTS=ON -DBUILD_BENCHMARKS=ON
- name: Build (debug)
run: cd build_dbg && make -j2
- name: Build (release)
run: cd build && make -j2
- name: Test (debug)
run: cd build_dbg && ctest
- name: Test (release)
run: cd build_dbg && ctest