Repository navigation
112 lines (90 loc) · 3.35 KB
/
Copy pathpytest.yml
File metadata and controls
112 lines (90 loc) · 3.35 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
# This workflow will install Python dependencies, run tests and lint with a variety of Python versions
# For more information see: https://help.github.com/actions/language-and-framework-guides/using-python-with-github-actions
name: Python package
concurrency:
group: ${{ github.workflow }}-${{ github.ref }}
cancel-in-progress: true
on:
push:
branches: [master]
pull_request:
branches: [master]
jobs:
build:
runs-on: ubuntu-latest
strategy:
matrix:
python-version: ["3.11", "3.12", "3.13", "3.14", "3.15"]
steps:
- uses: actions/checkout@v4
with:
fetch-depth: 0 # Needed for hatch-vcs to determine version
- name: Set up Python ${{ matrix.python-version }}
uses: actions/setup-python@v5
with:
python-version: ${{ matrix.python-version }}
- name: Install uv
uses: astral-sh/setup-uv@v5
with:
enable-cache: true
- name: Create an empty webui data (editable build)
run: |
mkdir -p src/experimaestro/webui/data
- name: Install dependencies
run: |
uv sync --all-extras
- name: Lint with ruff
run: |
uv run ruff check src/experimaestro
- name: Type check with mypy
# pyproject.toml targets the minimum version; each job also checks
# its own version (stdlib stubs, installed packages)
run: |
uv run mypy --python-version ${{ matrix.python-version }} src/experimaestro
- name: Test with pytest
timeout-minutes: 15
env:
XPM_TEST_TIMEOUT_MULTIPLIER: "10"
run: |
uv run pytest -n auto
# UI feature tests in a real browser (the other jobs run them with the TUI
# and WebSocket drivers only). Uses the committed frontend build.
ui-browser:
runs-on: ubuntu-latest
steps:
- uses: actions/checkout@v4
with:
fetch-depth: 0 # Needed for hatch-vcs to determine version
- name: Set up Python
uses: actions/setup-python@v5
with:
python-version: "3.13"
- name: Install uv
uses: astral-sh/setup-uv@v5
with:
enable-cache: true
- name: Install dependencies
run: uv sync --all-extras --group browser
# The browsers depend on the Playwright version (from uv.lock)
- name: Get the Playwright version
id: playwright
run: echo "version=$(uv run --group browser python -c 'import importlib.metadata as m; print(m.version("playwright"))')" >> "$GITHUB_OUTPUT"
- name: Cache the Playwright browsers
id: playwright-cache
uses: actions/cache@v4
with:
path: ~/.cache/ms-playwright
key: playwright-${{ runner.os }}-${{ steps.playwright.outputs.version }}-chromium
- name: Install Chromium
if: steps.playwright-cache.outputs.cache-hit != 'true'
run: uv run --group browser playwright install --with-deps chromium
# System libraries are not cached
- name: Install Chromium system dependencies
if: steps.playwright-cache.outputs.cache-hit == 'true'
run: uv run --group browser playwright install-deps chromium
- name: Test the UIs in a browser
timeout-minutes: 15
env:
XPM_TEST_BROWSER: "1"
run: |
uv run --group browser pytest src/experimaestro/tests/ui