Skip to content

Commit 1c26462

Browse files
fix CI actions for Linux (#193)
* fix : run on ubuntu 22.04 to fix 'awaiting for runner' CI issue * fix : vcpkg path must match submodule path hardcoded from CMakePresets * fix : use upload-artifact v4 as v3 is deprecated * fix missing wslay include in Linux CI builds Fixes missing <wslay/wslay.h> during library compilation on Linux Ubuntu. * update : use integrationtest/ instead of client-testrunner repo * fix test compilation : include thread lib * upd : use Task to run tests
1 parent 4eb3391 commit 1c26462

10 files changed

Lines changed: 34 additions & 42 deletions

File tree

.github/actions/build-library-and-upload/action.yml

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -68,15 +68,15 @@ runs:
6868
if: runner.os == 'Windows'
6969

7070
- name: Upload artifact
71-
uses: actions/upload-artifact@v3
71+
uses: actions/upload-artifact@v4
7272
with:
7373
name: ${{ steps.get-folder-name-unix.outputs.folder-name }}
7474
path: ${{ steps.create-zip-unix.outputs.artifact-path }}
7575
if-no-files-found: error
7676
if: runner.os != 'Windows'
7777

7878
- name: Upload artifact (Windows)
79-
uses: actions/upload-artifact@v3
79+
uses: actions/upload-artifact@v4
8080
with:
8181
name: ${{ steps.get-folder-name-windows.outputs.folder-name }}-${{ inputs.build-type }}
8282
path: ${{ steps.create-zip-windows.outputs.artifact-path }}

.github/actions/build-test-and-run/action.yml

Lines changed: 6 additions & 18 deletions
Original file line numberDiff line numberDiff line change
@@ -7,9 +7,6 @@ inputs:
77
nakama-cpp-path:
88
description: 'Relative path under $GITHUB_WORKSPACE to the nakama-cpp repository'
99
required: true
10-
testrunner-pat:
11-
description: 'PAT to access the private Nakama testrunner'
12-
required: true
1310
build-type:
1411
description: The build type.
1512
required: true
@@ -20,20 +17,11 @@ inputs:
2017
runs:
2118
using: "composite"
2219
steps:
23-
- name: Checkout nakama-client-testrunner
24-
uses: actions/checkout@v2
25-
with:
26-
repository: heroiclabs/nakama-client-testrunner
27-
token: ${{ inputs.testrunner-pat }}
28-
path: nakama-client-testrunner
29-
- name: Start docker containers for nakama-client-testrunner
30-
run: |
31-
docker-compose up -d
32-
working-directory: nakama-client-testrunner
20+
- name: Install Task
3321
shell: bash
34-
- id: build
35-
run: |
36-
cmake --preset ${{ inputs.preset }} -DBUILD_SHARED_NAKAMA_SDK=ON
37-
cmake --build ./build/${{ inputs.preset }} --config ${{ inputs.build-type }} --target install run -- ${{ inputs.native-tool-options }}
22+
run: npm install -g @go-task/cli
23+
24+
- name: Run tests with Task
3825
shell: bash
39-
working-directory: ${{ inputs.nakama-cpp-path }}/test
26+
run: task test
27+
working-directory: ${{ inputs.nakama-cpp-path }}

.github/actions/handle-failure/action.yml

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -65,7 +65,7 @@ runs:
6565
Pop-Location
6666
}
6767
shell: powershell
68-
- uses: actions/upload-artifact@v3
68+
- uses: actions/upload-artifact@v4
6969
with:
7070
name: ${{ steps.build.outputs.artifact_name }}-workdir-debug
7171
path: |

.github/actions/setup-ubuntu/action.yml

Lines changed: 17 additions & 12 deletions
Original file line numberDiff line numberDiff line change
@@ -3,17 +3,23 @@ description: 'Sets up prereqs for all ubuntu machines'
33
runs:
44
using: "composite"
55
steps:
6-
- run: |
7-
install_ninja() {
8-
(
9-
mkdir -p ~/bin
10-
cd /tmp
11-
curl -L -O https://github.com/ninja-build/ninja/releases/download/v1.11.0/ninja-linux.zip
12-
unzip ninja-linux.zip
13-
mv ninja /usr/local/bin/
14-
)
15-
ninja --version 2>/dev/null
16-
}
6+
- name: Install Ubuntu dependencies
7+
shell: bash
8+
run: |
9+
set -euo pipefail
10+
sudo apt-get update
11+
sudo apt-get install -y \
12+
cmake \
13+
ninja-build \
14+
libcurl4-openssl-dev \
15+
gcc \
16+
g++
17+
18+
- name: Ensure ninja + mono available
19+
shell: bash
20+
run: |
21+
set -euo pipefail
22+
mkdir -p ~/bin
1723
1824
# vcpkg wants mono, make sure it finds one
1925
# see: https://github.com/microsoft/vcpkg/issues/25585
@@ -28,5 +34,4 @@ runs:
2834
2935
ninja --version 2>/dev/null || install_ninja
3036
ensure_mono
31-
shell: bash
3237

