-
-
Notifications
You must be signed in to change notification settings - Fork 203
137 lines (132 loc) · 4.95 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
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
name: Continuous Integration
on:
workflow_dispatch:
push:
branches:
- master
- 1.9-dev
pull_request:
branches:
- master
- 1.9-dev
jobs:
test:
strategy:
matrix:
include:
- os: ubuntu-latest
os_short: linux
compiler_cc: gcc
compiler_cxx: g++
- os: ubuntu-latest
os_short: linux
compiler_cc: clang
compiler_cxx: clang++
- os: ubuntu-18.04
os_short: linux
compiler_cc: clang-3.9
compiler_cxx: clang++-3.9
- os: ubuntu-18.04
os_short: linux
compiler_cc: gcc-6
compiler_cxx: g++-6
compiler_install: 'g++6 g++-6-multilib'
- os: windows-latest
os_short: windows
compiler_cc: msvc
- os: windows-2016
os_short: windows
compiler_cc: msvc++14.16-vs2017-cl
# MacOS 32 Bins seem not supported
# - os: macos-latest
# os_short: mac
# compiler_cc: clang
# compiler_cxx: clang++
fail-fast: false
runs-on: ${{ matrix.os }}
name: ${{ matrix.os_short }}-${{ matrix.os }}-${{ matrix.compiler_cc }}
env:
DEPENDENCIES_FOLDER: dependencies
DEPENDENCIES_ROOT: ${{ github.workspace }}/dependencies
DEPENDENCIES_ROOT_WIN: ${{ github.workspace }}\dependencies
steps:
- uses: actions/checkout@v2
with:
submodules: recursive
path: amxmodx
# Setup Python for AMBuild
- uses: actions/setup-python@v2
name: Setup Python 3.8
with:
python-version: 3.8
- name: Install Python dependencies
run: |
python3 -m pip install --upgrade pip setuptools wheel
python3 --version
- name: Install AMXModX dependencies (Linux)
if: startsWith(runner.os, 'Linux') || startsWith(runner.os, 'macOS')
shell: bash
run: |
mkdir -p ${{ env.DEPENDENCIES_FOLDER }}
cd ${{ env.DEPENDENCIES_FOLDER }}
# Satisfy checkout-deps requirement for a "amxmodx" folder.
mkdir -p amxmodx
../amxmodx/support/checkout-deps.sh
- name: Install AMXModX dependencies (Windows)
if: startsWith(runner.os, 'Windows')
shell: cmd
run: |
mkdir %DEPENDENCIES_ROOT_WIN%\nasm
curl -L -o "%DEPENDENCIES_ROOT_WIN%\nasm\nasm.zip" https://www.nasm.us/pub/nasm/releasebuilds/2.13.03/win32/nasm-2.13.03-win32.zip
chdir %DEPENDENCIES_ROOT_WIN%\nasm
7z x nasm.zip
chdir %DEPENDENCIES_ROOT_WIN%
git clone https://github.com/alliedmodders/ambuild
git clone https://github.com/alliedmodders/metamod-hl1 metamod-am
git clone https://github.com/alliedmodders/hlsdk
curl -L -o "mysql-connector-c-6.1.1-win32.zip" https://downloads.mysql.com/archives/get/p/19/file/mysql-connector-c-6.1.1-win32.zip
7z x mysql-connector-c-6.1.1-win32.zip -o"mysql"
cd mysql
dir
ren mysql-connector-c-6.1.1-win32 mysql-5.5
move /Y mysql-5.5 ..\
cd ..\ambuild
python3 setup.py install
- name: Install Linux dependencies
if: startsWith(runner.os, 'Linux')
run: |
sudo dpkg --add-architecture i386
sudo apt-get update
sudo apt-get install -y --no-install-recommends \
gcc-multilib g++-multilib libstdc++6 lib32stdc++6 \
libc6-dev libc6-dev-i386 linux-libc-dev \
linux-libc-dev:i386 lib32z1-dev nasm ${{ matrix.compiler_cc }} ${{ matrix.compiler_install }}
- name: Select compiler
if: startsWith(runner.os, 'Linux')
run: |
echo "CC=${{ matrix.compiler_cc }}" >> $GITHUB_ENV
echo "CXX=${{ matrix.compiler_cxx }}" >> $GITHUB_ENV
${{ matrix.compiler_cc }} --version
${{ matrix.compiler_cxx }} --version
- uses: ilammy/setup-nasm@v1
- name: Build Linux/macOS
if: startsWith(runner.os, 'Linux') || startsWith(runner.os, 'macOS')
working-directory: amxmodx
run: |
mkdir build
cd build
python3 ../configure.py --enable-optimize --metamod=${{ env.DEPENDENCIES_ROOT }}/metamod-am --hlsdk=${{ env.DEPENDENCIES_ROOT }}/hlsdk --mysql=${{ env.DEPENDENCIES_ROOT }}/mysql-5.5
ambuild
- uses: ilammy/msvc-dev-cmd@v1
with:
arch: x86
- name: Build Windows
if: startsWith(runner.os, 'Windows')
working-directory: amxmodx
shell: cmd
run: |
cl.exe
mkdir build
cd build
python3 ../configure.py --enable-optimize --metamod=${{ env.DEPENDENCIES_ROOT_WIN }}\metamod-am --hlsdk=${{ env.DEPENDENCIES_ROOT_WIN }}\hlsdk --mysql=${{ env.DEPENDENCIES_ROOT_WIN }}\mysql-5.5
ambuild