-
Notifications
You must be signed in to change notification settings - Fork 12
112 lines (93 loc) · 3.11 KB
/
pull-request-ci-test.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
# Builds when a PR is opened.
name: PR Compile Test
on: pull_request
jobs:
build:
name: Build for ${{ matrix.os_short }} using sm-${{ matrix.sm_branch }}
runs-on: ${{ matrix.os }}
strategy:
fail-fast: false
matrix:
os:
- ubuntu-22.04
- windows-latest
include:
- meta_branch: "1.11-dev"
sm_branch: "1.11-dev"
spcomp_version: "1.11.x"
- os: ubuntu-22.04
os_short: linux
package_ext: tar.gz
- os: windows-latest
os_short: win
package_ext: zip
steps:
- name: Prepare env
shell: bash
run: |
echo "GITHUB_SHA_SHORT=${GITHUB_SHA::7}" >> $GITHUB_ENV
- name: Install (Linux)
if: runner.os == 'Linux'
run: |
sudo dpkg --add-architecture i386
sudo apt-get update
sudo apt-get install -y clang g++-multilib
echo "CC=clang" >> $GITHUB_ENV
echo "CXX=clang++" >> $GITHUB_ENV
- name: Add msbuild to PATH (Windows)
if: runner.os == 'Windows'
uses: microsoft/setup-msbuild@v2
- name: Install (Windows)
if: runner.os == 'Windows'
shell: cmd
run: |
:: See https://github.com/microsoft/vswhere/wiki/Find-VC
for /f "usebackq delims=*" %%i in (`vswhere -latest -property installationPath`) do (
call "%%i"\Common7\Tools\vsdevcmd.bat -arch=x86 -host_arch=x64
)
:: Loop over all environment variables and make them global.
for /f "delims== tokens=1,2" %%a in ('set') do (
echo>>"%GITHUB_ENV%" %%a=%%b
)
- name: Fetch Metamod:Source ${{ matrix.meta_branch }}
uses: actions/checkout@v4
with:
repository: alliedmodders/metamod-source
ref: ${{ matrix.meta_branch }}
path: mmsource
- name: Fetch SourceMod ${{ matrix.sm_branch }}
uses: actions/checkout@v4
with:
repository: alliedmodders/sourcemod
ref: ${{ matrix.sm_branch }}
path: sourcemod
submodules: recursive
- name: Checkout AMBuild
uses: actions/checkout@v4
with:
repository: alliedmodders/ambuild
path: ambuild
- name: Set up Python
uses: actions/setup-python@v5
with:
python-version: '3.x'
- name: Set up spcomp
uses: rumblefrog/setup-sp@v1.2.2
with:
version: ${{ matrix.spcomp_version }}
no-spcomp-proxy: true
- name: Checkout ambuild
run: |
python -m pip install wheel
pip install git+https://github.com/alliedmodders/ambuild
- name: Checkout project
uses: actions/checkout@v4
with:
path: src
- name: Build Files
working-directory: src
run: |
mkdir build
cd build
python3 ../configure.py --sm-path="${{ github.workspace }}/sourcemod" --mms-path="${{ github.workspace }}/mmsource" --symbol-files --enable-optimize
ambuild