diff --git a/.github/workflows/test.yml b/.github/workflows/test.yml index b05bc3959..b4d609a31 100644 --- a/.github/workflows/test.yml +++ b/.github/workflows/test.yml @@ -142,6 +142,12 @@ jobs: entrypoint: /bin/bash args: -c "PATH=/github/workspace/.cargo/bin:$PATH tests/manylinux_compliant.sh ${{ matrix.manylinux }}" + - name: Incompliant Build + if: matrix.manylinux == '2010' + uses: docker://quay.io/pypa/manylinux2010_x86_64 + with: + entrypoint: /bin/bash + args: -c "PATH=/github/workspace/.cargo/bin:$PATH tests/manylinux_incompliant.sh ${{ matrix.manylinux }}" - name: Incompliant Build if: matrix.manylinux == '2014' uses: docker://quay.io/pypa/manylinux2014_x86_64 diff --git a/tests/manylinux_incompliant.sh b/tests/manylinux_incompliant.sh index 9f0491418..18bcc455e 100755 --- a/tests/manylinux_incompliant.sh +++ b/tests/manylinux_incompliant.sh @@ -1,22 +1,26 @@ #!/bin/bash # Fail because we're running in manylinux2014, which can't build for manylinux 2010 -for PYBIN in /opt/python/cp3[6]*/bin; do - if cargo run -- build --no-sdist -m test-crates/pyo3-mixed/Cargo.toml -i "${PYBIN}/python" --manylinux 2010 -o dist; then - echo "maturin build unexpectedly succeeded" - exit 1 - else - echo "maturin build failed as expected" - fi -done +if [[ "$1" == "2014" ]]; then + for PYBIN in /opt/python/cp3[6]*/bin; do + if cargo run -- build --no-sdist -m test-crates/pyo3-mixed/Cargo.toml -i "${PYBIN}/python" --manylinux 2010 -o dist; then + echo "maturin build unexpectedly succeeded" + exit 1 + else + echo "maturin build failed as expected" + fi + done +fi # Fail because we're linking zlib, which is not allowed in manylinux -yum install -y zlib-devel -for PYBIN in /opt/python/cp3[6]*/bin; do - if cargo run -- build --no-sdist -m test-crates/lib_with_disallowed_lib/Cargo.toml -i "${PYBIN}/python" --manylinux 2014 -o dist; then - echo "maturin build unexpectedly succeeded" - exit 1 - else - echo "maturin build failed as expected" - fi -done +if [[ "$1" == "2010" ]]; then + yum install -y zlib-devel + for PYBIN in /opt/python/cp3[6]*/bin; do + if cargo run -- build --no-sdist -m test-crates/lib_with_disallowed_lib/Cargo.toml -i "${PYBIN}/python" --manylinux 2010 -o dist; then + echo "maturin build unexpectedly succeeded" + exit 1 + else + echo "maturin build failed as expected" + fi + done +fi