-
Notifications
You must be signed in to change notification settings - Fork 92
133 lines (123 loc) · 4.52 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
name: Continuous Integration
on:
push:
branches:
- master
- '[0-9]+.[0-9]+-dev'
pull_request:
branches:
- master
- '[0-9]+.[0-9]+-dev'
jobs:
test:
strategy:
matrix:
include:
- os: windows-latest
os_short: windows
compiler_cc: msvc-vs2022
- os: windows-2019
os_short: windows
compiler_cc: msvc-vs2019
- os: ubuntu-latest
os_short: linux
compiler_cc: clang
compiler_cxx: clang++
- os: ubuntu-20.04
os_short: linux
compiler_cc: clang-6.0
compiler_cxx: clang++-6.0
compiler_install: clang-6.0
fail-fast: false
runs-on: ${{ matrix.os }}
name: ${{ matrix.os_short }}-${{ matrix.compiler_cc }}
env:
SDKS: '["episode1","tf2","l4d2","csgo","dota"]'
DEPENDENCIES_FOLDER: dependencies
DEPENDENCIES_ROOT: ${{ github.workspace }}/dependencies
steps:
- uses: actions/checkout@v3
with:
submodules: recursive
path: metamod-source
- name: Select HL2SDKs
run: echo 'SDKS=["episode1","tf2","l4d2","cs2","insurgency"]' >> $GITHUB_ENV
- name: Cache dependencies
uses: actions/cache@v3
env:
cache-name: hl2sdk
with:
path: ${{ env.DEPENDENCIES_ROOT }}
key: ${{ runner.os }}-build-${{ env.cache-name }}-${{ join(fromJSON(env.SDKS), '') }}
restore-keys: ${{ runner.os }}-build-${{ env.cache-name }}-
# Setup Python for AMBuild
- uses: actions/setup-python@v4
name: Setup Python 3.12
with:
python-version: 3.12
- name: Install Python dependencies
run: |
python -m pip install --upgrade pip setuptools wheel
- name: Install dependencies
shell: bash
run: |
mkdir -p ${{ env.DEPENDENCIES_FOLDER }}
cd ${{ env.DEPENDENCIES_FOLDER }}
# Satisfy checkout-deps requirement for a "metamod-source" folder.
mkdir -p metamod-source
../metamod-source/support/checkout-deps.sh -s ${{ join(fromJSON(env.SDKS)) }}
- 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 ${{ matrix.compiler_install }}
- name: Select clang compiler
if: startsWith(runner.os, 'Linux') || startsWith(runner.os, 'macOS')
run: |
echo "CC=${{ matrix.compiler_cc }}" >> $GITHUB_ENV
echo "CXX=${{ matrix.compiler_cxx }}" >> $GITHUB_ENV
${{ matrix.compiler_cc }} --version
${{ matrix.compiler_cxx }} --version
- name: Build
working-directory: metamod-source
run: |
mkdir build
cd build
python ../configure.py --enable-optimize --sdks=${{ join(fromJSON(env.SDKS)) }} --hl2sdk-root=${{ env.DEPENDENCIES_ROOT }}
ambuild
- name: Test SourceHook (Optimized)
working-directory: metamod-source
shell: bash
# SourceHook tests are busted on Windows
continue-on-error: ${{ startsWith(runner.os, 'Windows') }}
run: |
mkdir build-sh-opt && cd build-sh-opt
python ../configure.py --enable-optimize --enable-tests --sdks=
ambuild
cd ./core/sourcehook/test/test_sourcehook
if [ -d "${{ matrix.os_short }}-x86" ]; then
./${{ matrix.os_short }}-x86/test_sourcehook -v
fi
if [ -d "${{ matrix.os_short }}-x86_64" ]; then
./${{ matrix.os_short }}-x86_64/test_sourcehook -v
fi
- name: Test SourceHook (Debug)
working-directory: metamod-source
shell: bash
# SourceHook tests are busted on Windows
continue-on-error: ${{ startsWith(runner.os, 'Windows') }}
run: |
mkdir build-sh-debug && cd build-sh-debug
python ../configure.py --enable-debug --enable-tests --sdks=
ambuild
cd ./core/sourcehook/test/test_sourcehook
if [ -d "${{ matrix.os_short }}-x86" ]; then
./${{ matrix.os_short }}-x86/test_sourcehook -v
fi
if [ -d "${{ matrix.os_short }}-x86_64" ]; then
./${{ matrix.os_short }}-x86_64/test_sourcehook -v
fi