Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
76 changes: 58 additions & 18 deletions .github/actions/bombsquad_build_env/action.yml
Original file line number Diff line number Diff line change
@@ -1,19 +1,23 @@
name: 'Setup BombSquad Environment'
description: 'Common setup steps for BombSquad builds'
name: "Setup BombSquad Environment"
description: "Common setup steps for BombSquad builds"

inputs:
using-cmake:
description: "Set to true if building with cmake to enable caching"
required: false
type: boolean
default: false

runs:
using: 'composite'
using: "composite"
steps:
- uses: actions/checkout@v4
- name: Cache Python venv
id: cache-venv
uses: actions/cache@v4
env:
cache-name: cache-python-venv
- uses: actions/checkout@v6
- name: Set up Python
uses: actions/setup-python@v5
with:
path: .venv
key: ${{ runner.os }}-${{runner.arch}}-${{ env.cache-name }}-${{ hashFiles('config/requirements.txt') }}
restore-keys: |
${{ runner.os }}-${{runner.arch}}-${{ env.cache-name }}-
python-version: "3.13"
cache: "pip"
cache-dependency-path: config/requirements.txt
- name: Cache Bombsquad assets
id: cache-assets
uses: actions/cache@v4
Expand All @@ -26,10 +30,46 @@ runs:
key: ${{ runner.os }}-${{ env.cache-name }}-${{ hashFiles('.efrocachemap') }}
restore-keys: |
${{ runner.os }}-${{ env.cache-name }}-
- name: Set up Python
uses: actions/setup-python@v5
with:
python-version: '3.13'
- name: Setup project environment
shell: bash
run: make env
shell: bash
- name: Update assets
shell: bash
run: |
make assets-cmake
make assets-windows
# Following steps only run for inputs.using-cmake == 'true'
- name: Install build packgages
if: ${{ inputs.using-cmake == 'true' }}
shell: bash
run: |
sudo add-apt-repository ppa:deadsnakes/ppa
sudo apt-get update -qq
sudo apt-get install -y --no-install-recommends \
build-essential \
clang \
clang-format \
cmake \
curl \
libglut-dev \
libopenal-dev \
libsdl2-dev \
libvorbis-dev \
make \
python3-pip \
python3.13-dev \
python3.13-venv \
rsync \
zstd
- name: Setup env variables
if: ${{ inputs.using-cmake == 'true' }}
shell: bash
run: |
echo "SCCACHE_GHA_ENABLED=true" >> $GITHUB_ENV
echo "BA_APP_RUN_ENABLE_BUILDS=1" >> $GITHUB_ENV
echo CMAKE_EXTRA_ARGS="-DCMAKE_C_COMPILER_LAUNCHER=sccache -DCMAKE_CXX_COMPILER_LAUNCHER=sccache" >> $GITHUB_ENV
- name: Setup sccache
if: ${{ inputs.using-cmake == 'true' }}
uses: mozilla-actions/[email protected]
with:
disable_annotations: true
37 changes: 15 additions & 22 deletions .github/workflows/cd.yml
Original file line number Diff line number Diff line change
Expand Up @@ -6,22 +6,22 @@ on:
pull_request:

jobs:
setup_bombsquad_cache:
make_linux_cmake:
runs-on: ubuntu-latest
steps:
- uses: actions/checkout@v4
- uses: actions/checkout@v6
- name: Setup build env
uses: ./.github/actions/bombsquad_build_env
with:
using-cmake: true
- name: Make the build
run: |
make assets-cmake
make assets-windows
make cmake-build

make_linux_x86_64_gui_debug_build:
needs: setup_bombsquad_cache
runs-on: ubuntu-latest
steps:
- uses: actions/checkout@v4
- uses: actions/checkout@v6
- name: Setup build env
uses: ./.github/actions/bombsquad_build_env
- name: Make the build
Expand All @@ -33,10 +33,9 @@ jobs:
path: build/prefab/full/linux_x86_64_gui

