-
Notifications
You must be signed in to change notification settings - Fork 2.2k
181 lines (154 loc) · 5.61 KB
/
Copy pathpython-ci.yml
File metadata and controls
181 lines (154 loc) · 5.61 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: Python CI
on:
push:
branches: [main]
pull_request:
branches: [main]
permissions:
contents: read
concurrency:
group: python-ci-${{ github.ref }}
cancel-in-progress: ${{ github.event_name == 'pull_request' }}
jobs:
test:
runs-on: ubuntu-24.04
timeout-minutes: 30
strategy:
fail-fast: false
matrix:
python-version: ["3.12", "3.13", "3.14"]
steps:
- name: Check out repository
uses: actions/checkout@v4
with:
fetch-depth: 0
- name: Classify changes
id: scope
uses: ./.github/actions/ci-scope
- name: Set up Python
if: steps.scope.outputs.runtime_changed == 'true'
uses: actions/setup-python@v5
with:
python-version: ${{ matrix.python-version }}
cache: pip
cache-dependency-path: scripts/ci/requirements.lock
- name: Install package and test tools
if: steps.scope.outputs.runtime_changed == 'true'
run: |
python -m pip install -r scripts/ci/requirements.lock
python -m pip install --no-deps --no-build-isolation -e ".[test]"
- name: Run tests
if: steps.scope.outputs.runtime_changed == 'true'
run: |
python -m pip check
python -m pytest -v --durations=10 --junitxml=test-results/python.xml
- name: Upload test results
if: always() && steps.scope.outputs.runtime_changed == 'true'
uses: actions/upload-artifact@v4
with:
name: python-${{ matrix.python-version }}-results
path: test-results/
retention-days: 7
windows-lifecycle:
name: Windows lifecycle locks and platform isolation
runs-on: windows-2022
timeout-minutes: 30
steps:
- name: Check out repository
uses: actions/checkout@v4
with:
fetch-depth: 0
- name: Classify changes
id: scope
uses: ./.github/actions/ci-scope
- name: Set up Python
if: steps.scope.outputs.runtime_changed == 'true'
uses: actions/setup-python@v5
with:
python-version: "3.12"
cache: pip
cache-dependency-path: scripts/ci/requirements.lock
- name: Install package and test tools
if: steps.scope.outputs.runtime_changed == 'true'
shell: bash
run: |
python -m pip install -r scripts/ci/requirements.lock
python -m pip install --no-deps --no-build-isolation -e ".[test]"
python -m pip check
- name: Verify shared leases, startup recovery, and scheduler leadership
if: steps.scope.outputs.runtime_changed == 'true'
run: >-
python -m pytest -v --durations=10 --junitxml=test-results/windows-lifecycle.xml
tests/application/test_application_lease.py
tests/application/test_automation_scheduler_leadership.py
tests/application/test_session_deletion_service.py
tests/application/test_execution_coordinator.py
# These suites carry Windows-gated cases (NTFS ACLs, the Job Object
# backend) that the ubuntu job can only skip. This is the sole place
# they actually execute.
- name: Verify Windows ACLs and Job Object sandbox
if: steps.scope.outputs.runtime_changed == 'true'
run: >-
python -m pytest -v --durations=10 --junitxml=test-results/windows-platform.xml
tests/test_private_storage_windows.py
tests/test_harness_sandbox.py
tests/test_exec_sandbox_wiring.py
tests/app_server/test_windows_task.py
tests/app_server/test_state_backup.py
tests/test_provider_oauth.py
tests/test_provider_protocols.py
tests/app_server/test_service.py
tests/app_server/test_service_discovery.py
- name: Upload test results
if: always() && steps.scope.outputs.runtime_changed == 'true'
uses: actions/upload-artifact@v4
with:
name: windows-lifecycle-results
path: test-results/
retention-days: 7
package:
runs-on: ubuntu-24.04
timeout-minutes: 20
steps:
- name: Check out repository
uses: actions/checkout@v4
with:
fetch-depth: 0
- name: Classify changes
id: scope
uses: ./.github/actions/ci-scope
- name: Set up Python
if: steps.scope.outputs.runtime_changed == 'true'
uses: actions/setup-python@v5
with:
python-version: "3.12"
cache: pip
cache-dependency-path: scripts/ci/requirements.lock
- name: Set up Node for packaged web assets
if: steps.scope.outputs.runtime_changed == 'true'
uses: actions/setup-node@v4
with:
node-version: "22"
cache: npm
cache-dependency-path: desktop/package-lock.json
- name: Build packaged browser client
if: steps.scope.outputs.runtime_changed == 'true'
working-directory: desktop
run: |
npm ci
npm run build:web
- name: Build distributions
if: steps.scope.outputs.runtime_changed == 'true'
run: |
python -m pip install -r scripts/ci/requirements.lock
python -m build --no-isolation
python -m twine check dist/*
- name: Verify distribution metadata and installed runtime
if: steps.scope.outputs.runtime_changed == 'true'
run: python scripts/verify_python_distribution.py --dist-dir dist
- name: Upload distributions
if: steps.scope.outputs.runtime_changed == 'true'
uses: actions/upload-artifact@v4
with:
name: python-distributions
path: dist/