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
1 change: 1 addition & 0 deletions .github/docker/ci/Dockerfile
Original file line number Diff line number Diff line change
Expand Up @@ -10,6 +10,7 @@ RUN apt-get update \
ca-certificates \
git \
libgles2-mesa-dev \
libgl1-mesa-dri \
libjpeg-dev \
libsdl2-dev \
pkg-config \
Expand Down
56 changes: 56 additions & 0 deletions .github/workflows/c-cpp.yml
Original file line number Diff line number Diff line change
Expand Up @@ -8,6 +8,62 @@ on:
branches: ["main"]

jobs:
eos:
name: EOS regressions and live multiplayer checks
# Fork PRs cannot read the licensed SDK/player credentials. Run their normal
# SDK-free checks; never execute fork code through pull_request_target.
if: github.event_name != 'pull_request' || github.event.pull_request.head.repo.full_name == github.repository
runs-on: ubuntu-latest
timeout-minutes: 25
permissions:
contents: read
packages: read
steps:
- uses: actions/checkout@v4
with:
persist-credentials: false

- name: Fetch the pinned private EOS SDK archive
uses: actions/checkout@v4
with:
repository: ${{ vars.EOS_SDK_REPOSITORY }}
ref: ${{ vars.EOS_SDK_REF }}
ssh-key: ${{ secrets.EOS_SDK_DEPLOY_KEY }}
persist-credentials: false
path: data/eos-archive

- name: Verify SDK and prepare restricted player config
env:
OPENREALM_EOS_PRODUCT_ID: ${{ secrets.OPENREALM_EOS_PRODUCT_ID }}
OPENREALM_EOS_SANDBOX_ID: ${{ secrets.OPENREALM_EOS_SANDBOX_ID }}
OPENREALM_EOS_DEPLOYMENT_ID: ${{ secrets.OPENREALM_EOS_DEPLOYMENT_ID }}
OPENREALM_EOS_CLIENT_ID: ${{ secrets.OPENREALM_EOS_CLIENT_ID }}
OPENREALM_EOS_CLIENT_SECRET: ${{ secrets.OPENREALM_EOS_CLIENT_SECRET }}
run: python3 dist-scripts/eos/prepare_release.py --platform Linux --archive data/eos-archive/EOS-SDK-1.19.2.1-CL58105819-runtime.zip

- name: Pull Linux test environment
env:
GH_TOKEN: ${{ secrets.GITHUB_TOKEN }}
GH_ACTOR: ${{ github.actor }}
run: |
printf '%s' "$GH_TOKEN" | docker login ghcr.io --username "$GH_ACTOR" --password-stdin
docker pull ghcr.io/corepunch/open-realm-ci:ubuntu-24.04
docker logout ghcr.io
# Include PR dependency changes and software GL for the actual client.
# Dependency installation stays in the shared image Dockerfile.
docker build --tag openrealm-eos-ci .github/docker/ci

- name: Run full EOS-enabled suite
run: >-
docker run --rm --mount "type=bind,source=$PWD,target=/workspace"
--workdir /workspace openrealm-eos-ci
make EOS=1 TEST_JOBS=4 test

- name: Check live login, gameplay, relay, graceful leave and host crash
env:
EOS_RUN_ID: ${{ github.run_id }}-${{ github.run_attempt }}
run: python3 dist-scripts/eos/run_acceptance.py --image openrealm-eos-ci --run-id "$EOS_RUN_ID"

notifications:
name: Discord notification fixtures
runs-on: ubuntu-latest
Expand Down
15 changes: 15 additions & 0 deletions .github/workflows/release.yml
Original file line number Diff line number Diff line change
Expand Up @@ -110,6 +110,21 @@ jobs:
shell: msys2 {0}
run: make BUILD=release EOS=1 EOS_CONFIG_FILE=data/eos/eos.cfg build

- name: Verify EOS session regressions (Unix)
if: runner.os != 'Windows'
run: >-
make BUILD=release ARCH=x86_64 EOS=1
BIN_DIR=build/eos-tests/bin LIB_DIR=build/eos-tests/lib
SHARE_INSTALL=build/eos-tests/share test-eos-service

- name: Verify EOS session regressions (Windows)
if: runner.os == 'Windows'
shell: msys2 {0}
run: >-
make BUILD=release EOS=1
BIN_DIR=build/eos-tests/bin LIB_DIR=build/eos-tests/lib
SHARE_INSTALL=build/eos-tests/share test-eos-service

- name: Create release archive (Unix)
if: runner.os != 'Windows'
run: |
Expand Down
6 changes: 6 additions & 0 deletions client/cl_parse.c
Original file line number Diff line number Diff line change
Expand Up @@ -867,6 +867,9 @@ static void CL_ParseConsolePrint(sizeBuf_t *msg) {
if (text[0]) CON_printf("%s", text);
}

