Skip to content

Cleanup

Cleanup #19

name: Build and test wheels AMD64
on:
push:
branches: [master]
pull_request:
branches: [master]
jobs:
linux-build:
name: Build wheel for linux AMD64
runs-on: ubuntu-20.04
steps:
- name: Checkout
uses: actions/checkout@v4
- name: Prepare snap7 archive
uses: ./.github/actions/prepare_snap7
- name: Build wheel
uses: ./.github/actions/manylinux_2_28_x86_64
with:
script: ./.github/build_scripts/build_package.sh
platform: manylinux_2_28_x86_64
makefile: x86_64_linux.mk
python: /opt/python/cp38-cp38/bin/python
wheeldir: wheelhouse/${{ runner.os }}/
- name: Upload artifacts
uses: actions/upload-artifact@v4
with:
name: wheels-${{ runner.os }}
path: wheelhouse/${{ runner.os }}/*.whl
windows-build:
name: Build wheel for windows AMD64
runs-on: windows-2022
steps:
- name: Checkout
uses: actions/checkout@v4
- name: Prepare snap7 archive
uses: ./.github/actions/prepare_snap7
- name: Build wheel
run: |
mkdir -p snap7/lib/
Copy-Item .\snap7-full-1.4.2\release\Windows\Win64\snap7.dll .\snap7\lib
python3 -m build . --wheel -C="--build-option=--plat-name=win_amd64"
mkdir -p wheelhouse/${{ runner.os }}/
cp dist/*.whl wheelhouse/${{ runner.os }}/
- name: Upload artifacts
uses: actions/upload-artifact@v4
with:
name: wheels-${{ runner.os }}
path: wheelhouse/${{ runner.os }}/*.whl
osx-build:
name: Build wheel for osx AMD64
runs-on: macos-11
steps:
- name: Checkout
uses: actions/checkout@v4
- name: Prepare snap7 archive
uses: ./.github/actions/prepare_snap7
- name: Prepare files
run: |
cp .github/build_scripts/arm64_osx.mk snap7-full-1.4.2/build/osx/
pushd snap7-full-1.4.2/build/osx/
make -f x86_64_osx.mk all
make -f arm64_osx.mk all
lipo -create -output /usr/local/lib/libsnap7.dylib ../bin/x86_64-osx/libsnap7.dylib ../bin/arm64-osx/libsnap7.dylib
install_name_tool -id /usr/local/lib/libsnap7.dylib /usr/local/lib/libsnap7.dylib
popd
mkdir -p snap7/lib/
cp /usr/local/lib/libsnap7.dylib snap7/lib/
- name: Build wheel
run: |
python3 -m build . --wheel -C="--build-option=--plat-name=macosx_10_9_universal2"
mkdir -p wheelhouse/${{ runner.os }}/
cp dist/*.whl wheelhouse/${{ runner.os }}/
- name: Upload artifacts
uses: actions/upload-artifact@v4
with:
name: wheels-${{ runner.os }}
path: wheelhouse/${{ runner.os }}/*.whl
test-wheels-unix-86_64:
name: Testing wheels for AMD64 unix
needs: [linux-build, osx-build]
runs-on: ${{ matrix.os }}
strategy:
matrix:
os: [ubuntu-22.04, ubuntu-20.04, macos-14, macos-11]
python-version: ["3.9", "3.10", "3.11", "3.12"]
steps:
- name: Checkout
uses: actions/checkout@v4
- name: Set up Python ${{ matrix.python-version }}
uses: actions/setup-python@v5
with:
python-version: ${{ matrix.python-version }}
- name: Download artifacts
uses: actions/download-artifact@v4
with:
name: wheels-${{ runner.os }}
path: wheelhouse
- name: Install python-snap7
run: |
python3 -m venv venv
venv/bin/pip install --upgrade pip
venv/bin/pip install pytest
venv/bin/pip install $(ls wheelhouse/*.whl)
- name: Run tests
run: |
venv/bin/pytest -m "server or util or client or mainloop"
sudo venv/bin/pytest -m partner
test-wheels-windows-86_64:
name: Testing wheels for AMD64 windows
needs: [windows-build]
runs-on: ${{ matrix.os }}
strategy:
matrix:
os: [windows-2022, windows-2019]
python-version: ["3.9", "3.10", "3.11", "3.12"]
steps:
- name: Checkout
uses: actions/checkout@v4
- name: Set up Python ${{ matrix.python-version }}
uses: actions/setup-python@v5
with:
python-version: ${{ matrix.python-version }}
- name: Download artifacts
uses: actions/download-artifact@v4
with:
name: wheels-${{ runner.os }}
path: wheelhouse
- name: Install python-snap7
run: |
python3 -m pip install --upgrade pip pytest
python3 -m pip install $(ls wheelhouse/*.whl)
- name: Run pytest
run: |
pytest -m "server or util or client or mainloop or partner"