.github/workflows/build_linux.yml

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -6,7 +6,7 @@ jobs:
66
strategy:
77
matrix:
88
build-type: [MinSizeRel]
9-
runs-on: ubuntu-20.04
9+
runs-on: ubuntu-22.04
1010
steps:
1111
- uses: actions/checkout@v3
1212
with:
@@ -15,7 +15,7 @@ jobs:
1515
- uses: ./nakama-cpp/.github/actions/setup-vcpkg
1616
with:
1717
github_token: ${{ secrets.github_token }}
18-
vcpkg-path: vcpkg
18+
vcpkg-path: nakama-cpp/submodules/vcpkg
1919
- uses: ./nakama-cpp/.github/actions/build-library-and-upload
2020
with:
2121
nakama-cpp-path: nakama-cpp
@@ -25,4 +25,4 @@ jobs:
2525
uses: ./nakama-cpp/.github/actions/handle-failure
2626
with:
2727
nakama-cpp-path: nakama-cpp
28-
vcpkg-path: vcpkg
28+
vcpkg-path: nakama-cpp/submodules/vcpkg

.github/workflows/test_linux.yml

Lines changed: 3 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -6,7 +6,7 @@ jobs:
66
strategy:
77
matrix:
88
build-type: [MinSizeRel]
9-
runs-on: ubuntu-20.04
9+
runs-on: ubuntu-22.04
1010
steps:
1111
- uses: actions/checkout@v3
1212
with:
@@ -15,7 +15,7 @@ jobs:
1515
- uses: ./nakama-cpp/.github/actions/setup-vcpkg
1616
with:
1717
github_token: ${{ secrets.github_token }}
18-
vcpkg-path: vcpkg
18+
vcpkg-path: nakama-cpp/submodules/vcpkg
1919
- uses: ./nakama-cpp/.github/actions/build-library-and-upload
2020
with:
2121
nakama-cpp-path: nakama-cpp
@@ -25,10 +25,9 @@ jobs:
2525
with:
2626
nakama-cpp-path: nakama-cpp
2727
preset: linux-amd64
28-
testrunner-pat: ${{ secrets.GH_PAT }}
2928
build-type: ${{ matrix.build-type }}
3029
- if: failure()
3130
uses: ./nakama-cpp/.github/actions/handle-failure
3231
with:
3332
nakama-cpp-path: nakama-cpp
34-
vcpkg-path: vcpkg
33+
vcpkg-path: nakama-cpp/submodules/vcpkg

.github/workflows/test_osx.yml

Lines changed: 0 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -57,7 +57,6 @@ jobs:
5757
with:
5858
nakama-cpp-path: nakama-cpp
5959
preset: ${{ matrix.preset }}
60-
testrunner-pat: ${{ secrets.GH_PAT }}
6160
native-tool-options: "-allowProvisioningUpdates"
6261
build-type: ${{ matrix.build-type }}
6362
- if: failure()

.github/workflows/test_windows.yml

Lines changed: 0 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -25,7 +25,6 @@ jobs:
2525
with:
2626
nakama-cpp-path: nakama-cpp
2727
preset: ${{ matrix.preset }}
28-
testrunner-pat: ${{ secrets.GH_PAT }}
2928
build-type: ${{ matrix.build-type }}
3029
- if: failure()
3130
uses: ./nakama-cpp/.github/actions/handle-failure

impl/wsWslay/CMakeLists.txt

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -14,6 +14,7 @@ target_link_libraries(nakama-impl-ws-wslay
1414
nakama::sdk-interface
1515
PRIVATE
1616
nakama::sdk-core-common nakama::sdk-core-misc wslay
17+
INTERFACE wslay
1718
)
1819

1920
target_include_directories(nakama-impl-ws-wslay

satori-cpp/test/main.cpp

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -15,6 +15,7 @@
1515
*/
1616

1717
#include <iostream>
18+
#include <thread>
1819

1920
#include "nakama-cpp/satori/SatoriClientFactory.h"
2021

0 commit comments

Comments
 (0)