-
Notifications
You must be signed in to change notification settings - Fork 94
71 lines (70 loc) · 3 KB
/
Copy pathtest.yml
File metadata and controls
71 lines (70 loc) · 3 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
name: pytest
on:
push:
branches:
- main
pull_request:
branches:
- '*'
# Nightly cron and a manual trigger so the full corpus (slow lane
# included) runs at least once a day. PR runs stay on the fast lane
# via `-m "not slow"`; this job has no such filter and exercises
# every fixture in the golden corpus, including the heavier
# compression cells. See issue #1930 for the fast / slow split.
#
# GitHub Actions only fires `schedule` triggers on the workflow file
# in the default branch. The cron will not run from a feature branch
# or PR head -- use `workflow_dispatch` below for an on-demand run.
schedule:
# 03:00 UTC daily. Off-peak to avoid contention with weekday PRs.
- cron: '0 3 * * *'
workflow_dispatch:
jobs:
run:
runs-on: ${{ matrix.os }}
# The free-threaded build (3.14t) is allowed to fail while numba and the
# rest of the stack finish their no-GIL support, so a broken install or a
# thread-safety failure reports signal without turning the PR check red or
# blocking a merge. Promote it to a required job once it stays green.
continue-on-error: ${{ endsWith(matrix.python, 't') }}
# Cap the free-threaded job so a no-GIL deadlock can't sit on a runner for
# the 360-minute default; other versions keep that default.
timeout-minutes: ${{ endsWith(matrix.python, 't') && 30 || 360 }}
strategy:
matrix:
os: ['ubuntu-latest', 'macos-latest', 'windows-latest']
python: ${{ github.event_name == 'pull_request' && fromJson('["3.14", "3.14t"]') || fromJson('["3.12", "3.13", "3.14", "3.14t"]') }}
env:
OS: ${{ matrix.os }}
PYTHON: ${{ matrix.python }}
steps:
- uses: actions/checkout@v4
- name: Setup Python
uses: actions/setup-python@v5
with:
python-version: ${{ matrix.python }}
- name: Install dependencies
run: |
python -m pip install --upgrade pip
pip install -e .[tests]
- name: Run pytest (fast lane)
# PR triggers run the fast lane: `-m "not slow"` deselects the
# heavier corpus cells tagged via `_marks.fast_slow_marks_for`
# (today: the six compression fixtures). push-to-main and the
# nightly schedule run the full set with no filter.
if: github.event_name == 'pull_request'
# Force the GIL off only for the free-threaded (3.14t) test run so the
# suite exercises the real no-GIL path instead of letting CPython
# silently re-enable the GIL for a C extension that hasn't declared
# free-threaded support. Scoped to the pytest step (not the job) so it
# never reaches setup-python's bootstrap interpreter, where
# PYTHON_GIL=0 is a fatal error on a GIL build. Empty (ignored) on the
# GIL versions.
env:
PYTHON_GIL: ${{ endsWith(matrix.python, 't') && '0' || '' }}
run: pytest -m "not slow"
- name: Run pytest (full)
if: github.event_name != 'pull_request'
env:
PYTHON_GIL: ${{ endsWith(matrix.python, 't') && '0' || '' }}
run: pytest