make_linux_x86_64_server_debug_build:
needs: setup_bombsquad_cache
runs-on: ubuntu-latest
steps:
- uses: actions/checkout@v4
- uses: actions/checkout@v6
- name: Setup build env
uses: ./.github/actions/bombsquad_build_env
- name: Make the build
Expand All @@ -48,10 +47,9 @@ jobs:
path: build/prefab/full/linux_x86_64_server

make_linux_arm64_gui_debug_build:
needs: setup_bombsquad_cache
runs-on: ubuntu-latest
steps:
- uses: actions/checkout@v4
- uses: actions/checkout@v6
- name: Setup build env
uses: ./.github/actions/bombsquad_build_env
- name: Make the build
Expand All @@ -63,10 +61,9 @@ jobs:
path: build/prefab/full/linux_arm64_gui

make_linux_arm64_server_debug_build:
needs: setup_bombsquad_cache
runs-on: ubuntu-latest
steps:
- uses: actions/checkout@v4
- uses: actions/checkout@v6
- name: Setup build env
uses: ./.github/actions/bombsquad_build_env
- name: Make the build
Expand All @@ -83,7 +80,7 @@ jobs:
# make_mac_x86_64_gui_debug_build:
# runs-on: ubuntu-latest
# steps:
# - uses: actions/checkout@v4
# - uses: actions/checkout@v6
# - name: Set up Python
# uses: actions/setup-python@v5
# with:
Expand All @@ -101,7 +98,7 @@ jobs:
# make_mac_x86_64_server_debug_build:
# runs-on: ubuntu-latest
# steps:
# - uses: actions/checkout@v4
# - uses: actions/checkout@v6
# - name: Set up Python
# uses: actions/setup-python@v5
# with:
Expand All @@ -117,10 +114,9 @@ jobs:
# path: build/prefab/full/mac_x86_64_server

make_mac_arm64_gui_debug_build:
needs: setup_bombsquad_cache
runs-on: ubuntu-latest
steps:
- uses: actions/checkout@v4
- uses: actions/checkout@v6
- name: Setup build env
uses: ./.github/actions/bombsquad_build_env
- name: Make the build
Expand All @@ -132,10 +128,9 @@ jobs:
path: build/prefab/full/mac_arm64_gui

make_mac_arm64_server_debug_build:
needs: setup_bombsquad_cache
runs-on: ubuntu-latest
steps:
- uses: actions/checkout@v4
- uses: actions/checkout@v6
- name: Setup build env
uses: ./.github/actions/bombsquad_build_env
- name: Make the build
Expand All @@ -147,10 +142,9 @@ jobs:
path: build/prefab/full/mac_arm64_server

make_windows_x86_64_gui_debug_build:
needs: setup_bombsquad_cache
runs-on: ubuntu-latest
steps:
- uses: actions/checkout@v4
- uses: actions/checkout@v6
- name: Setup build env
uses: ./.github/actions/bombsquad_build_env
- name: Make the build
Expand All @@ -162,10 +156,9 @@ jobs:
path: build/prefab/full/windows_x86_64_gui

make_windows_x86_64_server_debug_build:
needs: setup_bombsquad_cache
runs-on: ubuntu-latest
steps:
- uses: actions/checkout@v4
- uses: actions/checkout@v6
- name: Setup build env
uses: ./.github/actions/bombsquad_build_env
- name: Make the build
Expand Down
35 changes: 15 additions & 20 deletions .github/workflows/ci.yml
Original file line number Diff line number Diff line change
Expand Up @@ -12,35 +12,25 @@ on:
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.
setup_bombsquad_cache:
runs-on: ubuntu-latest
steps:
- uses: actions/checkout@v4
- name: Setup build env
uses: ./.github/actions/bombsquad_build_env
- name: Make the build
run: |
make assets-cmake
make assets-windows

