56 lines
1.9 KiB
YAML
56 lines
1.9 KiB
YAML
name: GNS Transport Bridge
|
|
|
|
on:
|
|
push:
|
|
paths:
|
|
- "server/native_transport/**"
|
|
- ".github/workflows/gns-transport.yml"
|
|
pull_request:
|
|
paths:
|
|
- "server/native_transport/**"
|
|
- ".github/workflows/gns-transport.yml"
|
|
|
|
permissions:
|
|
contents: read
|
|
|
|
jobs:
|
|
linux:
|
|
name: Linux native GNS bridge
|
|
runs-on: [self-hosted, Linux, X64, co-server]
|
|
steps:
|
|
- uses: actions/checkout@11d5960a326750d5838078e36cf38b85af677262
|
|
with:
|
|
persist-credentials: false
|
|
|
|
- name: Verify build dependencies
|
|
run: |
|
|
missing=0
|
|
for tool in cmake ninja protoc; do
|
|
command -v "$tool" >/dev/null 2>&1 || { echo "::error::missing build dependency: $tool"; missing=1; }
|
|
done
|
|
test -f /usr/include/openssl/ssl.h || { echo "::error::missing libssl-dev headers"; missing=1; }
|
|
test "$missing" -eq 0
|
|
|
|
- name: Fetch pinned GameNetworkingSockets
|
|
run: |
|
|
GNS_SHA=f4525e39ee10f6b45181fd92d01fee75f7d71756
|
|
rm -rf /tmp/co-gns-src
|
|
git init /tmp/co-gns-src
|
|
git -C /tmp/co-gns-src remote add origin https://github.com/ValveSoftware/GameNetworkingSockets.git
|
|
git -C /tmp/co-gns-src fetch --depth 1 origin "$GNS_SHA"
|
|
git -C /tmp/co-gns-src checkout --detach FETCH_HEAD
|
|
test "$(git -C /tmp/co-gns-src rev-parse HEAD)" = "$GNS_SHA"
|
|
|
|
- name: Build and run native bridge tests
|
|
run: |
|
|
cmake -S server/native_transport -B /tmp/co-server-gns-build -G Ninja \
|
|
-DGNS_SOURCE_DIR=/tmp/co-gns-src \
|
|
-DCMAKE_BUILD_TYPE=Release
|
|
cmake --build /tmp/co-server-gns-build -j2
|
|
ctest --test-dir /tmp/co-server-gns-build --output-on-failure
|
|
|
|
- name: Confirm shared bridge artifact
|
|
run: |
|
|
test -f /tmp/co-server-gns-build/libcommonwealth_online_gns_bridge.so
|
|
ldd /tmp/co-server-gns-build/libcommonwealth_online_gns_bridge.so
|