forked from huangruiteng/loopx
-
Notifications
You must be signed in to change notification settings - Fork 0
139 lines (126 loc) · 3.72 KB
/
Copy pathfull-public-smokes.yml
File metadata and controls
139 lines (126 loc) · 3.72 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
name: Full Public Smokes
on:
workflow_dispatch:
inputs:
timeout_seconds:
description: "Per-smoke timeout in seconds"
required: false
default: "120"
type: string
schedule:
# Daily off-hours sweep. The workflow is intentionally not a PR-required check.
- cron: "37 18 * * *"
push:
branches:
- main
paths:
- ".github/workflows/full-public-smokes.yml"
- "README.md"
- "README.zh-CN.md"
- "docs/**"
- "examples/**"
- "loopx/**"
- "pyproject.toml"
- "scripts/**"
permissions:
contents: read
concurrency:
group: full-public-smokes-${{ github.ref }}
cancel-in-progress: true
jobs:
full-public-smokes:
if: github.repository == 'huangruiteng/loopx'
runs-on: ubuntu-latest
timeout-minutes: 120
strategy:
fail-fast: false
matrix:
include:
- shard: 0
offset: 0
- shard: 1
offset: 100
- shard: 2
offset: 200
- shard: 3
offset: 300
- shard: 4
offset: 400
- shard: 5
offset: 500
- shard: 6
offset: 600
env:
SHARD_LIMIT: "100"
SMOKE_TIMEOUT_SECONDS: ${{ github.event_name == 'workflow_dispatch' && inputs.timeout_seconds || '120' }}
SMOKE_JOBS: "4"
steps:
- name: Check out repository
uses: actions/checkout@v7
with:
fetch-depth: 0
- name: Set up Python
uses: actions/setup-python@v6
with:
python-version: "3.11"
- name: Preview full-public shard
run: |
python3 examples/run-smokes.py \
--suite full-public \
--offset "${{ matrix.offset }}" \
--limit "${SHARD_LIMIT}" \
--timeout-seconds "${SMOKE_TIMEOUT_SECONDS}" \
--jobs "${SMOKE_JOBS}" \
--no-execute
- name: Run full-public shard
run: |
set -euo pipefail
mkdir -p smoke-results
python3 examples/run-smokes.py \
--suite full-public \
--offset "${{ matrix.offset }}" \
--limit "${SHARD_LIMIT}" \
--timeout-seconds "${SMOKE_TIMEOUT_SECONDS}" \
--jobs "${SMOKE_JOBS}" \
--json \
| tee "smoke-results/full-public-shard-${{ matrix.shard }}.json"
- name: Upload smoke result
if: always()
uses: actions/upload-artifact@v7
with:
name: full-public-smokes-shard-${{ matrix.shard }}
path: smoke-results/full-public-shard-${{ matrix.shard }}.json
if-no-files-found: ignore
smoke-fleet-health:
if: always()
needs: full-public-smokes
runs-on: ubuntu-latest
timeout-minutes: 10
steps:
- name: Check out repository
uses: actions/checkout@v7
- name: Set up Python
uses: actions/setup-python@v6
with:
python-version: "3.11"
- name: Download full-public receipts
continue-on-error: true
uses: actions/download-artifact@v7
with:
pattern: full-public-smokes-shard-*
path: smoke-results
merge-multiple: true
- name: Build compact smoke fleet health
run: |
mkdir -p smoke-health
python -m loopx.cli --format json canary smoke-health \
--receipt smoke-results \
> smoke-health/smoke-fleet-health.json
jq -e '.ready == true' smoke-health/smoke-fleet-health.json
- name: Upload smoke fleet health
if: always()
uses: actions/upload-artifact@v7
with:
name: smoke-fleet-health
path: smoke-health/smoke-fleet-health.json
if-no-files-found: ignore