-
Notifications
You must be signed in to change notification settings - Fork 1
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Implement a basic github actions based CI (#11)
* First attempt at getting the server docker build to work * "Fix" docker server build by dynamically patching the CMakeLists so we can reference the shared protocol files from a different folder. * CI: Implement caching for intermediary docker image layers (hopefully the vcpkg install step) * CI: Also checkout submodules * CI: Also add a client build * Supply vcpkg commit id * CI: Convert to actually supplying CMakePresets * CI: actually use the right preset * CI: Is CMake dumb? * CI: Try to configure before building * CI: Fix argument * CI: Actually build the client, not the server. * Move the CMakePresets into the client, too * CI: Preserve the artifacts
- Loading branch information
Showing
3 changed files
with
95 additions
and
0 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
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 |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
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" | ||
} | ||
] | ||
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters