|  | 
|  | 1 | +name: CI | 
|  | 2 | + | 
|  | 3 | +on: | 
|  | 4 | +  push: | 
|  | 5 | +    branches: | 
|  | 6 | +    - main | 
|  | 7 | +    - v*-branch | 
|  | 8 | +  pull_request: | 
|  | 9 | +    branches: | 
|  | 10 | +    - main | 
|  | 11 | +    - v*-branch | 
|  | 12 | +  workflow_call: | 
|  | 13 | + | 
|  | 14 | +concurrency: | 
|  | 15 | +  group: ${{ github.ref }} | 
|  | 16 | +  cancel-in-progress: true | 
|  | 17 | + | 
|  | 18 | +jobs: | 
|  | 19 | +  build: | 
|  | 20 | +    name: Build (Python ${{ matrix.target.python }}, ${{ matrix.arch }}) | 
|  | 21 | +    runs-on: ${{ matrix.target.builder }} | 
|  | 22 | + | 
|  | 23 | +    defaults: | 
|  | 24 | +      run: | 
|  | 25 | +        shell: bash | 
|  | 26 | + | 
|  | 27 | +    strategy: | 
|  | 28 | +      fail-fast: false | 
|  | 29 | +      matrix: | 
|  | 30 | +        target: | 
|  | 31 | +        # Python 3.6 | 
|  | 32 | +        - python: '3.6' | 
|  | 33 | +          builder: windows-2019 | 
|  | 34 | +          toolset: '14.25' # Visual Studio 2019 | 
|  | 35 | +          winsdk: '10.0.14393.0' # Windows 10 1607 | 
|  | 36 | +        # Python 3.7 | 
|  | 37 | +        - python: '3.7' | 
|  | 38 | +          builder: windows-2019 | 
|  | 39 | +          toolset: '14.25' # Visual Studio 2019 | 
|  | 40 | +          winsdk: '10.0.14393.0' # Windows 10 1607 | 
|  | 41 | +        # Python 3.8 | 
|  | 42 | +        - python: '3.8' | 
|  | 43 | +          builder: windows-2019 | 
|  | 44 | +          toolset: '14.25' # Visual Studio 2019 | 
|  | 45 | +          winsdk: '10.0.14393.0' # Windows 10 1607 | 
|  | 46 | +        # Python 3.9 | 
|  | 47 | +        - python: '3.9' | 
|  | 48 | +          builder: windows-2019 | 
|  | 49 | +          toolset: '14.25' # Visual Studio 2019 | 
|  | 50 | +          winsdk: '10.0.14393.0' # Windows 10 1607 | 
|  | 51 | +        # Python 3.10 | 
|  | 52 | +        - python: '3.10' | 
|  | 53 | +          builder: windows-2022 | 
|  | 54 | +          toolset: '14.33' # Visual Studio 2022 | 
|  | 55 | +          winsdk: '10.0.17763.0' # Windows 10 1809 | 
|  | 56 | +        arch: | 
|  | 57 | +        - x86 | 
|  | 58 | +        - x64 | 
|  | 59 | + | 
|  | 60 | +    steps: | 
|  | 61 | +    - name: Set up Python | 
|  | 62 | +      uses: actions/setup-python@v4 | 
|  | 63 | +      with: | 
|  | 64 | +        python-version: ${{ matrix.target.python }} | 
|  | 65 | +        architecture: ${{ matrix.arch }} | 
|  | 66 | + | 
|  | 67 | +    - name: Check Python version | 
|  | 68 | +      run: | | 
|  | 69 | +        set -x | 
|  | 70 | +        python --version | 
|  | 71 | +        pip --version | 
|  | 72 | +        python -c "import platform; print(platform.architecture())" | 
|  | 73 | +
 | 
|  | 74 | +    - name: Install Python dependencies | 
|  | 75 | +      run: | | 
|  | 76 | +        pip install --user setuptools wheel | 
|  | 77 | +
 | 
|  | 78 | +    - name: Set up Visual Studio Build Tools | 
|  | 79 | +      uses: ilammy/msvc-dev-cmd@v1 | 
|  | 80 | +      with: | 
|  | 81 | +        arch: ${{ matrix.arch }} | 
|  | 82 | +        sdk: ${{ matrix.target.winsdk }} | 
|  | 83 | +        toolset: ${{ matrix.target.toolset }} | 
|  | 84 | + | 
|  | 85 | +    - name: Checkout | 
|  | 86 | +      uses: actions/checkout@v3 | 
|  | 87 | +      with: | 
|  | 88 | +        submodules: recursive | 
|  | 89 | + | 
|  | 90 | +    - name: Build wheel | 
|  | 91 | +      id: build-wheel | 
|  | 92 | +      run: | | 
|  | 93 | +        ./build-wheels.bat ${{ matrix.target.python }}${{ matrix.arch == 'x86' && '-32' || '' }} | 
|  | 94 | +        ls -l dist | 
|  | 95 | +        files=(dist/*.whl) | 
|  | 96 | +        filename=$(basename ${files[0]}) | 
|  | 97 | +        echo "filename=${filename}" >> $GITHUB_OUTPUT | 
|  | 98 | +
 | 
|  | 99 | +    - name: Test wheel | 
|  | 100 | +      run: | | 
|  | 101 | +        pip install --user dist/${{ steps.build-wheel.outputs.filename }} | 
|  | 102 | +
 | 
|  | 103 | +    - name: Upload build artifact | 
|  | 104 | +      uses: actions/upload-artifact@v3 | 
|  | 105 | +      with: | 
|  | 106 | +        name: ${{ steps.build-wheel.outputs.filename }} | 
|  | 107 | +        path: dist/${{ steps.build-wheel.outputs.filename }} | 
0 commit comments