Modernize CI/CD: switch to uv, fix Python 3.11+ compatibility #118
Workflow file for this run
This file contains hidden or 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 and test wheels windows/amd64 | |
| on: | |
| push: | |
| branches: [master] | |
| pull_request: | |
| branches: [master] | |
| concurrency: | |
| group: ${{ github.workflow }}-${{ github.ref }} | |
| cancel-in-progress: true | |
| jobs: | |
| 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" | |
| - name: Upload artifacts | |
| uses: actions/upload-artifact@v4 | |
| with: | |
| name: dist-windows-amd64 | |
| path: dist/*.whl | |
| windows-test-amd64: | |
| name: Testing wheels for AMD64 windows | |
| needs: [windows-build] | |
| runs-on: ${{ matrix.os }} | |
| strategy: | |
| matrix: | |
| os: [windows-2022, windows-2025] | |
| python-version: ["3.10", "3.11", "3.12", "3.13", "3.14"] | |
| 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: Install uv | |
| uses: astral-sh/setup-uv@v5 | |
| with: | |
| enable-cache: true | |
| - name: Download artifacts | |
| uses: actions/download-artifact@v4 | |
| with: | |
| name: dist-windows-amd64 | |
| path: dist | |
| - name: List files | |
| run: | | |
| dir | |
| dir dist | |
| - name: Install python-snap7 | |
| run: | | |
| uv venv | |
| uv pip install pytest | |
| uv pip install $(ls dist/*.whl) | |
| # Use --no-project to prevent uv from syncing pyproject.toml, | |
| # which would rebuild from source and lose the bundled snap7 library. | |
| - name: Run pytest | |
| run: uv run --no-project pytest -m "server or util or client or mainloop or partner" |