-
Notifications
You must be signed in to change notification settings - Fork 0
249 lines (227 loc) · 7.34 KB
/
Copy pathtest.yml
File metadata and controls
249 lines (227 loc) · 7.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
172
173
174
175
176
177
178
179
180
181
182
183
184
185
186
187
188
189
190
191
192
193
194
195
196
197
198
199
200
201
202
203
204
205
206
207
208
209
210
211
212
213
214
215
216
217
218
219
220
221
222
223
224
225
226
227
228
229
230
231
232
233
234
235
236
237
238
239
240
241
242
243
244
245
246
247
248
249
name: Test Suite
on:
push:
branches: [main, develop]
pull_request:
branches: [main, develop]
concurrency:
group: test-${{ github.sha }}
cancel-in-progress: true
jobs:
# Primary job: full suite on Ubuntu / pinned tool versions. Acts as the
# gating check and produces the canonical `test-results` artifact.
test:
name: Run Test Suite (ubuntu / py3.11 / node20 / dotnet10)
runs-on: ubuntu-latest
env:
SF_DOTNET_TFM: net10.0
permissions:
contents: read
steps:
- name: Checkout code
uses: actions/checkout@v4
with:
submodules: true
- name: Set up Python
uses: actions/setup-python@v5
with:
python-version: "3.11"
- name: Set up Node.js
uses: actions/setup-node@v4
with:
node-version: "20"
- name: Set up .NET SDK
uses: actions/setup-dotnet@v4
with:
dotnet-version: "10.0.x"
dotnet-quality: "preview"
- name: Install system dependencies
run: |
sudo apt-get update
sudo apt-get install -y gcc g++ build-essential
- name: Install Python dependencies
run: |
python -m pip install --upgrade pip
pip install proto-schema-parser pytest hypothesis
- name: Install Node.js dependencies
run: npm ci
working-directory: tests/ts
- name: Run test suite
# --require-langs makes a missing toolchain a hard failure on this full
# matrix job, so a language can never be silently skipped and still
# report green (this job is expected to exercise all seven languages).
run: python test_all.py --require-langs c,cpp,py,ts,js,csharp,rust
- name: Check generated-file determinism
run: python tests/check_determinism.py --verbose
- name: Check wire-format goldens
run: python tests/check_golden.py --verbose
- name: Check test-coverage doc is up to date
run: python tests/gen_test_coverage.py --check
- name: Upload test results
if: always()
uses: actions/upload-artifact@v4
with:
name: test-results
path: |
tests/generated/
tests/c/build/
tests/cpp/build/
tests/py/build/
retention-days: 5
# Cross-OS matrix: confirm the suite is portable to macOS. Each runner
# only exercises languages whose toolchains are present out of the box,
# so we drop .NET on macOS to avoid spending the matrix on installer flakes.
# Windows is intentionally not in the matrix — `tests/run_tests.py` uses
# POSIX-style shell quoting and many compile invocations would need
# individual debugging. Tracked as a follow-up.
os-matrix:
name: ${{ matrix.os }} (py3.11)
runs-on: ${{ matrix.os }}
permissions:
contents: read
strategy:
fail-fast: false
matrix:
os: [macos-latest]
steps:
- uses: actions/checkout@v4
with: { submodules: true }
- uses: actions/setup-python@v5
with: { python-version: "3.11" }
- uses: actions/setup-node@v4
with: { node-version: "20" }
- name: Install Python deps
run: pip install proto-schema-parser pytest
- name: Install Node deps
run: npm ci
working-directory: tests/ts
- name: Run test suite (skip C# — no .NET 10 SDK on macOS runner)
run: python test_all.py --skip-lang csharp
# Python version matrix: catch interpreter-specific regressions. We skip
# the heavier compiled-language phases via --skip-lang to keep wall time
# to ~ the time of the Python phase itself.
python-matrix:
name: python ${{ matrix.python }}
runs-on: ubuntu-latest
permissions:
contents: read
strategy:
fail-fast: false
matrix:
python: ["3.9", "3.11", "3.13"]
steps:
- uses: actions/checkout@v4
with: { submodules: true }
- uses: actions/setup-python@v5
with:
python-version: ${{ matrix.python }}
- uses: actions/setup-node@v4
with: { node-version: "20" }
- name: Install Python deps
run: pip install proto-schema-parser pytest
- name: Install Node deps
run: npm ci
working-directory: tests/ts
- name: Run Python + C suite
run: python test_all.py --skip-lang csharp --skip-lang rust
# Node version matrix: focused JS/TS validation against supported LTS lines.
node-matrix:
name: node ${{ matrix.node }}
runs-on: ubuntu-latest
permissions:
contents: read
strategy:
fail-fast: false
matrix:
node: ["18", "20", "22"]
steps:
- uses: actions/checkout@v4
with: { submodules: true }
- uses: actions/setup-python@v5
with: { python-version: "3.11" }
- uses: actions/setup-node@v4
with:
node-version: ${{ matrix.node }}
- name: Install Python deps
run: pip install proto-schema-parser pytest
- name: Install Node deps
run: npm ci
working-directory: tests/ts
- name: Run JS + TS suite
run: python test_all.py --skip-lang csharp --skip-lang rust
# .NET 8 compatibility lane.
dotnet-8:
name: dotnet 8.0.x
runs-on: ubuntu-latest
env:
SF_DOTNET_TFM: net8.0
permissions:
contents: read
steps:
- uses: actions/checkout@v4
with: { submodules: true }
- uses: actions/setup-python@v5
with: { python-version: "3.11" }
- uses: actions/setup-dotnet@v4
with:
dotnet-version: "8.0.x"
dotnet-quality: "ga"
- name: Install Python deps
run: pip install proto-schema-parser pytest
- name: Run C# slice
run: python test_all.py --skip-lang rust
# .NET 10 compatibility lane.
dotnet-10:
name: dotnet 10.0.x
runs-on: ubuntu-latest
env:
SF_DOTNET_TFM: net10.0
permissions:
contents: read
steps:
- uses: actions/checkout@v4
with: { submodules: true }
- uses: actions/setup-python@v5
with: { python-version: "3.11" }
- uses: actions/setup-dotnet@v4
with:
dotnet-version: "10.0.x"
dotnet-quality: "preview"
- name: Install Python deps
run: pip install proto-schema-parser pytest
- name: Run C# slice
run: python test_all.py --skip-lang rust
# Compiler matrix: GCC vs Clang for the C / C++ binaries.
compiler-matrix:
name: ${{ matrix.cc }} / ${{ matrix.cxx }}
runs-on: ubuntu-latest
permissions:
contents: read
strategy:
fail-fast: false
matrix:
include:
- cc: gcc
cxx: g++
pkg: gcc
- cc: clang
cxx: clang++
pkg: clang
env:
CC: ${{ matrix.cc }}
CXX: ${{ matrix.cxx }}
steps:
- uses: actions/checkout@v4
with: { submodules: true }
- uses: actions/setup-python@v5
with: { python-version: "3.11" }
- uses: actions/setup-node@v4
with: { node-version: "20" }
- name: Install compiler
run: |
sudo apt-get update
sudo apt-get install -y ${{ matrix.pkg }} build-essential
pip install proto-schema-parser pytest hypothesis
(cd tests/ts && npm ci)
- name: Run C / C++ suite under ${{ matrix.cc }}
run: python test_all.py --skip-lang csharp --skip-lang rust