check_linux:
needs: setup_bombsquad_cache
runs-on: ubuntu-latest
steps:
- uses: actions/checkout@v4
- uses: actions/checkout@v6
- name: Setup build env
uses: ./.github/actions/bombsquad_build_env
- name: Run checks
run: BA_PCOMMANDBATCH_BUILD_REQUIRE=1 make check

# Compile a server binary and run some tests.
build_and_test_linux:
needs: setup_bombsquad_cache
runs-on: ubuntu-latest
steps:
- uses: actions/checkout@v4
- 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
Expand All @@ -50,12 +40,17 @@ jobs:
# added or removed or other changes made.
# (How ballisticakit becomes bombsquad/etc.)
spinoff_test_linux:
needs: setup_bombsquad_cache
runs-on: ubuntu-latest
steps:
- uses: actions/checkout@v4
- 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
Expand All @@ -65,12 +60,13 @@ jobs:
# 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:
needs: setup_bombsquad_cache
runs-on: ubuntu-latest
steps:
- uses: actions/checkout@v4
- 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
Expand All @@ -86,10 +82,9 @@ jobs:
# significantly between windows and linux/apple. We also are able to
# build our windows binary.
build_and_test_windows:
needs: setup_bombsquad_cache
runs-on: windows-2022
steps:
- uses: actions/checkout@v4
- uses: actions/checkout@v6
- name: Set up Python
uses: actions/setup-python@v5
with:
Expand Down
6 changes: 3 additions & 3 deletions Makefile
Original file line number Diff line number Diff line change
Expand Up @@ -1150,7 +1150,7 @@ cmake-server-build: assets-server meta cmake-server-binary
cmake-server-binary: meta
@$(PCOMMAND) cmake_prep_dir build/cmake/server-$(CM_BT_LC)
@cd build/cmake/server-$(CM_BT_LC) && test -f Makefile \
|| cmake -DCMAKE_BUILD_TYPE=$(CMAKE_BUILD_TYPE) -DHEADLESS=true \
|| cmake -DCMAKE_BUILD_TYPE=$(CMAKE_BUILD_TYPE) $(CMAKE_EXTRA_ARGS) -DHEADLESS=true \
$(shell pwd)/ballisticakit-cmake
@tools/pcommand update_cmake_prefab_lib server $(CM_BT_LC) \
build/cmake/server-$(CM_BT_LC)
Expand All @@ -1172,7 +1172,7 @@ cmake-modular: cmake-modular-build
cmake-modular-binary: meta
@$(PCOMMAND) cmake_prep_dir build/cmake/modular-$(CM_BT_LC)
@cd build/cmake/modular-$(CM_BT_LC) && test -f Makefile \
|| cmake -DCMAKE_BUILD_TYPE=$(CMAKE_BUILD_TYPE) \
|| cmake -DCMAKE_BUILD_TYPE=$(CMAKE_BUILD_TYPE) $(CMAKE_EXTRA_ARGS) \
$(shell pwd)/ballisticakit-cmake
@tools/pcommand update_cmake_prefab_lib standard $(CM_BT_LC) \
build/cmake/modular-$(CM_BT_LC)
Expand All @@ -1194,7 +1194,7 @@ cmake-modular-server-build: assets-server meta cmake-modular-server-binary
cmake-modular-server-binary: meta
@$(PCOMMAND) cmake_prep_dir build/cmake/modular-server-$(CM_BT_LC)
@cd build/cmake/modular-server-$(CM_BT_LC) && test -f Makefile \
|| cmake -DCMAKE_BUILD_TYPE=$(CMAKE_BUILD_TYPE) -DHEADLESS=true \
|| cmake -DCMAKE_BUILD_TYPE=$(CMAKE_BUILD_TYPE) $(CMAKE_EXTRA_ARGS) -DHEADLESS=true \
$(shell pwd)/ballisticakit-cmake
@tools/pcommand update_cmake_prefab_lib server $(CM_BT_LC) \
build/cmake/modular-server-$(CM_BT_LC)
Expand Down