-
Notifications
You must be signed in to change notification settings - Fork 2
111 lines (99 loc) · 3.91 KB
/
Copy pathci.yml
File metadata and controls
111 lines (99 loc) · 3.91 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
# The suites are plain scripts, not pytest, so this runs them the same way
# a person would. The point of the matrix is not redundancy: QuantPilot is
# developed on Windows, and the only Windows-specific code is the tray icon,
# the global hotkey and the shortcut installer — all of which fail soft. This
# is what proves the terminal itself runs on macOS and Linux, rather than
# leaving it as an assumption in the README.
name: tests
on:
push:
branches: [main]
pull_request:
workflow_dispatch:
# Read-only by default. Nothing here publishes, comments or tags, so nothing
# here needs a token that could.
permissions:
contents: read
# A second push to the same branch makes the first run irrelevant. Cancelling
# it keeps the queue short without ever cancelling a run on main.
concurrency:
group: ${{ github.workflow }}-${{ github.ref }}
cancel-in-progress: ${{ github.ref != 'refs/heads/main' }}
jobs:
lint:
name: ruff
runs-on: ubuntu-latest
steps:
- uses: actions/checkout@v7
- uses: actions/setup-python@v7
with:
python-version: '3.13'
cache: pip
- run: pip install -r requirements-dev.txt
# Config lives in ruff.toml so this is exactly what a contributor runs.
- run: ruff check .
test:
name: ${{ matrix.os }} · py${{ matrix.python }}
runs-on: ${{ matrix.os }}
strategy:
fail-fast: false # one platform failing must not hide the others
matrix:
os: [ubuntu-latest, macos-latest, windows-latest]
python: ['3.11', '3.13']
steps:
- uses: actions/checkout@v7
- uses: actions/setup-python@v7
with:
python-version: ${{ matrix.python }}
cache: pip
- run: python -m pip install --upgrade pip
- run: pip install -r requirements.txt
# Self-contained: no snapshot, no network, no ~/.quantpilot. These
# must pass everywhere or the change does not ship.
- name: screen
run: python tests/test_screen.py
- name: store
run: python tests/test_store.py
- name: clock
run: python tests/test_clock.py
- name: diffs
run: python tests/test_diffs.py
- name: options
run: python tests/test_options.py
# The dividend and IPO calendars, against pasted Nasdaq payloads —
# the dates in them are fixed, so this asserts the same thing on a
# runner in any timezone.
- name: calendars
run: python tests/test_calendars.py
# Also offline: the channel probe runs against a stubbed fetch, which
# is the only way to assert on "who is on air" without the answer
# changing under the test.
- name: live news
run: python tests/test_livenews.py
# The address check on the article reader. Uses IP literals and one
# .invalid name, so it asserts the same thing on a runner with no DNS.
- name: article
run: python tests/test_article.py
# These two exercise the HTTP server and the tick decoder. They pass
# offline locally; the matrix is what tells us whether that holds on a
# runner with no market data and a different loopback stack.
- name: server
run: python tests/test_server.py
- name: stream
run: python tests/test_stream.py
- uses: actions/setup-node@v7
with:
node-version: '20'
# ui_smoke boots the whole UI in jsdom — the only thing that catches a
# runtime throw at page load, which otherwise leaves the terminal
# rendering perfectly with every handler after the bad line dead.
# ui_units goes underneath it: formatting, virtualization, the token
# on every API call, and escaping. One jsdom install serves both.
- name: ui smoke
working-directory: tests
run: |
npm install jsdom --no-fund --no-audit
cd ..
node tests/ui_smoke.js
- name: ui units
run: node tests/ui_units.js