Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Implement a basic github actions based CI #11

Merged
merged 14 commits into from
Dec 23, 2023
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
56 changes: 56 additions & 0 deletions .github/workflows/build.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,56 @@
name: CI Build
on:
push:
branches: [ "master", "feature/ci" ]
pull_request:
branches: [ "master" ]

jobs:
docker-server:
runs-on: ubuntu-latest

steps:
- uses: actions/checkout@v3
with:
submodules: recursive
- name: Copying the protocol files
run: cp -rv shared/protocol server/protocol
- uses: satackey/[email protected]
continue-on-error: true
- name: Build the Docker image
working-directory: server
run: docker build . --file Dockerfile --tag cyberverse-server:$(date +%s)

client:
runs-on: windows-latest

env:
VCPKG_DEFAULT_TRIPLET: x64-windows
steps:
- uses: actions/checkout@v3
with:
submodules: recursive
- uses: lukka/get-cmake@latest
- name: Setup vcpkg
uses: lukka/run-vcpkg@main
id: runvcpkg
with:
# The vcpkg.json file, which will be part of cache key computation.
vcpkgJsonGlob: 'client/red4ext/vcpkg.json'
vcpkgGitCommitId: '16ee2ecb31788c336ace8bb14c21801efb6836e4'
- name: Generate build output folder
run: mkdir '${{ github.workspace }}\client\red4ext\build\ninja-vcpkg'
- name: Run CMake with vcpkg.json manifest
uses: lukka/run-cmake@v10
with:
cmakeListsTxtPath: '${{ github.workspace }}/client/red4ext/CMakeLists.txt'
configurePreset: ninja-vcpkg
buildPreset: ninja-vcpkg
buildPresetAdditionalArgs: '[`--config Release`]'
- name: List $RUNNER_WORKSPACE after build
run: find $RUNNER_WORKSPACE
shell: bash
- uses: actions/upload-artifact@v4
with:
name: RED4ext Plugin
path: client/red4ext/build/ninja-vcpkg/src/*.dll
37 changes: 37 additions & 0 deletions client/red4ext/CMakePresets.json
Original file line number Diff line number Diff line change
@@ -0,0 +1,37 @@
{
"version": 6,
"cmakeMinimumRequired": {
"major": 3,
"minor": 21,
"patch": 0
},
"configurePresets": [
{
"name": "ninja-vcpkg",
"displayName": "Ninja Configure Settings",
"description": "Configure with vcpkg toolchain",
"binaryDir": "${sourceDir}/build/${presetName}",
"generator": "Ninja",
"cacheVariables": {
"CMAKE_TOOLCHAIN_FILE": {
"type": "FILEPATH",
"value": "$env{VCPKG_ROOT}/scripts/buildsystems/vcpkg.cmake"
}
}
}
],
"buildPresets": [
{
"name": "ninja-vcpkg",
"configurePreset": "ninja-vcpkg",
"displayName": "Build ninja-vcpkg",
"description": "Build ninja-vcpkg Configurations"
}
],
"testPresets": [
{
"name": "ninja-vcpkg",
"configurePreset": "ninja-vcpkg"
}
]
}
2 changes: 2 additions & 0 deletions server/Dockerfile
Original file line number Diff line number Diff line change
Expand Up @@ -6,6 +6,8 @@ ADD protocol /workspace/protocol

# generate and build
RUN vcpkg install --triplet=x64-linux
RUN sed -i 's\../../shared/protocol\protocol\g' /workspace/CMakeLists.txt
# TODO: Use CMakePresets instead.
RUN cmake -DCMAKE_TOOLCHAIN_FILE:STRING=${VCPKG_ROOT}/scripts/buildsystems/vcpkg.cmake \
-DCMAKE_EXPORT_COMPILE_COMMANDS:BOOL=TRUE -DCMAKE_BUILD_TYPE:STRING=Debug \
-H/workspace -B/workspace/build -G Ninja
Expand Down
Loading