Run legacy runtime guard on every push and PR
This commit is contained in:
@@ -2,39 +2,24 @@ name: CSharp Server Gate
|
|||||||
|
|
||||||
on:
|
on:
|
||||||
push:
|
push:
|
||||||
branches:
|
pull_request:
|
||||||
- rewrite/csharp-server
|
|
||||||
paths:
|
|
||||||
- "server/**"
|
|
||||||
- "src/ServerProcess.*"
|
|
||||||
- "CMakeLists.txt"
|
|
||||||
- "cmake/stage_server.cmake"
|
|
||||||
- "build.bat"
|
|
||||||
- "deploy.bat"
|
|
||||||
- "check-setup.bat"
|
|
||||||
- ".github/workflows/csharp-server.yml"
|
|
||||||
workflow_dispatch:
|
workflow_dispatch:
|
||||||
|
|
||||||
jobs:
|
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:
|
build-and-test:
|
||||||
|
name: C# build and test
|
||||||
runs-on: [self-hosted, Linux, X64]
|
runs-on: [self-hosted, Linux, X64]
|
||||||
steps:
|
steps:
|
||||||
- uses: actions/checkout@v4
|
- uses: actions/checkout@v4
|
||||||
|
|
||||||
- name: Reject Python files
|
|
||||||
shell: bash
|
|
||||||
run: |
|
|
||||||
if find . -type f -name '*.py' -print -quit | grep -q .; then
|
|
||||||
echo "Python files are not allowed in CO-SERVER"
|
|
||||||
find . -type f -name '*.py' -print
|
|
||||||
exit 1
|
|
||||||
fi
|
|
||||||
if find server -maxdepth 1 -type f -name 'requirements*.txt' -print -quit | grep -q .; then
|
|
||||||
echo "Python requirements files are not allowed in CO-SERVER"
|
|
||||||
find server -maxdepth 1 -type f -name 'requirements*.txt' -print
|
|
||||||
exit 1
|
|
||||||
fi
|
|
||||||
|
|
||||||
- uses: actions/setup-dotnet@v4
|
- uses: actions/setup-dotnet@v4
|
||||||
with:
|
with:
|
||||||
dotnet-version: "8.0.x"
|
dotnet-version: "8.0.x"
|
||||||
@@ -47,13 +32,15 @@ jobs:
|
|||||||
working-directory: server
|
working-directory: server
|
||||||
run: dotnet run --project tests/CommonwealthOnline.Server.Tests.csproj -c Release
|
run: dotnet run --project tests/CommonwealthOnline.Server.Tests.csproj -c Release
|
||||||
|
|
||||||
- name: Check Linux scripts
|
- name: Check Linux scripts and repository policy
|
||||||
working-directory: server
|
working-directory: server
|
||||||
run: |
|
run: |
|
||||||
chmod +x start.sh fix-port.sh scripts/linux_compat_checks.sh
|
chmod +x start.sh fix-port.sh scripts/linux_compat_checks.sh scripts/verify-no-legacy-runtime.sh
|
||||||
bash -n start.sh
|
bash -n start.sh
|
||||||
bash -n fix-port.sh
|
bash -n fix-port.sh
|
||||||
bash -n scripts/linux_compat_checks.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
|
- name: Publish Linux server
|
||||||
working-directory: server
|
working-directory: server
|
||||||
|
|||||||
Reference in New Issue
Block a user