-
Notifications
You must be signed in to change notification settings - Fork 2
107 lines (97 loc) · 3.87 KB
/
Copy pathquickstart-lifecycle.yml
File metadata and controls
107 lines (97 loc) · 3.87 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
name: Clean-machine quickstart lifecycle
on:
schedule:
# Weekly clean-machine drift detection is sufficient during development;
# release candidates can dispatch the same three-OS matrix on demand.
- cron: "30 7 * * 2" # Tuesdays 07:30 UTC
workflow_dispatch:
concurrency:
group: quickstart-lifecycle-${{ github.workflow }}-${{ github.ref }}
cancel-in-progress: true
permissions:
contents: read
jobs:
lifecycle:
name: lifecycle (${{ matrix.os }})
# Windows otherwise inherits the legacy console code page. Keep the
# harness, child CLIs, and uploaded JSON/log evidence on one UTF-8 contract.
env:
PYTHONUTF8: "1"
PYTHONIOENCODING: "utf-8"
strategy:
fail-fast: false
matrix:
os: [ubuntu-latest, macos-latest, windows-latest]
runs-on: ${{ matrix.os }}
steps:
- uses: actions/checkout@3d3c42e5aac5ba805825da76410c181273ba90b1 # v7.0.1
- uses: actions/setup-python@5fda3b95a4ea91299a34e894583c3862153e4b97 # v7.0.0
with:
python-version: "3.12"
cache: pip
cache-dependency-path: pyproject.toml
- name: Build wheel
run: |
python -m pip install build
python -m build --wheel --outdir lifecycle-dist
# The Linux lane passes --browser-with-deps, so the harness shells out to
# `playwright install --with-deps`, and that runs apt on the hosted
# runner. Point apt at the canonical archive first, and prove the archive
# answers inside a bounded step, so a mirror fault fails here in seconds
# instead of stalling inside the lifecycle harness.
- name: Prefer the canonical Ubuntu archive (Linux)
if: runner.os == 'Linux'
timeout-minutes: 5
run: |
set -uo pipefail
# The hosted runner resolves its Ubuntu mirror through
# /etc/apt/apt-mirrors.txt, which points at azure.archive.ubuntu.com.
# That mirror fails intermittently, and every failure costs minutes of
# apt retries before the canonical archive is tried. Keep this
# best-effort: if the file is absent or already canonical, the run
# continues unchanged.
sudo sed -i \
's|http://azure.archive.ubuntu.com/ubuntu|http://archive.ubuntu.com/ubuntu|g' \
/etc/apt/apt-mirrors.txt 2>/dev/null || true
update_ok=""
for attempt in 1 2 3; do
if sudo apt-get update; then
update_ok=1
break
fi
echo "::warning::apt-get update failed (attempt ${attempt}/3); retrying"
sleep $((attempt * 10))
done
if [ -z "$update_ok" ]; then
echo "::error::apt-get update failed three times; the Ubuntu mirror is unreachable"
exit 1
fi
- name: Full lifecycle (Linux)
if: runner.os == 'Linux'
run: >-
python scripts/quickstart_lifecycle.py
--wheel "lifecycle-dist/*.whl"
--work-dir "runs/lifecycle"
--install-browser
--browser-with-deps
--source-revision "${{ github.sha }}"
- name: Full lifecycle (macOS / Windows)
if: runner.os != 'Linux'
run: >-
python scripts/quickstart_lifecycle.py
--wheel "lifecycle-dist/*.whl"
--work-dir "runs/lifecycle"
--install-browser
--source-revision "${{ github.sha }}"
- name: Upload lifecycle evidence
if: always()
uses: actions/upload-artifact@043fb46d1a93c77aae656e7c1c64a875d1fc6a0a # v7.0.1
with:
name: quickstart-lifecycle-${{ matrix.os }}
path: |
runs/lifecycle/summary.json
runs/lifecycle/logs/*.log
runs/lifecycle/artifacts/**/REPORT.md
runs/lifecycle/artifacts/**/report.json
runs/lifecycle/artifacts/**/patch.json
if-no-files-found: error