This repository has been archived by the owner on May 26, 2024. It is now read-only.
feat: add agent templates #577
Workflow file for this run
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
on: | |
push: | |
paths: | |
- .github/workflows/build.yml | |
- client/** | |
- server/** | |
pull_request: | |
workflow_dispatch: | |
jobs: | |
build-agent-cpp: | |
runs-on: ${{ matrix.runs-on }} | |
strategy: | |
fail-fast: false | |
matrix: | |
include: | |
- architecture: x86_64 | |
platform: linux | |
runs-on: ubuntu-latest | |
- architecture: arm64 | |
platform: macosx | |
runs-on: macos-latest | |
- architecture: x64 | |
platform: windows | |
runs-on: windows-latest | |
steps: | |
- uses: actions/checkout@v4 | |
- uses: xmake-io/github-action-setup-xmake@v1 | |
- run: | | |
xmake repo -u -y | |
working-directory: agent-cpp | |
- run: | | |
xmake f -m release -v -y | |
working-directory: agent-cpp | |
- run: | | |
xmake -v -y | |
working-directory: agent-cpp | |
- uses: actions/upload-artifact@v4 | |
with: | |
name: ${{ github.event.repository.name }}-${{ matrix.platform }}-${{ matrix.architecture }}-${{ github.sha }} | |
path: agent-cpp/build/${{ matrix.platform }}/${{ matrix.architecture }}/release/ | |
build-agent-cpp-docker: | |
runs-on: ubuntu-latest | |
steps: | |
- uses: actions/checkout@v4 | |
- uses: docker/build-push-action@v5 | |
with: | |
context: agent-cpp | |
build-agent-python-docker: | |
runs-on: ubuntu-latest | |
steps: | |
- uses: actions/checkout@v4 | |
- uses: docker/build-push-action@v5 | |
with: | |
context: agent-python | |
build-client: | |
if: ${{ github.event_name != 'pull_request' }} | |
runs-on: ubuntu-latest | |
strategy: | |
fail-fast: false | |
matrix: | |
targetPlatform: | |
- StandaloneLinux64 | |
- StandaloneOSX | |
- StandaloneWindows64 | |
steps: | |
- uses: actions/checkout@v4 | |
- uses: game-ci/unity-builder@v4 | |
env: | |
UNITY_EMAIL: ${{ secrets.UNITY_EMAIL }} | |
UNITY_LICENSE: ${{ secrets.UNITY_LICENSE }} | |
UNITY_PASSWORD: ${{ secrets.UNITY_PASSWORD }} | |
with: | |
projectPath: client | |
targetPlatform: ${{ matrix.targetPlatform }} | |
unityVersion: 2022.3.9f1 | |
- uses: actions/upload-artifact@v4 | |
with: | |
name: ${{ github.event.repository.name }}-client-${{ matrix.targetPlatform }}-${{ github.sha }} | |
path: build/${{ matrix.targetPlatform }} | |
build-server: | |
runs-on: ${{ matrix.runs-on }} | |
strategy: | |
fail-fast: false | |
matrix: | |
runtime: | |
- linux-arm | |
- linux-arm64 | |
- linux-x64 | |
- linux-musl-arm | |
- linux-musl-arm64 | |
- linux-musl-x64 | |
- osx-arm64 | |
- osx-x64 | |
- win-arm64 | |
- win-x64 | |
- win-x86 | |
include: | |
- runs-on: ubuntu-latest | |
- runs-on: macos-latest | |
runtime: osx-x64 | |
- runs-on: macos-latest | |
runtime: osx-arm64 | |
steps: | |
- uses: actions/checkout@v4 | |
- uses: actions/setup-dotnet@v4 | |
with: | |
dotnet-version: 8.0.x | |
- run: | | |
dotnet publish src/GameServer -c Release -o bin \ | |
--sc false -r ${{ matrix.runtime }} -p:DebugType=none \ | |
-p:PublishSingleFile=true | |
working-directory: server | |
- uses: actions/upload-artifact@v4 | |
with: | |
name: ${{ github.event.repository.name }}-server-${{ matrix.runtime }}-${{ github.sha }} | |
path: server/bin | |
build-server-docker: | |
runs-on: ubuntu-latest | |
steps: | |
- uses: actions/checkout@v4 | |
- uses: docker/build-push-action@v5 | |
with: | |
context: server | |
check-style-agent-cpp: | |
runs-on: ubuntu-latest | |
steps: | |
- uses: actions/checkout@v4 | |
- uses: jidicula/[email protected] | |
with: | |
check-path: agent-cpp/src | |
clang-format-version: 18 | |
check-style-agent-template: | |
runs-on: ubuntu-latest | |
steps: | |
- uses: actions/checkout@v4 | |
- uses: psf/black@stable | |
with: | |
options: "--check --verbose" | |
src: agent-python | |
check-style-server: | |
runs-on: ubuntu-latest | |
steps: | |
- uses: actions/checkout@v4 | |
- uses: actions/setup-dotnet@v4 | |
with: | |
dotnet-version: 8.0.x | |
- run: dotnet format --verify-no-changes src/GameServer | |
working-directory: server | |
check-style-server-test: | |
runs-on: ubuntu-latest | |
steps: | |
- uses: actions/checkout@v4 | |
- uses: actions/setup-dotnet@v4 | |
with: | |
dotnet-version: 8.0.x | |
- run: dotnet format --verify-no-changes src/GameServer.Tests | |
working-directory: server | |
test-client: | |
if: ${{ github.event_name != 'pull_request' }} | |
runs-on: ubuntu-latest | |
steps: | |
- uses: actions/checkout@v2 | |
- uses: game-ci/unity-test-runner@v4 | |
env: | |
UNITY_EMAIL: ${{ secrets.UNITY_EMAIL }} | |
UNITY_LICENSE: ${{ secrets.UNITY_LICENSE }} | |
UNITY_PASSWORD: ${{ secrets.UNITY_PASSWORD }} | |
with: | |
projectPath: client | |
unityVersion: 2022.3.9f1 | |
test-server: | |
strategy: | |
fail-fast: false | |
matrix: | |
runs-on: | |
- ubuntu-latest | |
- macos-latest | |
- windows-latest | |
runs-on: ${{ matrix.runs-on }} | |
steps: | |
- uses: actions/checkout@v4 | |
- uses: actions/setup-dotnet@v4 | |
with: | |
dotnet-version: 8.0.x | |
- run: | | |
dotnet test src/GameServer.Tests | |
working-directory: server |