Skip to content

Commit 1476501

Browse files
alexmalyshevmeta-codesync[bot]
authored andcommitted
CinderX OSS CI Improvements
Summary: Merge buildwheels.yml into ci.yml. All CI jobs will now run on pull requests and on pushed commits. CI amounts to: * Run tests w/ pytest * Ensure binary wheels can be built * Ensure a source distribution can be built Some of cibuildwheel's configuration is now moved to pyproject.toml to dedupe things across tests and the weekly release flow. The Python version is now specified as a matrix variable. This will make it easier to test with multiple versions in the future. Deleted the explicit *X86_64_IMAGE environment variables. They're not doing anything, the values they're set to are already the defaults. Updated the versions of common actions. Reviewed By: yoney Differential Revision: D93918631 fbshipit-source-id: a34b3cb9a8e6c0b8366dac5577ef5daacd262355
1 parent cd5f7cc commit 1476501

4 files changed

Lines changed: 82 additions & 61 deletions

File tree

.github/workflows/buildwheels.yml

Lines changed: 0 additions & 33 deletions
This file was deleted.

.github/workflows/ci.yml

Lines changed: 57 additions & 13 deletions
Original file line numberDiff line numberDiff line change
@@ -1,40 +1,84 @@
1-
name: CinderX
1+
name: CI
22

3-
on: [push]
3+
on: [push, pull_request]
44

55
jobs:
6-
test:
7-
runs-on: ubuntu-latest
6+
run_tests:
7+
name: Run Tests
8+
runs-on: ${{ matrix.os }}
9+
strategy:
10+
matrix:
11+
os: [ubuntu-latest]
12+
python-version: ['3.14.3']
813

914
steps:
1015
- name: Checkout CinderX
11-
uses: actions/checkout@v5
16+
uses: actions/checkout@v6
1217

1318
- name: Set up Python
1419
uses: actions/setup-python@v6
1520
with:
16-
python-version: 3.14.3
21+
python-version: ${{ matrix.python-version }}
1722

1823
- name: Set up uv
1924
uses: astral-sh/setup-uv@v7
2025

2126
- name: Create venv
22-
run: uv venv --python 3.14.3
27+
run: uv venv --python ${{ matrix.python-version }}
2328

2429
- name: Build CinderX
25-
run: uv build --wheel --python 3.14.3
30+
run: uv build --wheel --python ${{ matrix.python-version }}
2631

