|
| 1 | +name: llvmlite_win-64_wheel_builder |
| 2 | + |
| 3 | +on: |
| 4 | + pull_request: |
| 5 | + paths: |
| 6 | + - .github/workflows/llvmlite_win-64_wheel_builder.yml |
| 7 | + workflow_dispatch: |
| 8 | + inputs: |
| 9 | + llvmdev_run_id: |
| 10 | + description: 'llvmdev workflow run ID (optional)' |
| 11 | + required: false |
| 12 | + type: string |
| 13 | + |
| 14 | +# Add concurrency control |
| 15 | +concurrency: |
| 16 | + group: ${{ github.workflow }}-${{ github.event.pull_request.number || github.sha }} |
| 17 | + cancel-in-progress: true |
| 18 | + |
| 19 | +env: |
| 20 | + LOCAL_LLVMDEV_ARTIFACT_PATH: D:/a/llvmlite/llvmlite/llvmdev_conda_packages |
| 21 | + FALLBACK_LLVMDEV_VERSION: "15" |
| 22 | + CONDA_CHANNEL_NUMBA: numba/label/win64_wheel |
| 23 | + VALIDATION_PYTHON_VERSION: "3.12" |
| 24 | + ARTIFACT_RETENTION_DAYS: 7 |
| 25 | + |
| 26 | +jobs: |
| 27 | + win-64-build: |
| 28 | + name: win-64-build |
| 29 | + runs-on: windows-2019 |
| 30 | + defaults: |
| 31 | + run: |
| 32 | + shell: bash -el {0} |
| 33 | + strategy: |
| 34 | + matrix: |
| 35 | + python-version: ["3.10", "3.11", "3.12", "3.13"] |
| 36 | + fail-fast: false |
| 37 | + |
| 38 | + steps: |
| 39 | + - name: Clone repository |
| 40 | + uses: actions/checkout@v4 |
| 41 | + with: |
| 42 | + fetch-depth: 0 |
| 43 | + |
| 44 | + - name: Setup Miniconda |
| 45 | + uses: conda-incubator/setup-miniconda@v3 |
| 46 | + with: |
| 47 | + python-version: ${{ matrix.python-version }} |
| 48 | + conda-remove-defaults: true |
| 49 | + auto-update-conda: true |
| 50 | + auto-activate-base: true |
| 51 | + |
| 52 | + - name: Download llvmdev Artifact |
| 53 | + if: ${{ inputs.llvmdev_run_id != '' }} |
| 54 | + uses: actions/download-artifact@v4 |
| 55 | + with: |
| 56 | + name: llvmdev_win-64 |
| 57 | + path: llvmdev_conda_packages |
| 58 | + run-id: ${{ inputs.llvmdev_run_id }} |
| 59 | + repository: ${{ github.repository }} |
| 60 | + github-token: ${{ secrets.GITHUB_TOKEN }} |
| 61 | + |
| 62 | + - name: Install build dependencies |
| 63 | + run: | |
| 64 | + set -x |
| 65 | + if [ "${{ inputs.llvmdev_run_id }}" != "" ]; then |
| 66 | + CHAN="file:///${{ env.LOCAL_LLVMDEV_ARTIFACT_PATH }}" |
| 67 | + else |
| 68 | + CHAN="${{ env.CONDA_CHANNEL_NUMBA }}" |
| 69 | + fi |
| 70 | + conda install -c "$CHAN" llvmdev=${{ env.FALLBACK_LLVMDEV_VERSION }} cmake libxml2 python-build |
| 71 | +
|
| 72 | + - name: Build wheel |
| 73 | + run: python -m build |
| 74 | + |
| 75 | + - name: Upload llvmlite wheel |
| 76 | + uses: actions/upload-artifact@v4 |
| 77 | + with: |
| 78 | + name: llvmlite-win-64-py${{ matrix.python-version }} |
| 79 | + path: dist/*.whl |
| 80 | + compression-level: 0 |
| 81 | + retention-days: ${{ env.ARTIFACT_RETENTION_DAYS }} |
| 82 | + if-no-files-found: error |
| 83 | + |
| 84 | + win-64-validate: |
| 85 | + name: win-64-validate |
| 86 | + needs: win-64-build |
| 87 | + runs-on: windows-2019 |
| 88 | + defaults: |
| 89 | + run: |
| 90 | + shell: bash -el {0} |
| 91 | + strategy: |
| 92 | + matrix: |
| 93 | + python-version: ["3.10", "3.11", "3.12", "3.13"] |
| 94 | + fail-fast: false |
| 95 | + steps: |
| 96 | + - name: Clone repository |
| 97 | + uses: actions/checkout@v4 |
| 98 | + |
| 99 | + - name: Setup Miniconda |
| 100 | + uses: conda-incubator/setup-miniconda@v3 |
| 101 | + with: |
| 102 | + python-version: ${{ env.VALIDATION_PYTHON_VERSION }} |
| 103 | + conda-remove-defaults: true |
| 104 | + auto-update-conda: true |
| 105 | + auto-activate-base: true |
| 106 | + |
| 107 | + - name: Install validation dependencies |
| 108 | + run: conda install -c defaults py-lief wheel twine keyring rfc3986 |
| 109 | + |
| 110 | + - name: Download llvmlite wheels |
| 111 | + uses: actions/download-artifact@v4 |
| 112 | + with: |
| 113 | + name: llvmlite-win-64-py${{ matrix.python-version }} |
| 114 | + path: dist |
| 115 | + |
| 116 | + - name: Validate wheels |
| 117 | + run: | |
| 118 | + cd dist |
| 119 | + for WHL_FILE in *.whl; do |
| 120 | + wheel unpack "$WHL_FILE" |
| 121 | + python "$GITHUB_WORKSPACE"/buildscripts/github/validate_win64_wheel.py llvmlite/binding/llvmlite.dll |
| 122 | + twine check "$WHL_FILE" |
| 123 | + done |
| 124 | +
|
| 125 | + win-64-test: |
| 126 | + name: win-64-test |
| 127 | + needs: win-64-validate |
| 128 | + runs-on: windows-2019 |
| 129 | + defaults: |
| 130 | + run: |
| 131 | + shell: bash -el {0} |
| 132 | + strategy: |
| 133 | + matrix: |
| 134 | + python-version: ["3.10", "3.11", "3.12", "3.13"] |
| 135 | + fail-fast: false |
| 136 | + |
| 137 | + steps: |
| 138 | + - name: Setup Python |
| 139 | + uses: actions/setup-python@v5 |
| 140 | + with: |
| 141 | + python-version: ${{ matrix.python-version }} |
| 142 | + |
| 143 | + - name: Download llvmlite wheel |
| 144 | + uses: actions/download-artifact@v4 |
| 145 | + with: |
| 146 | + name: llvmlite-win-64-py${{ matrix.python-version }} |
| 147 | + path: dist |
| 148 | + |
| 149 | + - name: Install and test |
| 150 | + run: | |
| 151 | + pip install dist/*.whl |
| 152 | + python -m llvmlite.tests |
0 commit comments