-
Notifications
You must be signed in to change notification settings - Fork 5
294 lines (266 loc) · 10.9 KB
/
Copy pathci-pr.yml
File metadata and controls
294 lines (266 loc) · 10.9 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
250
251
252
253
254
255
256
257
258
259
260
261
262
263
264
265
266
267
268
269
270
271
272
273
274
275
276
277
278
279
280
281
282
283
284
285
286
287
288
289
290
291
292
293
294
name: ci pr
# PR verification: format + build/test matrix.
# Main push uses ci-main.yml which adds publish/release/notify.
on:
pull_request:
concurrency:
group: ${{ github.workflow }}-${{ github.ref }}
cancel-in-progress: true
permissions:
contents: read
checks: write
jobs:
check-format:
runs-on: ubuntu-latest
steps:
- uses: actions/checkout@v4
- name: Install clang-format
run: pip install clang-format==19.1.7
- name: Check formatting
run: bash scripts/format.sh --check
build:
needs: [check-format]
strategy:
fail-fast: false
matrix:
include:
- name: linux
preset: default
build_dir: build
runner: ubuntu-22.04
# arm64 is validated by the publish-side docker build (ci-main publish
# arm64 entry); skipped here to avoid the ubuntu-runner ↔ bookworm-tarball
# glog ABI mismatch. arm64 regressions surface at main-push time.
- name: macos
preset: default
build_dir: build
runner: macos-15
- name: asan debug
preset: san
build_dir: build-san
runner: [self-hosted, linode]
name: ${{ matrix.name }}
runs-on: ${{ matrix.runner }}
steps:
- uses: actions/checkout@v4
with:
submodules: recursive
- name: Install system dependencies
run: |
if [[ "$(uname)" == "Darwin" ]]; then
deps/moxygen/standalone/install-system-deps.sh
brew install coreutils
echo "/opt/homebrew/opt/coreutils/libexec/gnubin" >> "$GITHUB_PATH"
else
sudo deps/moxygen/standalone/install-system-deps.sh
fi
- name: Setup dependencies
env:
GH_TOKEN: ${{ secrets.GITHUB_TOKEN }}
MOQX_PLATFORM: ${{ matrix.platform || '' }}
run: |
# Three-mode setup resolution:
# 1. .moxygen-release file (release branches): use pinned tag.
# 2. Submodule SHA reachable from moxygen main: tarball mode via
# snapshot-latest. Robust to drift between moxygen merges and
# moqx's daily moxygen-sync.
# 3. Submodule SHA NOT reachable from main (dev iterating against
# an unreleased moxygen feature branch): source build. Slow
# but supports cross-repo iteration without requiring a
# published moxygen tarball.
if [ -f .moxygen-release ]; then
export MOQX_MOXYGEN_RELEASE_TAG=$(cat .moxygen-release | tr -d '[:space:]')
echo "==> Pinned moxygen tag: $MOQX_MOXYGEN_RELEASE_TAG"
bash scripts/build.sh setup --no-fallback
else
SUB_SHA=$(git -C deps/moxygen rev-parse HEAD)
AHEAD=$(gh api "repos/openmoq/moxygen/compare/main...$SUB_SHA" --jq .ahead_by 2>/dev/null || echo "1")
if [ "$AHEAD" = "0" ]; then
echo "==> moxygen submodule $SUB_SHA on main → snapshot tarball"
bash scripts/build.sh setup --use-latest --no-fallback
else
echo "==> moxygen submodule $SUB_SHA $AHEAD commits diverged from main → source build"
bash scripts/build.sh setup
fi
fi
- name: Build
run: bash scripts/build.sh --profile ${{ matrix.preset }} --build-dir ${{ matrix.build_dir }}
- name: Test
env:
ASAN_OPTIONS: ${{ matrix.name == 'asan debug' && 'detect_leaks=1:abort_on_error=1' || '' }}
run: bash scripts/build.sh test --build-dir ${{ matrix.build_dir }} -- --output-junit test-results.xml
# dorny/test-reporter writes a Check Run, which needs 'checks: write' on
# GITHUB_TOKEN. Fork-PR tokens are read-only regardless of workflow perms,
# so skip on cross-repo PRs. test-log output above still shows pass/fail.
- name: Publish test results
uses: dorny/test-reporter@v1.9.1
if: ${{ (success() || failure()) && (github.event_name != 'pull_request' || github.event.pull_request.head.repo.full_name == github.repository) }}
with:
name: "test (${{ matrix.name }})"
path: ${{ matrix.build_dir }}/test-results.xml
reporter: java-junit
fail-on-empty: ${{ job.status == 'success' && 'true' || 'false' }}
# Only list failing tests in the Check Run summary. Listing all
# passing tests too blows GitHub's 64 KiB output-body cap on large
# suites; the per-suite pass/fail counts at the top still render.
list-tests: failed
- name: Note fork-PR reporter skip
if: ${{ github.event_name == 'pull_request' && github.event.pull_request.head.repo.full_name != github.repository }}
run: |
echo "::notice::Publish test results skipped — fork-PR GITHUB_TOKEN lacks checks:write. Test-log output above is authoritative."
conformance:
needs: [check-format]
strategy:
fail-fast: false
matrix:
include:
# mvfst — both transports for d14 and d16. d14+WT was unblocked by
# facebookexperimental/moxygen#151 (Accept moq-00 in WT-Available-Protocols).
# pico — raw QUIC for d14 and d16. WT cells deferred until pico
# WT CONNECT (openmoq/moxygen#172 / PR #173) syncs in.
- name: mvfst d14 Q
versions: "14"
transport: "Q"
stack: "mvfst"
- name: mvfst d14 WT
versions: "14"
transport: ""
stack: "mvfst"
- name: mvfst d16 Q
versions: "16"
transport: "Q"
stack: "mvfst"
- name: mvfst d16 WT
versions: "16"
transport: ""
stack: "mvfst"
- name: pico d14 Q
versions: "14"
transport: "Q"
stack: "pico"
- name: pico d16 Q
versions: "16"
transport: "Q"
stack: "pico"
name: conformance (${{ matrix.name }})
runs-on: ubuntu-22.04
steps:
- name: Generate app token
id: app-token
uses: actions/create-github-app-token@v2
with:
app-id: ${{ secrets.OMOQ_APP_ID }}
private-key: ${{ secrets.OMOQ_APP_PRIV_KEY }}
- uses: actions/checkout@v4
with:
submodules: recursive
- name: Install system dependencies
run: sudo deps/moxygen/standalone/install-system-deps.sh
- name: Setup dependencies
env:
GH_TOKEN: ${{ steps.app-token.outputs.token }}
run: |
# Three-mode setup resolution (matches build job).
if [ -f .moxygen-release ]; then
export MOQX_MOXYGEN_RELEASE_TAG=$(cat .moxygen-release | tr -d '[:space:]')
echo "==> Pinned moxygen tag: $MOQX_MOXYGEN_RELEASE_TAG"
bash scripts/build.sh setup --no-fallback
else
SUB_SHA=$(git -C deps/moxygen rev-parse HEAD)
AHEAD=$(gh api "repos/openmoq/moxygen/compare/main...$SUB_SHA" --jq .ahead_by 2>/dev/null || echo "1")
if [ "$AHEAD" = "0" ]; then
echo "==> moxygen submodule $SUB_SHA on main → snapshot tarball"
bash scripts/build.sh setup --use-latest --no-fallback
else
echo "==> moxygen submodule $SUB_SHA $AHEAD commits diverged from main → source build"
bash scripts/build.sh setup
fi
fi
- name: Build
run: bash scripts/build.sh
- name: Run conformance tests
run: bash test/test_conformance.sh ./build/moqx ${{ matrix.versions }} ${{ matrix.transport }} ${{ matrix.stack }}
microbenchmark:
needs: [check-format]
strategy:
fail-fast: false
matrix:
include:
- name: linux
runner: ubuntu-22.04
- name: macos
# Pinned to match the moxygen publish runner: snapshot-latest ships
# moxygen-macos-15-arm64.tar.gz, and this job downloads it with
# --no-fallback. macos-latest now resolves to macOS 26 (gradual
# rollout), which requests a macos-26 tarball that 404s. Keep in
# lockstep with the build job above (also macos-15).
runner: macos-15
name: microbenchmark (${{ matrix.name }})
runs-on: ${{ matrix.runner }}
steps:
- name: Generate app token
id: app-token
uses: actions/create-github-app-token@v2
with:
app-id: ${{ secrets.OMOQ_APP_ID }}
private-key: ${{ secrets.OMOQ_APP_PRIV_KEY }}
- uses: actions/checkout@v4
with:
submodules: recursive
- name: Install system dependencies
run: |
if [[ "$(uname)" == "Darwin" ]]; then
deps/moxygen/standalone/install-system-deps.sh
else
sudo deps/moxygen/standalone/install-system-deps.sh
fi
- name: Setup dependencies
env:
GH_TOKEN: ${{ steps.app-token.outputs.token }}
run: |
# Three-mode setup resolution (mirrors the build/conformance jobs):
# 1. .moxygen-release file (release branches): use pinned tag.
# 2. Submodule SHA reachable from moxygen main: snapshot tarball
# (avoids a slow from-source dep build when moxygen has advanced
# past the local pin — the common case under the daily sync).
# 3. Submodule SHA diverged from main: source build.
if [ -f .moxygen-release ]; then
export MOQX_MOXYGEN_RELEASE_TAG=$(cat .moxygen-release | tr -d '[:space:]')
echo "==> Pinned moxygen tag: $MOQX_MOXYGEN_RELEASE_TAG"
bash scripts/build.sh setup --no-fallback
else
SUB_SHA=$(git -C deps/moxygen rev-parse HEAD)
AHEAD=$(gh api "repos/openmoq/moxygen/compare/main...$SUB_SHA" --jq .ahead_by 2>/dev/null || echo "1")
if [ "$AHEAD" = "0" ]; then
echo "==> moxygen submodule $SUB_SHA on main → snapshot tarball"
bash scripts/build.sh setup --use-latest --no-fallback
else
echo "==> moxygen submodule $SUB_SHA $AHEAD commits diverged from main → source build"
bash scripts/build.sh setup
fi
fi
- name: Build microbenchmarks
run: bash scripts/build.sh --benchmark
- name: Run microbenchmarks
run: |
./build/benchmark/moqx_benchmark \
--bm_json_verbose=microbench-results.json \
| tee microbench-output.txt
- name: Render summary
if: always()
run: |
{
echo "## Microbenchmark results — ${{ matrix.name }}"
echo ""
echo '```'
cat microbench-output.txt
echo '```'
} >> "$GITHUB_STEP_SUMMARY"
- name: Upload microbenchmark artifacts
if: always()
uses: actions/upload-artifact@v4
with:
name: microbench-results-${{ matrix.name }}
path: |
microbench-results.json
microbench-output.txt