-
Notifications
You must be signed in to change notification settings - Fork 181
138 lines (135 loc) · 4.57 KB
/
cicd.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
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
124
125
126
127
128
129
130
131
132
133
134
135
136
137
138
---
name: CI/CD
on:
push:
branches:
- master
pull_request:
jobs:
linux:
name: Linux
runs-on: ubuntu-latest
steps:
- name: Update apt index
run: sudo apt-get update -qq
- name: Install SDL2
run: sudo apt-get install libsdl2-dev
- name: Checkout EmptyEpsilon
uses: actions/checkout@v2
- name: Build and test
run: docker/build.sh
windows-cross:
name: Windows (Cross-Compile)
runs-on: ubuntu-latest
steps:
- name: Dependencies
run: |
sudo apt update -qq
sudo apt install build-essential cmake python3-minimal mingw-w64 ninja-build p7zip-full
- name: SeriousProton Checkout
uses: actions/checkout@v2
with:
repository: daid/SeriousProton
path: SeriousProton
ref: master
- name: EmptyEpsilon Checkout
uses: actions/checkout@v2
with:
path: EmptyEpsilon
- name: Build
run: |
mkdir -p _build_win32
cd _build_win32
cmake ../EmptyEpsilon -G Ninja -DCMAKE_MAKE_PROGRAM=ninja -DCMAKE_TOOLCHAIN_FILE=../EmptyEpsilon/cmake/mingw.toolchain -DSERIOUS_PROTON_DIR=../SeriousProton -DWARNING_IS_ERROR=1
ninja package
macos:
name: MacOS
runs-on: macos-latest
steps:
- name: Dependencies
run: brew install cmake sdl2 ninja
- name: SeriousProton Checkout
uses: actions/checkout@v2
with:
repository: daid/SeriousProton
path: SeriousProton
ref: master
- name: EmptyEpsilon Checkout
uses: actions/checkout@v2
with:
path: EmptyEpsilon
- name: Build
run: |
mkdir -p _build_macos
cd _build_macos
cmake ../EmptyEpsilon -G Ninja -DSERIOUS_PROTON_DIR=../SeriousProton -DCMAKE_INSTALL_PREFIX=. -DWARNING_IS_ERROR=1
ninja
ninja install
windows:
name: Windows
runs-on: windows-latest
strategy:
matrix:
build_type: [Debug, RelWithDebInfo, Release]
steps:
- name: Dependencies
run: |
$sdl_version = "2.0.16"
$sdl_link = "https://libsdl.org/release/SDL2-devel-$sdl_version-VC.zip"
$sdl_zip = "$env:GITHUB_WORKSPACE/sdl-dev.zip"
(new-object System.Net.WebClient).DownloadFile($sdl_link, $sdl_zip)
Expand-Archive -LiteralPath $sdl_zip -DestinationPath "$env:GITHUB_WORKSPACE/externals"
$sdl_config = @"
set(flavor x86)
if(CMAKE_SIZEOF_VOID_P EQUAL 8)
set(flavor x64)
endif()
set(_SDL2_prefix "`${CMAKE_CURRENT_LIST_DIR}/SDL2-$sdl_version")
add_library(SDL2::SDL2main STATIC IMPORTED)
set_target_properties(SDL2::SDL2main PROPERTIES
IMPORTED_LOCATION "`${_SDL2_prefix}/lib/`${flavor}/SDL2main.lib"
)
add_library(SDL2::SDL2 SHARED IMPORTED)
set_target_properties(SDL2::SDL2 PROPERTIES
IMPORTED_LOCATION "`${_SDL2_prefix}/lib/`${flavor}/SDL2.dll"
IMPORTED_IMPLIB "`${_SDL2_prefix}/lib/`${flavor}/SDL2.lib"
INTERFACE_INCLUDE_DIRECTORIES "`${_SDL2_prefix}/include"
)
target_link_libraries(SDL2::SDL2 INTERFACE SDL2::SDL2main)
"@
Set-Content -Path "$env:GITHUB_WORKSPACE/externals/sdl2-config.cmake" -Value $sdl_config
Get-Content "$env:GITHUB_WORKSPACE/externals/sdl2-config.cmake"
- name: EmptyEpsilon Checkout
uses: actions/checkout@v2
with:
path: EmptyEpsilon
- name: SeriousProton Checkout
uses: actions/checkout@v2
with:
repository: daid/SeriousProton
path: SeriousProton
ref: master
- name: Create Build Environment
run: cmake -E make_directory ${{github.workspace}}/build
- name: Configure CMake
working-directory: ${{github.workspace}}/build
run: >
cmake ../EmptyEpsilon
-G "Visual Studio 17 2022" -A Win32
-DSDL2_DIR:PATH="$env:GITHUB_WORKSPACE/externals"
-DSERIOUS_PROTON_DIR="../SeriousProton"
- name: Build
working-directory: ${{github.workspace}}/build
run: cmake --build . --config ${{ matrix.build_type }} --target package
luatest:
name: LuaTest
runs-on: ubuntu-latest
steps:
- name: Update apt index
run: sudo apt-get update -qq
- name: Install dependencies
run: sudo apt-get install lua5.3
- name: Checkout EmptyEpsilon
uses: actions/checkout@v2
- name: Test if lua scripts parse
run: find scripts/ -iname "*.lua" | xargs -P 4 -n 1 luac -p