Skip to content

Commit 2aee1bd

Browse files
authored
Merge pull request #20 from FelixNgFender/multiplayer
Multiplayer
2 parents ce83bf9 + cf66b9f commit 2aee1bd

File tree

1,643 files changed

+265931
-56268
lines changed

Some content is hidden

Large Commits have some content hidden by default. Use the searchbox below for content that may be hidden.

1,643 files changed

+265931
-56268
lines changed

.github/workflows/ci.yml

+17-14
Original file line numberDiff line numberDiff line change
@@ -27,12 +27,12 @@ jobs:
2727
id: install_python
2828
uses: actions/setup-python@v5
2929
with:
30-
python-version: "3.10"
30+
python-version: "3.12"
3131

3232
- name: Install Poetry
3333
uses: abatilo/actions-poetry@v2
3434
with:
35-
poetry-version: "1.8.3"
35+
poetry-version: "1.8.4"
3636

3737
- name: Setup a local virtual environment (if no poetry.toml file)
3838
working-directory: ./python
@@ -44,7 +44,9 @@ jobs:
4444
uses: actions/cache/restore@v4
4545
with:
4646
path: ./python/.venv
47-
key: venv-${{ runner.os }}-${{ steps.install_python.outputs.python-version }}-${{ hashFiles('./python/poetry.lock') }}
47+
key: venv-${{ runner.os }}-${{
48+
steps.install_python.outputs.python-version }}-${{
49+
hashFiles('./python/poetry.lock') }}
4850

4951
- name: Install dependencies (used by later workflows)
5052
working-directory: ./python
@@ -57,19 +59,20 @@ jobs:
5759
uses: actions/cache/save@v4
5860
with:
5961
path: ./python/.venv
60-
key: venv-${{ runner.os }}-${{ steps.install_python.outputs.python-version }}-${{ hashFiles('./python/poetry.lock') }}
62+
key: venv-${{ runner.os }}-${{
63+
steps.install_python.outputs.python-version }}-${{
64+
hashFiles('./python/poetry.lock') }}
6165

6266
- name: Lint with ruff
6367
working-directory: ./python
6468
run: ruff check --output-format=github
6569

66-
- name: Typecheck with pyright
67-
working-directory: ./python
68-
run: pyright arflow
69-
70-
- name: Test with pytest
71-
working-directory: ./python
72-
timeout-minutes: 5 # pytest sometimes hangs for (yet) unknown reasons
73-
# TODO: Add coverage tracking once we have a stable test suite
74-
run: |
75-
pytest
70+
# - name: Typecheck with pyright
71+
# working-directory: ./python
72+
# run: pyright arflow
73+
#
74+
# - name: Test with pytest
75+
# working-directory: ./python
76+
# timeout-minutes: 5 # pytest sometimes hangs for (yet) unknown reasons
77+
# run: |
78+
# pytest

.github/workflows/pre-release.yml

+10-4
Original file line numberDiff line numberDiff line change
@@ -22,12 +22,12 @@ jobs:
2222
id: install_python
2323
uses: actions/setup-python@v5
2424
with:
25-
python-version: "3.10"
25+
python-version: "3.12"
2626

2727
- name: Install Poetry
2828
uses: abatilo/actions-poetry@v2
2929
with:
30-
poetry-version: "1.8.3"
30+
poetry-version: "1.8.4"
3131

3232
- name: Setup a local virtual environment (if no poetry.toml file)
3333
working-directory: ./python
@@ -39,7 +39,10 @@ jobs:
3939
uses: actions/cache/restore@v4
4040
with:
4141
path: ./python/.venv
42-
key: venv-${{ runner.os }}-${{ steps.install_python.outputs.python-version }}-${{ hashFiles('./python/poetry.lock') }}
42+
key:
43+
venv-${{ runner.os }}-${{
44+
steps.install_python.outputs.python-version }}-${{
45+
hashFiles('./python/poetry.lock') }}
4346

4447
- name: Install dependencies (skipped if cache hit, fallback to install)
4548
working-directory: ./python
@@ -52,7 +55,10 @@ jobs:
5255
uses: actions/cache/save@v4
5356
with:
5457
path: ./python/.venv
55-
key: venv-${{ runner.os }}-${{ steps.install_python.outputs.python-version }}-${{ hashFiles('./python/poetry.lock') }}
58+
key:
59+
venv-${{ runner.os }}-${{
60+
steps.install_python.outputs.python-version }}-${{
61+
hashFiles('./python/poetry.lock') }}
5662

5763
- name: Configure Test PyPI with Poetry
5864
working-directory: ./python

.github/workflows/publish-docs.yml

+58-33
Original file line numberDiff line numberDiff line change
@@ -10,32 +10,53 @@ permissions:
1010
id-token: write
1111

