-
Notifications
You must be signed in to change notification settings - Fork 104
108 lines (93 loc) · 3.17 KB
/
iris-unit-tests.yaml
File metadata and controls
108 lines (93 loc) · 3.17 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
name: Iris - Tests
on:
push:
branches:
- main
pull_request:
paths:
- lib/iris/**
- .github/workflows/iris-unit-tests.yaml
permissions:
contents: read
concurrency:
group: ${{ github.workflow }}-${{ github.event.pull_request.number || github.ref }}
cancel-in-progress: true
jobs:
cpu-test:
runs-on: ubuntu-latest
timeout-minutes: 10
strategy:
matrix:
python-version: ["3.12"]
steps:
- name: Checkout code
uses: actions/checkout@v4
- 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@v7
with:
enable-cache: true
cache-dependency-glob: "lib/iris/pyproject.toml"
- name: Test iris
env:
PYTHONASYNCIODEBUG: "1"
run: |
cd lib/iris && uv run --group dev python -m pytest -n4 --durations=5 --tb=short -m 'not slow and not docker and not e2e' tests/
e2e-smoke-test:
runs-on: ubuntu-latest
timeout-minutes: 5
strategy:
matrix:
python-version: ["3.12"]
steps:
- name: Checkout code
uses: actions/checkout@v4
- 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@v7
with:
enable-cache: true
cache-dependency-glob: "lib/iris/pyproject.toml"
- name: Cache Playwright browsers
id: playwright-cache
uses: actions/cache@v4
with:
path: ~/.cache/ms-playwright
key: playwright-${{ runner.os }}-${{ hashFiles('lib/iris/pyproject.toml') }}
- name: Install Playwright browsers
if: steps.playwright-cache.outputs.cache-hit != 'true'
run: cd lib/iris && uv run playwright install --with-deps chromium
- name: Install Playwright system deps
if: steps.playwright-cache.outputs.cache-hit == 'true'
run: cd lib/iris && uv run playwright install-deps chromium
- name: Run E2E smoke tests
env:
IRIS_SCREENSHOT_DIR: ${{ github.workspace }}/iris-screenshots
PYTHONASYNCIODEBUG: "1"
run: |
mkdir -p ${{ github.workspace }}/iris-screenshots
cd lib/iris && uv run --group dev python -m pytest \
tests/e2e/test_smoke.py \
-m e2e -o "addopts=" --tb=short -v
- name: Verify screenshots with Claude
if: always() && hashFiles('iris-screenshots/*.txt') != ''
env:
CLAUDE_CODE_OAUTH_TOKEN: ${{ secrets.CLAUDE_CODE_OAUTH_TOKEN || secrets.CLAUDE_MAX_OAUTH_TOKEN }}
run: |
npm install -g @anthropic-ai/claude-code
python lib/iris/scripts/verify_screenshots.py \
--screenshot-dir ${{ github.workspace }}/iris-screenshots
- name: Upload screenshots
if: always()
uses: actions/upload-artifact@v4
with:
name: iris-smoke-screenshots
path: iris-screenshots/
retention-days: 14
if-no-files-found: ignore