-
Notifications
You must be signed in to change notification settings - Fork 33
140 lines (117 loc) · 5.19 KB
/
Copy pathci.yml
File metadata and controls
140 lines (117 loc) · 5.19 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
name: CI
on: [push, pull_request]
jobs:
run_tests:
name: Run Tests
runs-on: ${{ matrix.os }}
strategy:
# Don't let test failures on one platform block other platforms.
fail-fast: false
matrix:
os: [ubuntu-latest, ubuntu-24.04-arm, macos-latest, windows-latest]
# Test against multiple patch versions as CinderX references internal
# CPython functions and structures which can lead to ABI problems. See
# cinderx/UpstreamBorrow for more details.
python-version: ['3.14.3', '3.14.4', '3.14.5', '3.14.6']
include:
- os: ubuntu-latest
python-version: '3.14t'
- os: ubuntu-latest
python-version: '3.15.0-beta.3'
steps:
- name: Checkout CinderX
uses: actions/checkout@v6
- name: Set up Python
uses: actions/setup-python@v6
with:
python-version: ${{ matrix.python-version }}
allow-prereleases: true
- name: Set up uv
uses: astral-sh/setup-uv@v7
# Ubuntu's default GCC 13.3 hits an internal compiler error on
# SwapLockGuard's std::atomic_ref::compare_exchange_weak in
# cinderx/Jit/code_patcher.cpp, which is only compiled under
# Py_GIL_DISABLED. GCC 14 (which is also what manylinux_2_28
# ships via gcc-toolset-14) compiles it cleanly.
- name: Install GCC 14
if: runner.os == 'Linux'
run: |
sudo apt-get update
sudo apt-get install -y gcc-14 g++-14
echo "CC=gcc-14" >> "$GITHUB_ENV"
echo "CXX=g++-14" >> "$GITHUB_ENV"
- name: Create venv
run: uv venv --python ${{ matrix.python-version }}
- name: Build CinderX
# RuntimeTests do not support Windows or free-threaded builds yet.
env:
CINDERX_BUILD_RUNTIME_TESTS: ${{ runner.os != 'Windows' && matrix.python-version != '3.14t' && '1' || '' }}
CINDERX_RUNTIME_TESTS_OUTPUT_DIR: ${{ github.workspace }}/build/runtime-tests
run: uv build --wheel --python ${{ matrix.python-version }}
- name: Install CinderX
run: uv pip install cinderx --find-links dist --no-index
- name: Check CinderX loads successfully
run: |
uv run python -c 'import cinderx ; print(cinderx.get_import_error()) ; assert cinderx.is_initialized()'
- name: Install pytest
run: uv pip install pytest
- name: Run Tests
# Free-threaded builds aren't stable yet, so don't run the test suite
# against them.
if: matrix.python-version != '3.14t'
run: uv run pytest cinderx/PythonLib/test_cinderx/
- name: Run native tests
if: runner.os != 'Windows' && matrix.python-version != '3.14t'
# Skip known OSS-only failures. Keep these narrow so RuntimeTests still
# provide useful signal.
# TODO(T275133043): burn these down as the underlying issues are fixed.
# Particularly the segfaults.
run: |
set -euo pipefail
common='AllPassesTest.*:AllPassesStaticTest.*:CmdLineTest.ExplicitJITDisable:UtilTest.SymbolizerResolvesDynamicSymbol'
arm64='LIRGeneratorTest.ParserTest:BackendTest.MoveSequenceOpt2Test:CodePatcherTest.DeoptPatch:BranchRelaxationTest.*'
macos='BackendTest.CastTest:BackendTest.InlineJITRTCastTest:SimplifyTest.BinaryOpWithObjSpecLeftAndRightFloatExactTurnsIntoLoadConst:NativeCallsTest.NativeInvokeBasic:SimplifyStaticTest.UnboxOfRandMaxIsEliminated:DeadCodeEliminationAndSimplifyTest.UnboxOfStaticGlobalIsOptimized:HIRBuilderStaticTest.CIntTypeEmitsConvertPrimitive:CodePatcherTest.DeoptPatch'
filter="-${common}"
if [[ "$RUNNER_ARCH" == "ARM64" ]]; then
filter="${filter}:${arm64}"
fi
if [[ "$RUNNER_OS" == "macOS" ]]; then
filter="${filter}:${macos}"
fi
package_parent="$(uv run python -c 'import pathlib, cinderx; print(pathlib.Path(cinderx.__file__).resolve().parent.parent)')"
export PYTHONPATH="$package_parent"
export GTEST_FILTER="$filter"
(cd cinderx && ../build/runtime-tests/RuntimeTests)
build_wheels:
name: Build wheels on ${{ matrix.os }}
runs-on: ${{ matrix.os }}
strategy:
# Don't let build failures on one platform block other platforms.
fail-fast: false
matrix:
os: [ubuntu-latest, ubuntu-24.04-arm, macos-latest, windows-latest]
steps:
- name: Checkout CinderX
uses: actions/checkout@v6
# cibuildwheel uses Python from a docker container. The Python version is
# controlled by selecting the docker image version in pyproject.toml.
- name: Set up Python
uses: actions/setup-python@v6
- name: Install cibuildwheel
run: python -m pip install cibuildwheel
- name: Build wheels
run: python -m cibuildwheel --output-dir wheelhouse
build_sdist:
name: Build source distribution
runs-on: ubuntu-latest
steps:
- name: Checkout CinderX
uses: actions/checkout@v6
# An sdist is just source code and doesn't contain compiled artifacts, it
# doesn't need to be built per patch version.
- name: Set up Python
uses: actions/setup-python@v6
- name: Install build tools
run: python -m pip install build
- name: Build sdist
run: python -m build --sdist