-
Notifications
You must be signed in to change notification settings - Fork 0
171 lines (163 loc) · 5.34 KB
/
ci.yml
File metadata and controls
171 lines (163 loc) · 5.34 KB
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
124
125
126
127
128
129
130
131
132
133
134
135
136
137
138
139
140
141
142
143
144
145
146
147
148
149
150
151
152
153
154
155
156
157
158
159
160
161
162
163
164
165
166
167
168
169
170
171
name: CI
on:
push:
paths-ignore:
- 'docs/**'
- 'mkdocs.yml'
- '*.md'
pull_request:
paths-ignore:
- 'docs/**'
- 'mkdocs.yml'
- '*.md'
jobs:
unity-license-gate:
name: Unity license gate
runs-on: ubuntu-latest
outputs:
has_license: ${{ steps.gate.outputs.has_license }}
steps:
- id: gate
env:
UNITY_LICENSE: ${{ secrets.UNITY_LICENSE }}
run: |
if [ -n "$UNITY_LICENSE" ]; then
echo "has_license=true" >> "$GITHUB_OUTPUT"
else
echo "has_license=false" >> "$GITHUB_OUTPUT"
fi
backend-build:
name: Backend build + xUnit tests (.NET)
runs-on: ubuntu-latest
steps:
- uses: actions/checkout@v6
- uses: actions/setup-dotnet@v5
with:
dotnet-version: "8.0.x"
- name: Restore and build backend
run: |
dotnet restore src/ks0223-web-mac/backend/backend.csproj
dotnet build src/ks0223-web-mac/backend/backend.csproj --no-restore
- name: Restore and test backend.Tests
run: |
dotnet restore src/ks0223-web-mac/backend.Tests/backend.Tests.csproj
dotnet test src/ks0223-web-mac/backend.Tests/backend.Tests.csproj \
--no-restore --nologo --verbosity minimal \
--logger "console;verbosity=normal"
frontend-build:
name: Frontend build & lint (Vite)
runs-on: ubuntu-latest
steps:
- uses: actions/checkout@v6
- uses: actions/setup-node@v6
with:
node-version: "20"
cache: npm
cache-dependency-path: src/ks0223-web-mac/frontend/package-lock.json
- name: Install
run: npm ci
working-directory: src/ks0223-web-mac/frontend
- name: Lint
run: npm run lint -- --max-warnings 0
working-directory: src/ks0223-web-mac/frontend
- name: Build
run: npm run build
working-directory: src/ks0223-web-mac/frontend
unity-tests:
name: Unity Tests (GameCI)
needs: unity-license-gate
if: ${{ needs.unity-license-gate.outputs.has_license == 'true' }}
runs-on: ubuntu-latest
steps:
- uses: actions/checkout@v6
- uses: game-ci/unity-test-runner@v4
env:
UNITY_LICENSE: ${{ secrets.UNITY_LICENSE }}
with:
projectPath: src/UnityProject/uav-simulator
unityVersion: 6000.1.8f1
testMode: all
artifactsPath: artifacts
python-tests:
name: Python tests + lint
runs-on: ubuntu-latest
steps:
- uses: actions/checkout@v6
- uses: actions/setup-python@v6
with:
python-version: "3.11"
cache: pip
cache-dependency-path: python/pyproject.toml
- name: Install package + test extras + dev tooling
run: |
python -m pip install --upgrade pip
python -m pip install -e ".[test,dev]"
working-directory: python
- name: Ruff check
run: ruff check .
working-directory: python
# NOTE: `ruff format --check` is deferred — running it would touch 48
# files in a single mass-reformat commit. Plan: run `ruff format .` in a
# dedicated commit, then add the `--check` step here.
- name: Pytest with coverage
run: |
pytest \
--cov=sim_client --cov=training --cov=bridges \
--cov-report=term-missing \
--cov-report=xml:coverage.xml
working-directory: python
- name: Upload coverage artifact
if: always()
uses: actions/upload-artifact@v4
with:
name: python-coverage
path: python/coverage.xml
if-no-files-found: ignore
rusim-smoke:
name: rusim CLI smoke test
runs-on: ubuntu-latest
steps:
- uses: actions/checkout@v6
- uses: actions/setup-python@v6
with:
python-version: "3.11"
- name: Install package
run: |
python -m pip install --upgrade pip
python -m pip install -e .
working-directory: python
- name: rusim --help
run: rusim --help
- name: rusim scenario list
run: rusim scenario list || true # tolerate empty registry on a clean checkout
- name: Validate every shipped scenario (top-level + robustness/)
run: |
set -e
shopt -s nullglob globstar
for f in configs/scenarios/**/*.yaml; do
echo "::group::validate $f"
rusim scenario validate "$f"
echo "::endgroup::"
done
shell: bash
demo-proof-ci:
# Smoke that runs without a live Unity Editor: validates plugin SDK packaging
# workflow end-to-end (template → build → install dry-run → unpack) for
# both plugin types (vehicle + track) so a regression in either branch
# of `validate_plugin_workflow.sh` blocks the build.
name: Plugin packaging smoke (vehicle + track)
runs-on: ubuntu-latest
steps:
- uses: actions/checkout@v6
- uses: actions/setup-python@v6
with:
python-version: "3.11"
- name: Install rusim CLI
run: |
python -m pip install --upgrade pip
python -m pip install -e .
working-directory: python
- name: Plugin packaging smoke (vehicle)
run: make plugin-smoke
- name: Plugin packaging smoke (track)
run: make plugin-smoke-track