1212
jobs:
13-
build-client-docs-as-artifact:
13+
build-protos-docs:
14+
name: Build protos docs
15+
runs-on: ubuntu-latest
16+
steps:
17+
- uses: actions/checkout@v4
18+
19+
- name: Install Buf CLI
20+
uses: bufbuild/buf-setup-action@v1.47.2 # must match mise.toml
21+
with:
22+
github_token: ${{ secrets.GITHUB_TOKEN }}
23+
24+
- name: Install protoc
25+
uses: arduino/setup-protoc@v1
26+
27+
- name: Build protos docs
28+
run: buf generate
29+
30+
- uses: actions/upload-artifact@v4
31+
with:
32+
name: protos-docs
33+
path: ./website/docs/protos
34+
35+
build-client-docs:
1436
name: Build client docs
1537
runs-on: windows-latest
1638
steps:
1739
- uses: actions/checkout@v4
1840

19-
- name: Install docfx
20-
run: dotnet tool install -g docfx
41+
- name: Dotnet Setup
42+
uses: actions/setup-dotnet@v3
43+
with:
44+
dotnet-version: 8.x
45+
46+
- name: Update docfx
47+
run: dotnet tool update -g docfx
2148

2249
- name: Run script to build the documentation
2350
working-directory: ./unity/Documentation
2451
run: ./scripts/build.cmd
2552

26-
# - name: Move docs to website directory
27-
# run: |
28-
# mkdir -p ./website/docs/client/
29-
# cp -r ./unity/Documentation/clientHTMLOutput/* ./website/docs/client/
30-
# Upload the website directory as an artifact
3153
- uses: actions/upload-artifact@v4
3254
with:
3355
name: client-docs
34-
path: ./unity/Documentation/clientHTMLOutput
56+
path: ./website/docs/client
3557

3658
build-server-docs:
3759
name: Build server docs
38-
needs: build-client-docs-as-artifact
3960
runs-on: ubuntu-latest
4061
steps:
4162
- uses: actions/checkout@v4
@@ -44,12 +65,12 @@ jobs:
4465
id: install_python
4566
uses: actions/setup-python@v5
4667
with:
47-
python-version: "3.10"
68+
python-version: "3.12"
4869

4970
- name: Install Poetry
5071
uses: abatilo/actions-poetry@v2
5172
with:
52-
poetry-version: "1.8.3"
73+
poetry-version: "1.8.4"
5374

5475
- name: Setup a local virtual environment (if no poetry.toml file)
5576
working-directory: ./python
@@ -61,7 +82,10 @@ jobs:
6182
uses: actions/cache/restore@v4
6283
with:
6384
path: ./python/.venv
64-
key: venv-${{ runner.os }}-${{ steps.install_python.outputs.python-version }}-${{ hashFiles('./python/poetry.lock') }}
85+
key:
86+
venv-${{ runner.os }}-${{
87+
steps.install_python.outputs.python-version }}-${{
88+
hashFiles('./python/poetry.lock') }}
6589

6690
- name: Install docs dependencies
6791
working-directory: ./python
@@ -70,35 +94,36 @@ jobs:
7094
echo "$(poetry env info --path)/bin" >> $GITHUB_PATH
7195
echo "VIRTUAL_ENV=$(poetry env info --path)/bin" >> $GITHUB_ENV
7296
73-
# - name: Saved cached virtualenv
74-
# uses: actions/cache/save@v4
75-
# with:
76-
# path: ./python/.venv
77-
# key: venv-${{ runner.os }}-${{ steps.install_python.outputs.python-version }}-${{ hashFiles('./python/poetry.lock') }}
78-
7997
- name: Build the documentation
8098
working-directory: ./python
8199
run: python tools/make_docs_cli.py
82100

