@@ -27,31 +27,78 @@ jobs:
2727 cache : true
2828
2929 # Cache vendor dependencies to speed up builds
30+ # Note: For Linux, vendors are built inside manylinux container, so we cache the vendor directory
3031 - name : Restore vendor cache
3132 id : cache-vendor
3233 uses : actions/cache/restore@v4
3334 with :
3435 path : vendor
35- key : vendor-linux-${{ hashFiles('scripts/linux/setup_vendors.sh') }}-v9
36+ key : vendor-linux-manylinux- ${{ hashFiles('scripts/linux/setup_vendors.sh') }}-v9
3637 restore-keys : |
37- vendor-linux-
38+ vendor-linux-manylinux-
3839
3940 # Build wheels with cibuildwheel (handles manylinux containers)
40- # Vendor dependencies are built inside the manylinux container
41+ # The vendor directory is mounted into the container automatically
4142 - name : Build wheels
4243 uses : pypa/cibuildwheel@v2.22.0
4344 env :
4445 # Build for specified Python versions
4546 CIBW_BUILD : cp39-manylinux_x86_64 cp310-manylinux_x86_64 cp311-manylinux_x86_64 cp312-manylinux_x86_64
46- # Vendor build happens inside manylinux container via before-build
47+ # Vendor build happens inside manylinux container via before-build (from pyproject.toml)
4748
4849 # Save vendor cache after build
4950 - name : Save vendor cache
5051 if : steps.cache-vendor.outputs.cache-hit != 'true'
5152 uses : actions/cache/save@v4
5253 with :
5354 path : vendor
54- key : vendor-linux-${{ hashFiles('scripts/linux/setup_vendors.sh') }}-v9
55+ key : vendor-linux-manylinux-${{ hashFiles('scripts/linux/setup_vendors.sh') }}-v9
56+
57+ # Test the built wheels
58+ - name : Test wheels
59+ run : |
60+ # Test each wheel that was built
61+ for wheel in ./wheelhouse/*.whl; do
62+ echo "========================================"
63+ echo "Testing wheel: $(basename "$wheel")"
64+ echo "========================================"
65+
66+ # Extract Python version from wheel filename (e.g., cp39, cp310)
67+ python_tag=$(basename "$wheel" | grep -oP 'cp\d+' | head -1)
68+ python_version="${python_tag:2:1}.${python_tag:3}"
69+
70+ echo "Setting up Python $python_version..."
71+
72+ # Use the appropriate Python version
73+ python_cmd="python${python_version}"
74+ if ! command -v "$python_cmd" &> /dev/null; then
75+ python_cmd="python3"
76+ fi
77+
78+ # Install the wheel in a fresh environment
79+ "$python_cmd" -m pip install --force-reinstall "$wheel"
80+
81+ # Run the test script
82+ echo ""
83+ echo "Running tests..."
84+ "$python_cmd" scripts/test_local_build.py
85+
86+ # Check exit code
87+ if [ $? -eq 0 ]; then
88+ echo ""
89+ echo "[OK] Wheel test PASSED: $(basename "$wheel")"
90+ else
91+ echo ""
92+ echo "[FAIL] Wheel test FAILED: $(basename "$wheel")"
93+ exit 1
94+ fi
95+
96+ echo ""
97+ done
98+
99+ echo "========================================"
100+ echo "All wheel tests PASSED"
101+ echo "========================================"
55102
56103 # Upload wheels as artifacts
57104 - uses : actions/upload-artifact@v4
0 commit comments