2732
- name: Install CinderX
2833
run: uv pip install dist/*.whl
2934

30-
- name: Check CinderX Imports
35+
- name: Check CinderX loads successfully
3136
run: |
3237
uv run python -c 'import cinderx ; print(cinderx.get_import_error()) ; assert cinderx.is_initialized()'
3338
3439
- name: Install Pytest
35-
run: |
36-
uv pip install pytest
40+
run: uv pip install pytest
3741

3842
- name: Run Tests
39-
run: |
40-
uv run pytest cinderx/PythonLib/test_cinderx/test*.py
43+
run: uv run pytest cinderx/PythonLib/test_cinderx/test*.py
44+
45+
build_wheels:
46+
name: Build wheels on ${{ matrix.os }}
47+
runs-on: ${{ matrix.os }}
48+
strategy:
49+
matrix:
50+
os: [ubuntu-latest]
51+
52+
steps:
53+
- uses: actions/checkout@v6
54+
55+
# cibuildwheel uses a docker container so the Python version is irrelevant
56+
# here.
57+
- uses: actions/setup-python@v6
58+
59+
- name: Install cibuildwheel
60+
run: python -m pip install cibuildwheel
61+
62+
- name: Build wheels
63+
run: python -m cibuildwheel --output-dir wheelhouse
64+
65+
build_sdist:
66+
name: Build source distribution
67+
runs-on: ${{ matrix.os }}
68+
strategy:
69+
matrix:
70+
os: [ubuntu-latest]
71+
python-version: ['3.14.3']
72+
73+
steps:
74+
- uses: actions/checkout@v6
75+
76+
- uses: actions/setup-python@v6
77+
with:
78+
python-version: ${{ matrix.python-version }}
79+
80+
- name: Install build tools
81+
run: python -m pip install build
82+
83+
- name: Build sdist
84+
run: python -m build --sdist

.github/workflows/publish.yml

Lines changed: 15 additions & 15 deletions
Original file line numberDiff line numberDiff line change
@@ -23,39 +23,39 @@ jobs:
2323
os: [ubuntu-latest]
2424

2525
steps:
26-
- uses: actions/checkout@v5
26+
- uses: actions/checkout@v6
2727

28-
- uses: actions/setup-python@v5
29-
with:
30-
python-version: '3.14.3'
28+
# cibuildwheel uses a docker container so the Python version is irrelevant
29+
# here.
30+
- uses: actions/setup-python@v6
3131

3232
- name: Install cibuildwheel
3333
run: python -m pip install cibuildwheel
3434

3535
- name: Build wheels
3636
run: python -m cibuildwheel --output-dir wheelhouse
3737
env:
38-
CIBW_BUILD: cp314-manylinux_x86_64 cp314-musllinux_x86_64
39-
CIBW_MANYLINUX_X86_64_IMAGE: manylinux_2_28
40-
CIBW_MUSLLINUX_X86_64_IMAGE: musllinux_1_2
41-
CIBW_ENVIRONMENT: CINDERX_ENABLE_PGO=1 CINDERX_ENABLE_LTO=1 CINDERX_VERSION_PATCH=${{ inputs.patch_version || '0' }}
42-
CIBW_BUILD_VERBOSITY: 3
38+
CINDERX_VERSION_PATCH: ${{ inputs.patch_version || '0' }}
4339

44-
- uses: actions/upload-artifact@v4
40+
- uses: actions/upload-artifact@v6
4541
with:
4642
name: cibw-wheels-${{ matrix.os }}-${{ strategy.job-index }}
4743
path: ./wheelhouse/*.whl
4844

4945
build_sdist:
5046
name: Build source distribution
5147
runs-on: ubuntu-latest
48+
strategy:
49+
matrix:
50+
os: [ubuntu-latest]
51+
python-version: ['3.14.3']
5252

5353
steps:
54-
- uses: actions/checkout@v5
54+
- uses: actions/checkout@v6
5555

56-
- uses: actions/setup-python@v5
56+
- uses: actions/setup-python@v6
5757
with:
58-
python-version: '3.14.3'
58+
python-version: ${{ matrix.python-version }}
5959

6060
- name: Install build tools
6161
run: python -m pip install build
@@ -65,7 +65,7 @@ jobs:
6565
env:
6666
CINDERX_VERSION_PATCH: ${{ inputs.patch_version || '0' }}
6767

68-
- uses: actions/upload-artifact@v4
68+
- uses: actions/upload-artifact@v6
6969
with:
7070
name: cibw-sdist
7171
path: dist/*.tar.gz
@@ -80,7 +80,7 @@ jobs:
8080

8181
steps:
8282
- name: Download all artifacts
83-
uses: actions/download-artifact@v4
83+
uses: actions/download-artifact@v7
8484
with:
8585
pattern: cibw-*
8686
path: dist

pyproject.toml

Lines changed: 10 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -22,3 +22,13 @@ classifiers = [
2222

2323
[project.urls]
2424
Repository = "https://www.github.com/facebookincubator/cinderx"
25+
26+
[tool.cibuildwheel]
27+
build = ["cp314-manylinux_x86_64", "cp314-musllinux_x86_64"]
28+
environment = { CINDERX_ENABLE_PGO = "1", CINDERX_ENABLE_LTO = "1" }
29+
build-verbosity = 3
30+
31+
[tool.cibuildwheel.linux]
32+
# If it exists, pass through CINDERX_VERSION_PATCH to setuptools to specify the
33+
# patch version.
34+
environment-pass = ["CINDERX_VERSION_PATCH"]

0 commit comments

Comments
 (0)