|
| 1 | +# Intel Python CI (gh-ci): builds and tests the conda packages and wheels for Intel's Jenkins, see ci/README.md |
| 2 | +name: Intel Python CI |
| 3 | + |
| 4 | +on: |
| 5 | + push: |
| 6 | + branches: [master] |
| 7 | + tags: ['*'] |
| 8 | + pull_request: |
| 9 | + |
| 10 | +permissions: |
| 11 | + contents: read |
| 12 | + |
| 13 | +concurrency: |
| 14 | + group: intel-ci-${{ github.ref }} |
| 15 | + cancel-in-progress: ${{ github.event_name == 'pull_request' }} |
| 16 | + |
| 17 | +jobs: |
| 18 | + matrix: |
| 19 | + name: Platforms and Python versions |
| 20 | + runs-on: ${{ vars.GH_CI_RUNNER || 'ubuntu-latest' }} |
| 21 | + timeout-minutes: 10 |
| 22 | + outputs: |
| 23 | + matrix: ${{ steps.declared.outputs.matrix }} |
| 24 | + wheel: ${{ steps.declared.outputs.wheel }} |
| 25 | + steps: |
| 26 | + - uses: actions/checkout@3d3c42e5aac5ba805825da76410c181273ba90b1 # v7.0.1 |
| 27 | + with: |
| 28 | + persist-credentials: false |
| 29 | + |
| 30 | + - uses: actions/setup-python@5fda3b95a4ea91299a34e894583c3862153e4b97 # v7.0.0 |
| 31 | + with: |
| 32 | + python-version: "3.14" |
| 33 | + |
| 34 | + - name: Read the declared platforms and Python versions |
| 35 | + id: declared |
| 36 | + run: | |
| 37 | + python ci/matrix.py --event "$GITHUB_EVENT_NAME" --github-output matrix |
| 38 | + python ci/matrix.py --system wheel --event "$GITHUB_EVENT_NAME" --github-output wheel |
| 39 | +
|
| 40 | + # The recipe and pyproject.toml declare no macOS, as SYCL has none; Jenkins ignores it anyway. |
| 41 | + build: |
| 42 | + name: ${{ matrix.name }} Python ${{ matrix.python }} |
| 43 | + needs: matrix |
| 44 | + runs-on: ${{ matrix.platform == 'windows' && (vars.GH_CI_WINDOWS_RUNNER || 'windows-2022') || matrix.platform == 'macos' && (vars.GH_CI_MACOS_RUNNER || 'macos-26-intel') || (vars.GH_CI_RUNNER || 'ubuntu-latest') }} |
| 45 | + timeout-minutes: 150 |
| 46 | + strategy: |
| 47 | + fail-fast: false |
| 48 | + matrix: ${{ fromJSON(needs.matrix.outputs.matrix) }} |
| 49 | + defaults: |
| 50 | + run: |
| 51 | + shell: bash -el {0} |
| 52 | + steps: |
| 53 | + - uses: actions/checkout@3d3c42e5aac5ba805825da76410c181273ba90b1 # v7.0.1 |
| 54 | + with: |
| 55 | + persist-credentials: false |
| 56 | + # The recipe takes its version from git describe. |
| 57 | + fetch-depth: 0 |
| 58 | + |
| 59 | + # Miniforge 26.9.4-0 fails setup-miniconda's conda init on Windows runners; 26.7.2-0 works. |
| 60 | + - uses: conda-incubator/setup-miniconda@be893c923ea9cf1cf7cd510fbdde27c7e18cbdcb # v4.1.0 |
| 61 | + with: |
| 62 | + miniforge-version: 26.7.2-0 |
| 63 | + activate-environment: "" |
| 64 | + conda-remove-defaults: "true" |
| 65 | + |
| 66 | + - name: Install conda-build |
| 67 | + run: conda install -y -q -n base --override-channels -c conda-forge conda-build |
| 68 | + |
| 69 | + - name: Build and run the recipe tests |
| 70 | + env: |
| 71 | + PYTHON_VERSION: ${{ matrix.python }} |
| 72 | + run: python ci/build.py --python "$PYTHON_VERSION" --output "$RUNNER_TEMP/output" |
| 73 | + |
| 74 | + - uses: actions/upload-artifact@cf430e030ddbb5b0abf93d22962f4752f3646cd9 # v7.0.2 |
| 75 | + with: |
| 76 | + name: dpctl ${{ matrix.name }} Python ${{ matrix.python }} |
| 77 | + path: ${{ runner.temp }}/output/*.conda |
| 78 | + if-no-files-found: error |
| 79 | + # Jenkins downloads them within minutes of the run; tags keep them 30 days. |
| 80 | + retention-days: ${{ startsWith(github.ref, 'refs/tags/') && 30 || 3 }} |
| 81 | + |
| 82 | + test: |
| 83 | + name: Test ${{ matrix.name }} Python ${{ matrix.python }} |
| 84 | + needs: [matrix, build] |
| 85 | + runs-on: ${{ matrix.platform == 'windows' && (vars.GH_CI_WINDOWS_RUNNER || 'windows-2022') || matrix.platform == 'macos' && (vars.GH_CI_MACOS_RUNNER || 'macos-26-intel') || (vars.GH_CI_RUNNER || 'ubuntu-latest') }} |
| 86 | + timeout-minutes: 60 |
| 87 | + strategy: |
| 88 | + fail-fast: false |
| 89 | + matrix: ${{ fromJSON(needs.matrix.outputs.matrix) }} |
| 90 | + defaults: |
| 91 | + run: |
| 92 | + shell: bash -el {0} |
| 93 | + steps: |
| 94 | + - uses: actions/checkout@3d3c42e5aac5ba805825da76410c181273ba90b1 # v7.0.1 |
| 95 | + with: |
| 96 | + persist-credentials: false |
| 97 | + |
| 98 | + - uses: actions/download-artifact@9000827ccba6bdab643e8b6fd33ac0654aef8333 # v8.0.2 |
| 99 | + with: |
| 100 | + name: dpctl ${{ matrix.name }} Python ${{ matrix.python }} |
| 101 | + path: ${{ runner.temp }}/artifacts |
| 102 | + |
| 103 | + - uses: conda-incubator/setup-miniconda@be893c923ea9cf1cf7cd510fbdde27c7e18cbdcb # v4.1.0 |
| 104 | + with: |
| 105 | + miniforge-version: 26.7.2-0 |
| 106 | + activate-environment: "" |
| 107 | + conda-remove-defaults: "true" |
| 108 | + |
| 109 | + - name: Install the package and run ci/test.py |
| 110 | + env: |
| 111 | + PYTHON_VERSION: ${{ matrix.python }} |
| 112 | + EVENT: ${{ startsWith(github.ref, 'refs/tags/') && 'tag' || github.event_name == 'pull_request' && 'pr' || 'push' }} |
| 113 | + COMMIT: ${{ github.event.pull_request.head.sha || github.sha }} |
| 114 | + run: >- |
| 115 | + python ci/hooks.py --python "$PYTHON_VERSION" --artifacts "$RUNNER_TEMP/artifacts" |
| 116 | + --work "$RUNNER_TEMP/hooks" --event "$EVENT" --commit "$COMMIT" |
| 117 | +
|
| 118 | + build-wheel: |
| 119 | + name: ${{ matrix.name }} Wheels Python ${{ matrix.python }} |
| 120 | + needs: matrix |
| 121 | + runs-on: ${{ matrix.platform == 'windows' && (vars.GH_CI_WINDOWS_RUNNER || 'windows-2022') || matrix.platform == 'macos' && (vars.GH_CI_MACOS_RUNNER || 'macos-26-intel') || (vars.GH_CI_RUNNER || 'ubuntu-latest') }} |
| 122 | + timeout-minutes: 150 |
| 123 | + strategy: |
| 124 | + fail-fast: false |
| 125 | + matrix: ${{ fromJSON(needs.matrix.outputs.wheel) }} |
| 126 | + defaults: |
| 127 | + run: |
| 128 | + shell: bash |
| 129 | + steps: |
| 130 | + - uses: actions/checkout@3d3c42e5aac5ba805825da76410c181273ba90b1 # v7.0.1 |
| 131 | + with: |
| 132 | + persist-credentials: false |
| 133 | + # versioneer takes the version from git describe. |
| 134 | + fetch-depth: 0 |
| 135 | + |
| 136 | + - uses: actions/setup-python@5fda3b95a4ea91299a34e894583c3862153e4b97 # v7.0.0 |
| 137 | + with: |
| 138 | + python-version: "3.14" |
| 139 | + |
| 140 | + # CMake builds with Ninja and icx, which need MSVC's environment. |
| 141 | + - uses: ilammy/msvc-dev-cmd@0b201ec74fa43914dc39ae48a89fd1d8cb592756 # v1.13.0 |
| 142 | + if: matrix.platform == 'windows' |
| 143 | + |
| 144 | + - name: Install cibuildwheel |
| 145 | + run: python -m pip install --no-input cibuildwheel==4.3.5 |
| 146 | + |
| 147 | + - name: Build the wheel |
| 148 | + env: |
| 149 | + PYTHON_VERSION: ${{ matrix.python }} |
| 150 | + run: python ci/build.py --system wheel --python "$PYTHON_VERSION" --output "$RUNNER_TEMP/output" |
| 151 | + |
| 152 | + - uses: actions/upload-artifact@cf430e030ddbb5b0abf93d22962f4752f3646cd9 # v7.0.2 |
| 153 | + with: |
| 154 | + name: dpctl ${{ matrix.name }} Wheels Python ${{ matrix.python }} |
| 155 | + path: ${{ runner.temp }}/output/*.whl |
| 156 | + if-no-files-found: error |
| 157 | + retention-days: ${{ startsWith(github.ref, 'refs/tags/') && 30 || 3 }} |
| 158 | + |
| 159 | + test-wheel: |
| 160 | + name: Test ${{ matrix.name }} Wheels Python ${{ matrix.python }} |
| 161 | + needs: [matrix, build-wheel] |
| 162 | + runs-on: ${{ matrix.platform == 'windows' && (vars.GH_CI_WINDOWS_RUNNER || 'windows-2022') || matrix.platform == 'macos' && (vars.GH_CI_MACOS_RUNNER || 'macos-26-intel') || (vars.GH_CI_RUNNER || 'ubuntu-latest') }} |
| 163 | + timeout-minutes: 60 |
| 164 | + strategy: |
| 165 | + fail-fast: false |
| 166 | + matrix: ${{ fromJSON(needs.matrix.outputs.wheel) }} |
| 167 | + defaults: |
| 168 | + run: |
| 169 | + shell: bash -el {0} |
| 170 | + steps: |
| 171 | + - uses: actions/checkout@3d3c42e5aac5ba805825da76410c181273ba90b1 # v7.0.1 |
| 172 | + with: |
| 173 | + persist-credentials: false |
| 174 | + |
| 175 | + - uses: actions/download-artifact@9000827ccba6bdab643e8b6fd33ac0654aef8333 # v8.0.2 |
| 176 | + with: |
| 177 | + name: dpctl ${{ matrix.name }} Wheels Python ${{ matrix.python }} |
| 178 | + path: ${{ runner.temp }}/artifacts |
| 179 | + |
| 180 | + - uses: conda-incubator/setup-miniconda@be893c923ea9cf1cf7cd510fbdde27c7e18cbdcb # v4.1.0 |
| 181 | + with: |
| 182 | + miniforge-version: 26.7.2-0 |
| 183 | + activate-environment: "" |
| 184 | + conda-remove-defaults: "true" |
| 185 | + |
| 186 | + - name: Install the wheel and run ci/test.py |
| 187 | + env: |
| 188 | + PYTHON_VERSION: ${{ matrix.python }} |
| 189 | + EVENT: ${{ startsWith(github.ref, 'refs/tags/') && 'tag' || github.event_name == 'pull_request' && 'pr' || 'push' }} |
| 190 | + COMMIT: ${{ github.event.pull_request.head.sha || github.sha }} |
| 191 | + run: >- |
| 192 | + python ci/hooks.py --kind wheel --python "$PYTHON_VERSION" --artifacts "$RUNNER_TEMP/artifacts" |
| 193 | + --work "$RUNNER_TEMP/hooks" --event "$EVENT" --commit "$COMMIT" |
| 194 | +
|
| 195 | + # The dev channel on anaconda.org, which docs and the nightly run-tests-from-dppy-bits.yaml read. |
| 196 | + upload: |
| 197 | + name: Upload to anaconda.org |
| 198 | + needs: [test, test-wheel] |
| 199 | + if: | |
| 200 | + github.repository == 'IntelPython/dpctl' && |
| 201 | + github.event_name == 'push' && |
| 202 | + (github.ref == 'refs/heads/master' || startsWith(github.ref, 'refs/tags/')) |
| 203 | + runs-on: ${{ vars.GH_CI_RUNNER || 'ubuntu-latest' }} |
| 204 | + timeout-minutes: 20 |
| 205 | + defaults: |
| 206 | + run: |
| 207 | + shell: bash |
| 208 | + steps: |
| 209 | + - uses: actions/download-artifact@9000827ccba6bdab643e8b6fd33ac0654aef8333 # v8.0.2 |
| 210 | + with: |
| 211 | + pattern: dpctl * |
| 212 | + merge-multiple: true |
| 213 | + path: ${{ runner.temp }}/packages |
| 214 | + |
| 215 | + - uses: actions/setup-python@5fda3b95a4ea91299a34e894583c3862153e4b97 # v7.0.0 |
| 216 | + with: |
| 217 | + python-version: "3.14" |
| 218 | + |
| 219 | + - name: Install anaconda-client |
| 220 | + run: python -m pip install --no-input anaconda-client |
| 221 | + |
| 222 | + - name: Upload the conda packages and the wheels |
| 223 | + env: |
| 224 | + ANACONDA_TOKEN: ${{ secrets.ANACONDA_TOKEN }} |
| 225 | + PACKAGES: ${{ runner.temp }}/packages |
| 226 | + run: | |
| 227 | + cd "$PACKAGES" |
| 228 | + conda_packages=(dpctl-*.conda) |
| 229 | + version=${conda_packages[0]#dpctl-} |
| 230 | + version=${version%%-*} |
| 231 | + anaconda --token "$ANACONDA_TOKEN" upload --user dppy --label dev dpctl-*.conda |
| 232 | + anaconda --token "$ANACONDA_TOKEN" upload --user dppy --label dev dpctl-*.whl --version "$version" |
| 233 | +
|
| 234 | + cleanup: |
| 235 | + name: Clean up anaconda.org |
| 236 | + needs: upload |
| 237 | + if: | |
| 238 | + github.repository == 'IntelPython/dpctl' && |
| 239 | + github.event_name == 'push' && |
| 240 | + (github.ref == 'refs/heads/master' || startsWith(github.ref, 'refs/tags/')) |
| 241 | + runs-on: ${{ vars.GH_CI_RUNNER || 'ubuntu-latest' }} |
| 242 | + timeout-minutes: 30 |
| 243 | + steps: |
| 244 | + - uses: actions/checkout@3d3c42e5aac5ba805825da76410c181273ba90b1 # v7.0.1 |
| 245 | + with: |
| 246 | + persist-credentials: false |
| 247 | + repository: IntelPython/devops-tools |
| 248 | + fetch-depth: 0 |
| 249 | + |
| 250 | + - uses: actions/setup-python@5fda3b95a4ea91299a34e894583c3862153e4b97 # v7.0.0 |
| 251 | + with: |
| 252 | + python-version: "3.11" |
| 253 | + |
| 254 | + - name: Install anaconda-client |
| 255 | + run: python -m pip install --no-input anaconda-client |
| 256 | + |
| 257 | + - name: Remove the old dev packages |
| 258 | + env: |
| 259 | + ANACONDA_TOKEN: ${{ secrets.ANACONDA_TOKEN }} |
| 260 | + run: python scripts/cleanup-old-packages.py --verbose --force --token "$ANACONDA_TOKEN" --package dppy/dpctl --label dev |
0 commit comments