Update test_basic.py #203
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 Wheels | |
| on: | |
| push: | |
| tags: | |
| - 'v*' | |
| jobs: | |
| build_wheels: | |
| name: Build wheels on ${{ matrix.os }} | |
| runs-on: ${{ matrix.os }} | |
| strategy: | |
| matrix: | |
| # os: [windows-latest, ubuntu-latest] | |
| # suppress MacOS for now due to lack of proper C++20 support | |
| os: [windows-latest, ubuntu-latest, macOS-latest] | |
| steps: | |
| - uses: actions/checkout@v4 | |
| with: | |
| token: ${{ secrets.PAT_TOKEN }} | |
| submodules: 'recursive' | |
| - name: Force update submodules | |
| run: | | |
| git submodule sync --recursive | |
| git submodule update --init --recursive --force | |
| - name: Build wheels | |
| uses: pypa/cibuildwheel@v2.20.0 | |
| env: | |
| CIBW_BUILD: 'cp39-* cp310-* cp311-* cp312-* cp313-* cp314-*' | |
| CIBW_PRERELEASE_PYTHONS: 1 | |
| CIBW_SKIP: '*win32 *i686' # Don't build for 32-bit | |
| CIBW_ARCHS_MACOS: x86_64 arm64 | |
| CIBW_ENVIRONMENT: MACOSX_DEPLOYMENT_TARGET=11.0 | |
| - name: Upload wheels | |
| uses: actions/upload-artifact@v4 | |
| with: | |
| name: wheels-${{ matrix.os }} | |
| path: ./wheelhouse/*.whl | |
| overwrite: true | |
| test_wheels: | |
| name: Test wheels on Python ${{ matrix.python-version }} on ${{ matrix.os }} | |
| needs: build_wheels | |
| runs-on: ${{ matrix.os }} | |
| strategy: | |
| matrix: | |
| os: [windows-latest, ubuntu-latest, macOS-latest] | |
| python-version: ['3.13'] | |
| steps: | |
| - uses: actions/checkout@v4 | |
| - name: Set up Python ${{ matrix.python-version }} | |
| uses: actions/setup-python@v2 | |
| with: | |
| python-version: ${{ matrix.python-version }} | |
| - name: Download wheels | |
| uses: actions/download-artifact@v4 | |
| with: | |
| # Download only the wheels artifact for the current OS | |
| name: wheels-${{ matrix.os }} | |
| path: wheelhouse | |
| - name: Install and test the built wheel | |
| run: | | |
| pip install --find-links wheelhouse geodesk2 | |
| pip install pytest | |
| cd test | |
| pytest test_basic.py | |
| upload_wheels: | |
| name: Upload Wheels to PyPI | |
| needs: test_wheels | |
| runs-on: ubuntu-latest | |
| steps: | |
| - uses: actions/checkout@v4 | |
| - name: Download built wheels | |
| uses: actions/download-artifact@v4 | |
| with: | |
| # Omitting the name parameter downloads all artifacts from previous jobs | |
| path: wheelhouse | |
| - name: List downloaded wheels | |
| run: ls -l wheelhouse | |
| - name: Flatten wheels directory | |
| run: | | |
| # Move all .whl files from subdirectories to the wheelhouse folder | |
| find wheelhouse -type f -name "*.whl" -exec mv {} wheelhouse/ \; | |
| # Optionally, list the flattened directory for verification | |
| ls -l wheelhouse | |
| - name: Set up Python for twine | |
| uses: actions/setup-python@v2 | |
| with: | |
| python-version: '3.11' | |
| - name: Publish to PyPI | |
| run: | | |
| python -m pip install twine | |
| twine upload --skip-existing --non-interactive -u __token__ -p ${{ secrets.PYPI_TOKEN_GLOBAL }} wheelhouse/*.whl |