-
Notifications
You must be signed in to change notification settings - Fork 2
181 lines (145 loc) · 5.26 KB
/
ci.yml
File metadata and controls
181 lines (145 loc) · 5.26 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
172
173
174
175
176
177
178
179
180
181
name: CI/CD Pipeline
on:
pull_request:
branches: [ main, develop ]
push:
branches: [ main ]
jobs:
build-and-test:
name: Build & Test
runs-on: ubuntu-latest
steps:
- name: Checkout repository
uses: actions/checkout@v4
with:
fetch-depth: 0 # Full history for better analysis
- name: Setup .NET
uses: actions/setup-dotnet@v4
with:
dotnet-version: '9.0.x'
- name: Restore dependencies
run: dotnet restore OpenFairway.sln
- name: Build solution
run: dotnet build OpenFairway.sln --configuration Release --no-restore
- name: Run rollout physics tests
run: dotnet test --filter "Category=RolloutPhysics" --configuration Release --no-build --verbosity normal --logger "trx;LogFileName=test-results.trx"
- name: Upload test results
uses: actions/upload-artifact@v4
if: always()
with:
name: test-results
path: '**/test-results.trx'
retention-days: 30
- name: Test Summary
run: |
echo "✅ Rollout Physics Tests Passed"
echo ""
echo "Note: Other tests require Godot runtime and must be run locally."
echo "Run locally: dotnet test OpenFairway.sln"
code-quality:
name: Code Quality Checks
runs-on: ubuntu-latest
steps:
- name: Checkout repository
uses: actions/checkout@v4
- name: Setup .NET
uses: actions/setup-dotnet@v4
with:
dotnet-version: '9.0.x'
- name: Restore dependencies
run: dotnet restore OpenFairway.sln
- name: Check C# code formatting
run: dotnet format OpenFairway.sln --verify-no-changes --verbosity diagnostic --exclude addons
- name: Run .NET code analyzers
run: dotnet build OpenFairway.sln --configuration Release /p:TreatWarningsAsErrors=false /p:RunAnalyzers=true
gdscript-lint:
name: GDScript Linting
runs-on: ubuntu-latest
steps:
- name: Checkout repository
uses: actions/checkout@v4
- name: Setup Python
uses: actions/setup-python@v5
with:
python-version: '3.11'
- name: Install gdlint
run: pip install gdtoolkit
- name: Run gdlint on project GDScript files
run: |
# Lint only project GDScript files (exclude third-party addons)
find ./addons/openfairway -name "*.gd" -exec gdlint {} + || true
find ./game -name "*.gd" -exec gdlint {} + || true
find ./ui -name "*.gd" -exec gdlint {} + || true
find ./utils -name "*.gd" -exec gdlint {} + || true
find ./tcp -name "*.gd" -exec gdlint {} + || true
continue-on-error: true # Don't fail build on GDScript linting warnings
check-physics-formulas:
name: Physics Formula Validation
runs-on: ubuntu-latest
steps:
- name: Checkout repository
uses: actions/checkout@v4
- name: Setup .NET
uses: actions/setup-dotnet@v4
with:
dotnet-version: '9.0.x'
- name: Restore dependencies
run: dotnet restore OpenFairway.sln
- name: Build solution
run: dotnet build OpenFairway.sln --configuration Release --no-restore
- name: Validate rollout physics formulas
run: |
echo "=== Validating Rollout Physics Formulas ==="
dotnet test --filter "Category=RolloutPhysics" --configuration Release --no-build --logger "console;verbosity=detailed"
- name: Check for physics regression
run: |
echo "=== Physics Formula Validation Summary ==="
echo "✓ Velocity scaling curve (chip/bump/driver speeds)"
echo "✓ Spin multiplier curve (1250-1750 RPM bump range)"
echo "✓ Expected friction multipliers validated"
echo ""
echo "Expected values:"
echo " - Chip (2785 RPM @ 2.44 m/s): ×1.95"
echo " - Bump (1365 RPM @ 9.25 m/s): ×1.37"
echo " - Driver (1118 RPM @ 16 m/s): ×1.20-1.30"
security-scan:
name: Security Analysis
runs-on: ubuntu-latest
permissions:
security-events: write
steps:
- name: Checkout repository
uses: actions/checkout@v4
- name: Run .NET security scanning
uses: github/codeql-action/init@v3
with:
languages: csharp
config-file: ./.github/codeql/codeql-config.yml
- name: Setup .NET
uses: actions/setup-dotnet@v4
with:
dotnet-version: '9.0.x'
- name: Build for security analysis
run: dotnet build OpenFairway.sln --configuration Release
- name: Perform CodeQL Analysis
uses: github/codeql-action/analyze@v3
summary:
name: CI Summary
runs-on: ubuntu-latest
needs: [build-and-test, code-quality, check-physics-formulas]
if: always()
steps:
- name: Check job statuses
run: |
echo "=== CI Pipeline Summary ==="
echo "Build & Test: ${{ needs.build-and-test.result }}"
echo "Code Quality: ${{ needs.code-quality.result }}"
echo "Physics Formulas: ${{ needs.check-physics-formulas.result }}"
if [ "${{ needs.build-and-test.result }}" != "success" ] || \
[ "${{ needs.code-quality.result }}" != "success" ] || \
[ "${{ needs.check-physics-formulas.result }}" != "success" ]; then
echo "❌ CI pipeline failed - check job outputs above"
exit 1
else
echo "✅ All checks passed!"
fi