83-
- name: Move docs to website directory
84-
run: |
85-
mkdir -p ./website/docs/server/
86-
cp -r ./python/docs/* ./website/docs/server/
101+
- uses: actions/upload-artifact@v4
102+
with:
103+
name: server-docs
104+
path: ./website/docs/server
105+
106+
upload-website:
107+
name: Upload website
108+
needs: [build-protos-docs, build-client-docs, build-server-docs]
109+
runs-on: ubuntu-latest
110+
steps:
111+
- uses: actions/checkout@v4
112+
113+
- uses: actions/download-artifact@v4
114+
with:
115+
name: protos-docs
116+
path: ./website/docs/protos
87117

88-
# Get client docs to use as part of pages artifact
89118
- uses: actions/download-artifact@v4
90119
with:
91120
name: client-docs
92121
path: ./website/docs/client
93122

94-
# # cleanup client docs artifacts
95-
# - name: Delete client docs artifact
96-
# run: |
97-
# github.rest.actions.deleteArtifact({
98-
# owner: context.repo.owner,
99-
# repo: context.repo.repo,
100-
# artifact_id: ${{ steps.artifact-download.outputs.artifact-id }}
101-
# });
123+
- uses: actions/download-artifact@v4
124+
with:
125+
name: server-docs
126+
path: ./website/docs/server
102127

103128
- uses: actions/upload-pages-artifact@v3
104129
with:
@@ -107,7 +132,7 @@ jobs:
107132
# Single deploy job since we're just deploying
108133
deploy-website:
109134
name: Deploy website
110-
needs: build-server-docs
135+
needs: upload-website
111136
runs-on: ubuntu-latest
112137
permissions:
113138
pages: write

.github/workflows/release.yml

+10-4
Original file line numberDiff line numberDiff line change
@@ -22,12 +22,12 @@ jobs:
2222
id: install_python
2323
uses: actions/setup-python@v5
2424
with:
25-
python-version: "3.10"
25+
python-version: "3.12"
2626

2727
- name: Install Poetry
2828
uses: abatilo/actions-poetry@v2
2929
with:
30-
poetry-version: "1.8.3"
30+
poetry-version: "1.8.4"
3131

3232
- name: Setup a local virtual environment (if no poetry.toml file)
3333
working-directory: ./python
@@ -39,7 +39,10 @@ jobs:
3939
uses: actions/cache/restore@v4
4040
with:
4141
path: ./python/.venv
42-
key: venv-${{ runner.os }}-${{ steps.install_python.outputs.python-version }}-${{ hashFiles('./python/poetry.lock') }}
42+
key:
43+
venv-${{ runner.os }}-${{
44+
steps.install_python.outputs.python-version }}-${{
45+
hashFiles('./python/poetry.lock') }}
4346

4447
- name: Install dependencies (skipped if cache hit, fallback to install)
4548
working-directory: ./python
@@ -52,7 +55,10 @@ jobs:
5255
uses: actions/cache/save@v4
5356
with:
5457
path: ./python/.venv
55-
key: venv-${{ runner.os }}-${{ steps.install_python.outputs.python-version }}-${{ hashFiles('./python/poetry.lock') }}
58+
key:
59+
venv-${{ runner.os }}-${{
60+
steps.install_python.outputs.python-version }}-${{
61+
hashFiles('./python/poetry.lock') }}
5662

5763
- name: Use PyPI API token
5864
working-directory: ./python

.gitignore

-5
Original file line numberDiff line numberDiff line change
@@ -1,11 +1,6 @@
11
# Created by https://www.toptal.com/developers/gitignore/api/macos,windows,visualstudiocode
22
# Edit at https://www.toptal.com/developers/gitignore?templates=macos,windows,visualstudiocode
33

4-
#additional files
5-
.grpc_tools/**
6-
act.exe
7-
my.secrets
8-
94
### macOS ###
105
# General
116
.DS_Store

.prettierrc

+4
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,4 @@
1+
{
2+
"printWidth": 80,
3+
"proseWrap": "always"
4+
}

.vscode/extensions.json

+5-5
Original file line numberDiff line numberDiff line change
@@ -1,11 +1,11 @@
11
{
22
"recommendations": [
3-
"ms-python.python",
4-
"ms-python.vscode-pylance",
53
"redhat.vscode-yaml",
6-
"charliermarsh.ruff",
7-
"ms-toolsai.jupyter",
84
"streetsidesoftware.code-spell-checker",
9-
"visualstudiotoolsforunity.vstuc"
5+
"DavidAnson.vscode-markdownlint",
6+
"bufbuild.vscode-buf",
7+
"ms-python.python",
8+
"ms-python.vscode-pylance",
9+
"charliermarsh.ruff"
1010
]
1111
}

.vscode/settings.json

+20-3
Original file line numberDiff line numberDiff line change
@@ -1,4 +1,15 @@
11
{
2+
"editor.tabSize": 4,
3+
"[javascript]": {
4+
"editor.tabSize": 2
5+
},
6+
"[json]": {
7+
"editor.tabSize": 2
8+
},
9+
"[yaml]": {
10+
"editor.tabSize": 4
11+
},
12+
"editor.insertSpaces": true,
213
"notebook.formatOnSave.enabled": true,
314
"notebook.codeActionsOnSave": {
415
"notebook.source.fixAll": "explicit",
@@ -19,8 +30,7 @@
1930
"python.testing.pytestEnabled": true,
2031
"[csharp]": {
2132
"editor.formatOnSave": true,
22-
"editor.maxTokenizationLineLength": 2500,
23-
"editor.inlineSuggest.suppressSuggestions": false
33+
"editor.maxTokenizationLineLength": 2500
2434
},
2535
"files.exclude": {
2636
"**/.git": true,
@@ -46,5 +56,12 @@
4656
"thecakelab",
4757
"Xihe"
4858
],
49-
"conventionalCommits.scopes": ["server", "client", "examples", "others"]
59+
"conventionalCommits.scopes": [
60+
"protos",
61+
"server",
62+
"cli",
63+
"client",
64+
"examples",
65+
"others"
66+
]
5067
}

0 commit comments

Comments
 (0)