Files
Commonwealth-Online-Server/.github/workflows/csharp-server.yml
T

52 lines
1.6 KiB
YAML

name: CSharp Server Gate
on:
push:
pull_request:
workflow_dispatch:
jobs:
runtime-policy:
name: Repository runtime policy
runs-on: ubuntu-latest
steps:
- uses: actions/checkout@v4
- name: Enforce runtime policy
run: bash server/scripts/verify-no-legacy-runtime.sh
build-and-test:
name: C# build and test
runs-on: [self-hosted, Linux, X64]
steps:
- uses: actions/checkout@v4
- uses: actions/setup-dotnet@v4
with:
dotnet-version: "8.0.x"
- name: Build C# server
working-directory: server
run: dotnet build CommonwealthOnline.Server.csproj -c Release --nologo
- name: Run C# server tests
working-directory: server
run: dotnet run --project tests/CommonwealthOnline.Server.Tests.csproj -c Release
- name: Check Linux scripts and repository policy
working-directory: server
run: |
chmod +x start.sh fix-port.sh scripts/linux_compat_checks.sh scripts/verify-no-legacy-runtime.sh
bash -n start.sh
bash -n fix-port.sh
bash -n scripts/linux_compat_checks.sh
bash -n scripts/verify-no-legacy-runtime.sh
bash scripts/verify-no-legacy-runtime.sh
- name: Publish Linux server
working-directory: server
run: dotnet publish CommonwealthOnline.Server.csproj -c Release -r linux-x64 --self-contained false -o publish/linux-x64 --nologo
- name: Verify published entrypoint
working-directory: server
run: test -f publish/linux-x64/CommonwealthOnline.Server.dll