#ifdef BZ_TESTS
void (*cl_test_lobby_chat)(cstring_t text, bool own);
#endif
static void CL_ParseLobbyChat(sizeBuf_t *msg) {
char text[512] = { 0 };
char command[sizeof(text) + 32];
Expand All @@ -880,6 +883,9 @@ static void CL_ParseLobbyChat(sizeBuf_t *msg) {
snprintf(command, sizeof(command), "menu_game_setup_chat %u %s", own ? 1u : 0u, text);
Cbuf_AddText(command);
Cbuf_AddText("\n");
#ifdef BZ_TESTS
if (cl_test_lobby_chat) cl_test_lobby_chat(text, own);
#endif
}

/* Apply an authoritative server selection to the client cache and refresh the active unit UI.
Expand Down
3 changes: 3 additions & 0 deletions client/client.h
Original file line number Diff line number Diff line change
Expand Up @@ -350,6 +350,9 @@ extern struct client_state cl;
extern struct client_static cls;
extern refExport_t re;
extern menuExport_t menu;
#ifdef BZ_TESTS
extern void (*cl_test_lobby_chat)(cstring_t text, bool own);
#endif
extern mouseEvent_t mouse;
extern bool scr_initialized;

Expand Down
4 changes: 4 additions & 0 deletions common/common.c
Original file line number Diff line number Diff line change
@@ -1,4 +1,5 @@
#include "common.h"
#include "online.h"

#include "mpq.h"
#include "test.h"
Expand Down Expand Up @@ -1826,6 +1827,9 @@ void Com_Init(int argc, cstring_t *argv) {
Cmd_AddCommand("path", Com_Path_f);
Cmd_AddCommand("dir", Com_Dir_f);
Cmd_AddCommand("test", Com_Test_f);
#if defined(BZ_EOS) && defined(BZ_TESTS)
Cmd_AddCommand("online_acceptance", Online_Acceptance_f);
#endif
Cvar_ApplyConfigCommandLine(argc, argv);
Cbuf_AddEarlyCommands(false);
Cbuf_Execute();
Expand Down
1 change: 1 addition & 0 deletions common/cvar.c
Original file line number Diff line number Diff line change
Expand Up @@ -537,6 +537,7 @@ void Cvar_Init(void) {
Cvar_GetD("map", "", 0, "map file to load at startup (e.g. Maps/HumanCampaign1.w3m)");
#endif
Cvar_GetD("connect", "", 0, "server address to connect to at startup");
Cvar_GetD("online_force_relay", "0", 0, "force EOS relay transport; set before entering Internet games for the first time");
Cvar_GetD("cl_debug_entities","0", 0, "log client-side entity sync events");
Cvar_GetD("sv_debug_entities","0", 0, "log server-side entity sync events");
Cvar_GetD("r_debug_entities", "0", 0, "log renderer entity lifecycle events");
Expand Down
6 changes: 5 additions & 1 deletion common/main.c
Original file line number Diff line number Diff line change
Expand Up @@ -471,15 +471,19 @@ int main(int argc, string_t argv[]) {
* without a map. The game module is a link dependency, so its TEST()
* constructors have already registered by the time we get here. */
bool run_tests = false;
bool run_online_check = false;
bool has_load = false;
for (int i = 1; i < COM_Argc(); i++) {
#if defined(BZ_EOS) && defined(BZ_TESTS)
if (!strcmp(COM_Argv(i), "+online_acceptance")) run_online_check = true;
#endif
if (!strcmp(COM_Argv(i), "+test")) { run_tests = true; break; }
if (!strcmp(COM_Argv(i), "+load")) has_load = true;
}

if (dedicated) {
// Dedicated server mode: no client stack, no SDL window.
if (!has_map && !run_tests && !has_load) {
if (!has_map && !run_tests && !run_online_check && !has_load) {
fprintf(stderr, "Dedicated server requires +map <map>\n");
return 1;
}
Expand Down
5 changes: 5 additions & 0 deletions common/online.h
Original file line number Diff line number Diff line change
Expand Up @@ -8,6 +8,9 @@ typedef struct {
} onlineGame_t;

#ifdef BZ_EOS
#ifdef BZ_TESTS
void Online_Acceptance_f(void);
#endif
bool Online_Begin(void);
void Online_Frame(uint32_t msec);
void Online_Shutdown(void);
Expand All @@ -16,6 +19,7 @@ bool Online_Ready(void);
bool Online_IsHost(void);
bool Online_HostReady(void);
bool Online_InLobby(void);
bool Online_ConnectionLost(NETSOURCE source, netadr_t const *address);
void Online_Refresh(void);
uint32_t Online_NumGames(void);
bool Online_Game(uint32_t index, onlineGame_t *out);
Expand All @@ -35,6 +39,7 @@ static inline bool Online_Ready(void) { return false; }
static inline bool Online_IsHost(void) { return false; }
static inline bool Online_HostReady(void) { return false; }
static inline bool Online_InLobby(void) { return false; }
static inline bool Online_ConnectionLost(NETSOURCE source, netadr_t const *address) { (void)source; (void)address; return false; }
static inline void Online_Refresh(void) {}
static inline uint32_t Online_NumGames(void) { return 0; }
static inline bool Online_Game(uint32_t index, onlineGame_t *out) { (void)index; (void)out; return false; }
Expand Down
Loading
Loading