forked from efroemling/ballistica
-
Notifications
You must be signed in to change notification settings - Fork 0
120 lines (113 loc) · 4.45 KB
/
ci.yml
File metadata and controls
120 lines (113 loc) · 4.45 KB
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
name: CI
on:
# Run on pushes, pull-requests, and also once per day
# (in case deps change under us, etc.)
push:
pull_request:
schedule:
# Note: '*' is a special character in YAML so we have to quote the str.
- cron: "0 12 * * *"
jobs:
# We run most of our testing only on linux but it should apply to mac too;
# we can always add an explicit mac job later if it seems worthwhile.
check_linux:
runs-on: ubuntu-latest
steps:
- uses: actions/checkout@v6
- name: Setup build env
uses: ./.github/actions/bombsquad_build_env
with:
using-cmake: true
- name: Run checks
run: BA_PCOMMANDBATCH_BUILD_REQUIRE=1 make check-ex
- name: Verify asset-package pins are prod
# Defense in depth: the upstream blessing/preflight gate
# in ballistica-internal also refuses non-prod pins, but
# re-check here so a stray dev/test pin in the public
# tree fails CI loudly rather than shipping.
run: tools/pcommand assetpins check
# Compile a server binary and run some tests.
build_and_test_linux:
runs-on: ubuntu-latest
steps:
- uses: actions/checkout@v6
- name: Setup build env
uses: ./.github/actions/bombsquad_build_env
with:
using-cmake: true
- name: Assemble monolithic server build
run: make cmake-server-build
- name: Run tests
run: BA_PCOMMANDBATCH_BUILD_REQUIRE=1 make test-ex
# Test spinoff projects - versions of the project with feature-sets
# added or removed or other changes made.
# (How ballisticakit becomes bombsquad/etc.)
spinoff_test_linux:
runs-on: ubuntu-latest
steps:
- uses: actions/checkout@v6
- name: Setup build env
uses: ./.github/actions/bombsquad_build_env
# Not using the `using-cmake: true`
# because it doesn't benifit from the cache
# as it sets up a new project dir
#
# with:
# using-cmake: true
- name: Build spinoff project with only core featureset
run: make spinoff-test-core
- name: Build spinoff project with core and base featuresets
run: make spinoff-test-base
# Test spinoff feature-set copy functionality.
# Make a copy of the template feature-set and build with it included.
# Also take the opportunity to test a modular build (we did monolithic above).
feature_set_copy_test_linux:
runs-on: ubuntu-latest
steps:
- uses: actions/checkout@v6
- name: Setup build env
uses: ./.github/actions/bombsquad_build_env
with:
using-cmake: true
- name: Create poo feature-set
run: tools/spinoff fset-copy template_fs poo
- name: Add new feature-set to project
run: make update
- name: Assemble modular server build
run: make cmake-modular-server-build
- name: Make sure poo is present in build
run: cd build/cmake/modular-server-debug/staged/dist && PYTHONPATH=ba_data/python ./ballisticakit_headless -c "import baenv; baenv.configure(); import bapoo; print(bapoo)"
# Most of our toolset doesn't work on raw Windows without WSL set up,
# but we can bootstrap enough to run a few things manually. It's nice to
# run unit tests there since some behavior (filesystem, etc) can vary
# significantly between windows and linux/apple. We also are able to
# build our windows binary.
build_and_test_windows:
runs-on: windows-2022
steps:
- uses: actions/checkout@v6
- name: Set up Python
uses: actions/setup-python@v6
with:
python-version: "3.13"
# The Windows job doesn't go through ``make env``, so it
# doesn't get the uv-built project venv. We still want uv
# available for the ad-hoc dependency install below — same
# action as the Linux composite, with --system installs to
# avoid the venv layer.
- name: Set up uv
uses: astral-sh/setup-uv@v6
with:
enable-cache: true
- name: Create tools/pcommand
run: |
$env:PYTHONPATH = "tools"
python -m efrotools.genwrapper pcommand batools.pcommandmain tools/pcommand
- name: Install dependencies
run: |
uv pip install --system pytest typing_extensions urllib3 websockets
python tools/pcommand win_ci_install_prereqs
- name: Compile binary
run: python tools/pcommand win_ci_binary_build
- name: Run tests
run: python tools/pcommand pytest -v tests