Repository navigation
209 lines (200 loc) · 7.51 KB
/
Copy pathtests.yml
File metadata and controls
209 lines (200 loc) · 7.51 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
182
183
184
185
186
187
188
189
190
191
192
193
194
195
196
197
198
199
200
201
202
203
204
205
206
207
208
209
name: tests
on:
push:
branches: [master]
tags: ['v*']
pull_request:
jobs:
test:
runs-on: ubuntu-latest
permissions:
contents: read
timeout-minutes: 10
strategy:
fail-fast: false
matrix:
python-version: ["3.12", "3.13", "3.14", "3.15"]
steps:
- uses: actions/checkout@v7
- uses: astral-sh/setup-uv@v10.2.0
with:
version-file: .tool-versions
enable-cache: true
- uses: actions/setup-python@v7
with:
python-version: ${{ matrix.python-version }}
- name: Install just
uses: extractions/setup-just@v4
- name: Install dependencies
run: uv sync --all-groups
- name: Lint (ruff check)
run: uv run ruff check .
- name: Format check (ruff format)
run: uv run ruff format --check .
- name: Check types with ty
run: uv run ty check --python-version ${{ matrix.python-version }} --output-format github
- name: Check declared workarounds
uses: libtmux/.github/actions/check-workarounds@22703e1b8ee1c176ca72d9ffc9520f2ca0ce3a85 # main
- name: Tests (pytest)
if: matrix.python-version != '3.14'
run: uv run pytest -m ""
- name: Tests + Branch Coverage (coverage run -m pytest)
if: matrix.python-version == '3.14'
run: |
uv run python -m coverage run --branch --source=libvt -m pytest -m ""
uv run python -m coverage combine
uv run python -m coverage report
test-macos:
runs-on: macos-latest
permissions:
contents: read
timeout-minutes: 10
steps:
- uses: actions/checkout@v7
- uses: astral-sh/setup-uv@v10.2.0
with:
version-file: .tool-versions
enable-cache: true
- uses: actions/setup-python@v7
with:
python-version: "3.14"
- name: Install dependencies
run: uv sync --all-groups
- name: Check types with ty
run: uv run ty check --python-version 3.14 --output-format github
- name: Tests (pytest + POSIX PTY)
run: uv run pytest -m ""
test-windows:
runs-on: windows-latest
permissions:
contents: read
timeout-minutes: 10
steps:
- uses: actions/checkout@v7
- uses: astral-sh/setup-uv@v10.2.0
with:
version-file: .tool-versions
enable-cache: true
- uses: actions/setup-python@v7
with:
python-version: "3.14"
- name: Install dependencies
run: uv sync --all-groups
- name: Check types with ty
run: uv run ty check --python-version 3.14 --output-format github
- name: Tests (portable core + stream)
run: uv run pytest -m ""
test-pypy:
runs-on: ubuntu-latest
permissions:
contents: read
timeout-minutes: 10
env:
UV_PYTHON: pypy@3.12
steps:
- uses: actions/checkout@v7
- uses: astral-sh/setup-uv@v10.2.0
with:
version-file: .tool-versions
enable-cache: true
- uses: actions/setup-python@v7
with:
python-version: "pypy-3.12"
- name: Install testing dependencies
run: uv sync --group testing
- name: Verify PyPy 3.12 interpreter
run: uv run python -c "import sys; assert sys.implementation.name == 'pypy' and sys.version_info[:2] == (3, 12), sys.version"
- name: Tests (PyPy 3.12 + OSError / array('Q') parity)
run: uv run pytest -m ""
- name: JIT throughput smoke (bench_vt.py)
run: uv run python scripts/bench_vt.py --warmup 25 --runs 10
test-ghostty:
runs-on: ubuntu-24.04-arm
permissions:
contents: read
timeout-minutes: 15
env:
ZIG_VERSION: "0.17.1"
ZIG_SHA256: "a1546d5646eb184437918d6635ca6b762a0e889eac09cef720ee7a1ed3fe7795"
GHOSTTY_VT_VERSION: "1.0.2"
GHOSTTY_VT_SHA256: "1dcafa8a3357f3a6bbf4f2696e61de611400c5469518716793dfffd35f008b3e"
GHOSTTY_VT_DEPS_SHA256: "c56156dbea82fdf71f13bf0d704cdf4393b6a04208d7f9691e0d7f60c7f9ca4d"
steps:
- uses: actions/checkout@v7
- uses: astral-sh/setup-uv@v10.2.0
with:
version-file: .tool-versions
enable-cache: true
- uses: actions/setup-python@v7
with:
python-version: "3.14"
- name: Install testing dependencies
run: uv sync --group testing
- name: Cache compiled libghostty-vt
id: cache-ghostty
uses: actions/cache@v6
with:
path: ~/.cache/libghostty-vt
key: libghostty-vt-${{ runner.os }}-${{ runner.arch }}-${{ env.GHOSTTY_VT_VERSION }}-${{ env.GHOSTTY_VT_SHA256 }}-${{ env.GHOSTTY_VT_DEPS_SHA256 }}-${{ env.ZIG_VERSION }}-${{ env.ZIG_SHA256 }}-baseline
- name: Build pinned libghostty-vt 1.0.2
if: steps.cache-ghostty.outputs.cache-hit != 'true'
shell: bash
run: |
set -euo pipefail
work="$(mktemp -d)"
trap 'rm -rf "$work"' EXIT
curl -fsSL "https://ziglang.org/download/${ZIG_VERSION}/zig-aarch64-linux-${ZIG_VERSION}.tar.xz" -o "$work/zig.tar.xz"
echo "${ZIG_SHA256} $work/zig.tar.xz" | sha256sum -c -
tar -xf "$work/zig.tar.xz" -C "$work"
zig_bin="$work/zig-aarch64-linux-${ZIG_VERSION}/zig"
"$zig_bin" version
curl -fsSL "https://release.files.ghostty.org/libghostty-vt/${GHOSTTY_VT_VERSION}/libghostty-vt-${GHOSTTY_VT_VERSION}.tar.gz" -o "$work/src.tar.gz"
curl -fsSL "https://release.files.ghostty.org/libghostty-vt/${GHOSTTY_VT_VERSION}/libghostty-vt-${GHOSTTY_VT_VERSION}-deps.tar.gz" -o "$work/deps.tar.gz"
echo "${GHOSTTY_VT_SHA256} $work/src.tar.gz" | sha256sum -c -
echo "${GHOSTTY_VT_DEPS_SHA256} $work/deps.tar.gz" | sha256sum -c -
mkdir -p "$work/src" "$work/deps" "$work/zig-cache" "$HOME/.cache/libghostty-vt"
tar -xzf "$work/src.tar.gz" --strip-components=1 -C "$work/src"
tar -xzf "$work/deps.tar.gz" --strip-components=1 -C "$work/deps"
(
cd "$work/src"
ZIG_GLOBAL_CACHE_DIR="$work/zig-cache" "$zig_bin" build -Demit-lib-vt -Doptimize=ReleaseFast -Dcpu=baseline --system "$work/deps" --prefix "$HOME/.cache/libghostty-vt"
)
- name: Run compiled libghostty-vt differential suite
shell: bash
run: |
set -euo pipefail
lib_path="$(readlink -e "$HOME/.cache/libghostty-vt/lib/libghostty-vt.so")"
echo "Zig pin: ${ZIG_VERSION} (${ZIG_SHA256})"
echo "libghostty-vt pin: ${GHOSTTY_VT_VERSION} (${GHOSTTY_VT_SHA256})"
echo "Resolved library: ${lib_path}"
LIBGHOSTTY_VT_PATH="$lib_path" uv run pytest -m ghostty -v tests/test_differential_ghostty.py
release:
runs-on: ubuntu-latest
needs: [test, test-macos, test-windows, test-pypy, test-ghostty]
if: github.event_name == 'push' && startsWith(github.ref, 'refs/tags')
timeout-minutes: 10
permissions:
contents: read
id-token: write
attestations: write
strategy:
matrix:
python-version: ["3.15"]
steps:
- uses: actions/checkout@v7
- uses: astral-sh/setup-uv@v10.2.0
with:
version-file: .tool-versions
enable-cache: true
- uses: actions/setup-python@v7
with:
python-version: ${{ matrix.python-version }}
- name: Install dependencies
run: uv sync --all-groups
- name: Build package
run: uv build
- name: Publish package
uses: pypa/gh-action-pypi-publish@release/v1
with:
attestations: true
skip-existing: true