forked from alliedmodders/sourcepawn
-
Notifications
You must be signed in to change notification settings - Fork 0
86 lines (80 loc) · 2.51 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
name: Continuous Integration
on:
push:
branches:
- master
- 1.11-dev
pull_request:
branches:
- master
- 1.11-dev
jobs:
test:
strategy:
matrix:
os: [ubuntu-latest, windows-latest, macos-latest]
build_type: [optimize, debug]
build_target: [x86, x64]
# The macos builder has min. XCode 10.3, so no x86 builds.
exclude:
- os: macos-latest
build_target: x86
# Test if ARM compiles on windows.
include:
- os: windows-latest
build_type: optimize
build_target: arm
- os: windows-latest
build_type: debug
build_target: arm
- os: windows-latest
build_type: optimize
build_target: arm64
- os: windows-latest
build_type: debug
build_target: arm64
fail-fast: false
runs-on: ${{ matrix.os }}
steps:
- uses: actions/checkout@v3
with:
submodules: recursive
# Setup Python for AMBuild
- uses: actions/setup-python@v4
with:
python-version: 3.8
- name: Install AMBuild
run: |
python -m pip install --upgrade pip setuptools wheel
pip install git+https://github.com/alliedmodders/ambuild
- name: Select clang compiler
if: startsWith(runner.os, 'Linux') || startsWith(runner.os, 'macOS')
run: |
echo "CC=clang" >> $GITHUB_ENV
echo "CXX=clang++" >> $GITHUB_ENV
clang --version
clang++ --version
- name: Install Linux dependencies
if: startsWith(runner.os, 'Linux') && matrix.build_target == 'x86'
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
- name: Enable ASAN
if: startsWith(runner.os, 'Linux')
run: |
echo "ENABLE_ASAN=--enable-asan" >> $GITHUB_ENV
- name: Build
run: |
mkdir objdir
cd objdir
python ../configure.py --enable-${{ matrix.build_type }} --targets=${{ matrix.build_target }} $ENABLE_ASAN
ambuild
# Cannot run tests for ARM since the builder is amd64.
- name: Test
if: ${{ !startsWith(matrix.build_target, 'arm') }}
run: |
python tests/runtests.py objdir