More testings #228
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
name: Build | |
on: [push, pull_request] | |
jobs: | |
build_wheels: | |
name: Build wheel for cp${{ matrix.python }}-${{ matrix.platform_id }} | |
runs-on: ${{ matrix.os }} | |
strategy: | |
fail-fast: false | |
matrix: | |
include: | |
# Windows 32-bit | |
- os: windows-2019 | |
python: 37 | |
platform_id: win32 | |
- os: windows-2019 | |
python: 38 | |
platform_id: win32 | |
- os: windows-2019 | |
python: 39 | |
platform_id: win32 | |
- os: windows-2019 | |
python: 310 | |
platform_id: win32 | |
- os: windows-2019 | |
python: 311 | |
platform_id: win32 | |
- os: windows-2019 | |
python: 312 | |
platform_id: win32 | |
# Windows 64-bit | |
- os: windows-2019 | |
python: 37 | |
platform_id: win_amd64 | |
- os: windows-2019 | |
python: 38 | |
platform_id: win_amd64 | |
- os: windows-2019 | |
python: 39 | |
platform_id: win_amd64 | |
- os: windows-2019 | |
python: 310 | |
platform_id: win_amd64 | |
- os: windows-2019 | |
python: 311 | |
platform_id: win_amd64 | |
- os: windows-2019 | |
python: 312 | |
platform_id: win_amd64 | |
# Linux 32-bit | |
- os: ubuntu-latest | |
python: 37 | |
platform_id: manylinux_i686 | |
- os: ubuntu-latest | |
python: 38 | |
platform_id: manylinux_i686 | |
- os: ubuntu-latest | |
python: 39 | |
platform_id: manylinux_i686 | |
- os: ubuntu-latest | |
python: 310 | |
platform_id: manylinux_i686 | |
- os: ubuntu-latest | |
python: 311 | |
platform_id: manylinux_i686 | |
- os: ubuntu-latest | |
python: 312 | |
platform_id: manylinux_i686 | |
# Linux 64-bit | |
- os: ubuntu-latest | |
python: 37 | |
platform_id: manylinux_x86_64 | |
- os: ubuntu-latest | |
python: 38 | |
platform_id: manylinux_x86_64 | |
- os: ubuntu-latest | |
python: 39 | |
platform_id: manylinux_x86_64 | |
- os: ubuntu-latest | |
python: 310 | |
platform_id: manylinux_x86_64 | |
- os: ubuntu-latest | |
python: 311 | |
platform_id: manylinux_x86_64 | |
- os: ubuntu-latest | |
python: 312 | |
platform_id: manylinux_x86_64 | |
# Linux aarch64 | |
- os: ubuntu-latest | |
python: 37 | |
platform_id: manylinux_aarch64 | |
- os: ubuntu-latest | |
python: 38 | |
platform_id: manylinux_aarch64 | |
- os: ubuntu-latest | |
python: 39 | |
platform_id: manylinux_aarch64 | |
- os: ubuntu-latest | |
python: 310 | |
platform_id: manylinux_aarch64 | |
- os: ubuntu-latest | |
python: 311 | |
platform_id: manylinux_aarch64 | |
- os: ubuntu-latest | |
python: 312 | |
platform_id: manylinux_aarch64 | |
# macOS on Intel 64-bit | |
- os: macos-latest | |
python: 37 | |
arch: x86_64 | |
platform_id: macosx_x86_64 | |
- os: macos-latest | |
python: 38 | |
arch: x86_64 | |
platform_id: macosx_x86_64 | |
- os: macos-latest | |
python: 39 | |
arch: x86_64 | |
platform_id: macosx_x86_64 | |
- os: macos-latest | |
python: 310 | |
arch: x86_64 | |
platform_id: macosx_x86_64 | |
- os: macos-latest | |
python: 311 | |
arch: x86_64 | |
platform_id: macosx_x86_64 | |
- os: macos-latest | |
python: 312 | |
arch: x86_64 | |
platform_id: macosx_x86_64 | |
# macOS on Apple M1 64-bit | |
- os: macos-latest | |
python: 38 | |
arch: arm64 | |
platform_id: macosx_arm64 | |
- os: macos-latest | |
python: 39 | |
arch: arm64 | |
platform_id: macosx_arm64 | |
- os: macos-latest | |
python: 310 | |
arch: arm64 | |
platform_id: macosx_arm64 | |
- os: macos-latest | |
python: 311 | |
arch: arm64 | |
platform_id: macosx_arm64 | |
- os: macos-latest | |
python: 312 | |
arch: arm64 | |
platform_id: macosx_arm64 | |
steps: | |
- uses: actions/checkout@v4 | |
with: | |
submodules: true | |
- name: Set up QEMU | |
if: runner.os == 'Linux' | |
uses: docker/setup-qemu-action@v2 | |
with: | |
platforms: all | |
- uses: actions/setup-python@v5 | |
name: Install Python host for cibuildwheel | |
with: | |
python-version: '3.9' | |
# Visual Studio | |
- name: Set up MSVC x86 | |
if: matrix.platform_id == 'win32' | |
uses: ilammy/msvc-dev-cmd@v1 | |
with: | |
arch: x86 | |
# Visual Studio | |
- name: Set up MSVC x64 | |
if: matrix.platform_id == 'win_amd64' | |
uses: ilammy/msvc-dev-cmd@v1 | |
- name: Installing Nasm win_amd64 | |
if: matrix.platform_id == 'win_amd64' | |
run: | | |
choco install --no-progress -y nasm | |
- name: Installing Nasm win32 | |
if: matrix.platform_id == 'win32' | |
run: | | |
choco install --no-progress -y --x86 nasm | |
- name: Set Path win32 | |
if: matrix.platform_id == 'win32' | |
shell: bash | |
run: | | |
echo "C:\Program Files (x86)\NASM" >> $GITHUB_PATH | |
- name: Set Path win_amd64 | |
if: matrix.platform_id == 'win_amd64' | |
shell: bash | |
run: | | |
echo "C:\Program Files\NASM" >> $GITHUB_PATH | |
- name: Compile Openssl win_amd64 | |
if: matrix.platform_id == 'win_amd64' | |
run: | | |
pushd c:/ | |
git clone https://github.com/openssl/openssl.git | |
pushd openssl | |
git checkout openssl-3.3.0 | |
perl Configure no-shared no-tests VC-WIN64A | |
nmake | |
mkdir lib\VC | |
copy libcrypto.lib lib\VC\libeay32.lib | |
copy libssl.lib lib\VC\ssleay32.lib | |
popd | |
popd | |
- name: Compile Openssl win32 | |
if: matrix.platform_id == 'win32' | |
run: | | |
pushd c:\ | |
git clone https://github.com/openssl/openssl.git | |
pushd openssl | |
git checkout openssl-3.3.0 | |
perl Configure no-shared no-tests VC-WIN32 | |
nmake | |
mkdir lib\VC | |
copy libcrypto.lib lib\VC\libeay32.lib | |
copy libssl.lib lib\VC\ssleay32.lib | |
popd | |
popd | |
- name: Compile Openssl Mac | |
if: matrix.os == 'macos-latest' | |
run: | | |
pushd /tmp | |
git clone https://github.com/openssl/openssl.git | |
pushd openssl | |
git checkout openssl-3.3.0 | |
./Configure --prefix=/usr/local/openssl no-tests darwin64-${{ matrix.arch }}-cc | |
make | |
sudo make install | |
popd | |
popd | |
- name: Install cibuildwheel | |
run: python -m pip install cibuildwheel==2.17.0 | |
- name: Build wheels | |
# to supply options, put them in 'env', like: | |
env: | |
CIBW_MANYLINUX_X86_64_IMAGE: manylinux2014 | |
CIBW_MANYLINUX_I686_IMAGE: manylinux2014 | |
CIBW_MANYLINUX_AARCH64_IMAGE: manylinux2014 | |
CIBW_BUILD: cp${{ matrix.python }}-${{ matrix.platform_id }} | |
CIBW_ARCHS_LINUX: auto aarch64 | |
# Include latest Python beta | |
CIBW_PRERELEASE_PYTHONS: True | |
CIBW_BUILD_FRONTEND: build | |
CIBW_BEFORE_ALL_LINUX: | | |
yum install -y gcc-c++ pcre-devel openssl-devel | |
/opt/python/cp38-cp38/bin/python -m pip install ninja | |
ln -s /opt/python/cp38-cp38/bin/ninja /usr/bin/ninja | |
if [[ ! -e $(command -v swig) ]]; then | |
curl -L https://sourceforge.net/projects/swig/files/swig/swig-4.2.1/swig-4.2.1.tar.gz/download --output /tmp/swig.tar.gz | |
mkdir /tmp/swig | |
tar -xvzf /tmp/swig.tar.gz -C /tmp/swig --strip-components 1 &> /dev/null | |
pushd /tmp/swig | |
./configure --without-alllang --with-python3 | |
make -j2 && make install > /dev/null | |
popd | |
fi | |
CIBW_ENVIRONMENT_LINUX: CMAKE_ARGS="-DGDCM_USE_SYSTEM_OPENSSL:BOOL=ON" | |
CIBW_BEFORE_ALL_WINDOWS: | | |
choco upgrade chocolatey -y | |
choco install swig -f -y --no-progress | |
CIBW_ENVIRONMENT_WINDOWS: > | |
CMAKE_ARGS="-DGDCM_USE_SYSTEM_OPENSSL:BOOL=ON -DOPENSSL_ROOT_DIR=c:/openssl" | |
CIBW_ARCHS_MACOS: ${{ matrix.arch }} | |
CIBW_BEFORE_ALL_MACOS: | | |
brew install swig | |
CIBW_ENVIRONMENT_MACOS: > | |
CMAKE_OSX_ARCHITECTURES=${{ matrix.arch }} | |
CMAKE_ARGS="-DGDCM_USE_SYSTEM_OPENSSL:BOOL=ON -DOPENSSL_ROOT_DIR=/usr/local/openssl -DOPENSSL_CRYPTO_LIBRARIES=/usr/local/openssl/lib/libcrypto.dylib -DOPENSSL_SSL_LIBRARIES=/usr/local/openssl/lib/libssl.dylib" | |
CIBW_TEST_COMMAND: python -c "import gdcm" | |
run: python -m cibuildwheel --output-dir wheelhouse | |
- uses: actions/upload-artifact@v4 | |
with: | |
path: ./wheelhouse/*.whl | |
name: artifact-${{ matrix.os }}-${{ matrix.platform_id }}-python-${{ matrix.python }} | |
build_sdist: | |
runs-on: ubuntu-latest | |
steps: | |
- uses: actions/checkout@v4 | |
with: | |
submodules: true | |
- uses: actions/setup-python@v5 | |
name: Install Python host for sdist | |
with: | |
python-version: '3.9' | |
- name: Create sdist | |
run: | | |
python -m pip install build | |
python -m build --sdist | |
- uses: actions/upload-artifact@v4 | |
with: | |
path: ./dist/*.tar.gz | |
name: artifact-${{ matrix.os }}-${{ matrix.platform_id }}-python-${{ matrix.python }} | |
merge: | |
runs-on: ubuntu-latest | |
needs: | |
- build_wheels | |
- build_sdist | |
steps: | |
- name: Merge Artifacts | |
uses: actions/upload-artifact/merge@v4 | |
with: | |
name: artifacts | |
pattern: artifact-* |