Repository navigation
Build and test conda packages and wheels for Intel Python CI #265
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
base: master
Are you sure you want to change the base?
Changes from all commits
File filter
Filter by extension
Conversations
Jump to
Diff view
Diff view
There are no files selected for viewing
This file was deleted.
| Original file line number | Diff line number | Diff line change |
|---|---|---|
| @@ -0,0 +1,191 @@ | ||
| # Intel Python CI (gh-ci): builds and tests the conda packages and wheels for Intel's Jenkins, see ci/README.md | ||
| name: Intel Python CI | ||
|
|
||
| on: | ||
| push: | ||
| branches: [master] | ||
| tags: ['*'] | ||
| pull_request: | ||
|
|
||
| permissions: | ||
| contents: read | ||
|
|
||
| concurrency: | ||
| group: intel-ci-${{ github.ref }} | ||
| cancel-in-progress: ${{ github.event_name == 'pull_request' }} | ||
|
|
||
| jobs: | ||
| matrix: | ||
| name: Platforms and Python versions | ||
| runs-on: ${{ vars.GH_CI_RUNNER || 'ubuntu-latest' }} | ||
| timeout-minutes: 10 | ||
| outputs: | ||
| matrix: ${{ steps.declared.outputs.matrix }} | ||
| wheel: ${{ steps.declared.outputs.wheel }} | ||
| steps: | ||
| - uses: actions/checkout@3d3c42e5aac5ba805825da76410c181273ba90b1 # v7.0.1 | ||
| with: | ||
| persist-credentials: false | ||
|
|
||
| - uses: actions/setup-python@5fda3b95a4ea91299a34e894583c3862153e4b97 # v7.0.0 | ||
| with: | ||
| python-version: "3.14" | ||
|
|
||
| - name: Read the declared platforms and Python versions | ||
| id: declared | ||
| run: | | ||
| python ci/matrix.py --event "$GITHUB_EVENT_NAME" --github-output matrix | ||
| python ci/matrix.py --system wheel --event "$GITHUB_EVENT_NAME" --github-output wheel | ||
|
|
||
| # macOS runs on Intel runners, as MKL has no Apple silicon build; Jenkins ignores it. | ||
| build: | ||
| name: ${{ matrix.name }} Python ${{ matrix.python }} | ||
| needs: matrix | ||
| 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') }} | ||
| timeout-minutes: 90 | ||
| strategy: | ||
| fail-fast: false | ||
| matrix: ${{ fromJSON(needs.matrix.outputs.matrix) }} | ||
| defaults: | ||
| run: | ||
| shell: bash -el {0} | ||
| steps: | ||
| - uses: actions/checkout@3d3c42e5aac5ba805825da76410c181273ba90b1 # v7.0.1 | ||
| with: | ||
| persist-credentials: false | ||
| # The recipe takes its version from git describe. | ||
| fetch-depth: 0 | ||
|
|
||
| # Miniforge 26.9.4-0 fails setup-miniconda's conda init on Windows runners; 26.7.2-0 works. | ||
| - uses: conda-incubator/setup-miniconda@be893c923ea9cf1cf7cd510fbdde27c7e18cbdcb # v4.1.0 | ||
| with: | ||
| miniforge-version: 26.7.2-0 | ||
| activate-environment: "" | ||
| conda-remove-defaults: "true" | ||
|
|
||
| - name: Install conda-build | ||
| run: conda install -y -q -n base --override-channels -c conda-forge conda-build=26.9.1 | ||
|
|
||
| - name: Build and run the recipe tests | ||
| env: | ||
| PYTHON_VERSION: ${{ matrix.python }} | ||
| run: python ci/build.py --python "$PYTHON_VERSION" --output "$RUNNER_TEMP/output" | ||
|
|
||
| - uses: actions/upload-artifact@cf430e030ddbb5b0abf93d22962f4752f3646cd9 # v7.0.2 | ||
| with: | ||
| name: mkl-service ${{ matrix.name }} Python ${{ matrix.python }} | ||
| path: ${{ runner.temp }}/output/*.conda | ||
| if-no-files-found: error | ||
| # Jenkins downloads them within minutes of the run; tags keep them 30 days. | ||
| retention-days: ${{ startsWith(github.ref, 'refs/tags/') && 30 || 3 }} | ||
|
|
||
| test: | ||
| name: Test ${{ matrix.name }} Python ${{ matrix.python }} | ||
| needs: [matrix, build] | ||
|
Contributor
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. If any build leg fails, macOS included, all the test legs get skipped and the run fails. Jenkins needs a green run, so a macOS-only failure would block a tag release even though Jenkins ignores macOS artifacts. Is that intended? Same on
Collaborator
Author
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. Good catch on the skipped tests: |
||
| # Test every package that built, even when another build failed | ||
| if: ${{ !cancelled() && needs.matrix.result == 'success' }} | ||
| 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') }} | ||
| timeout-minutes: 45 | ||
| strategy: | ||
| fail-fast: false | ||
| matrix: ${{ fromJSON(needs.matrix.outputs.matrix) }} | ||
| defaults: | ||
| run: | ||
| shell: bash -el {0} | ||
| steps: | ||
| - uses: actions/checkout@3d3c42e5aac5ba805825da76410c181273ba90b1 # v7.0.1 | ||
| with: | ||
| persist-credentials: false | ||
|
|
||
| - uses: actions/download-artifact@9000827ccba6bdab643e8b6fd33ac0654aef8333 # v8.0.2 | ||
| with: | ||
| name: mkl-service ${{ matrix.name }} Python ${{ matrix.python }} | ||
| path: ${{ runner.temp }}/artifacts | ||
|
|
||
| - uses: conda-incubator/setup-miniconda@be893c923ea9cf1cf7cd510fbdde27c7e18cbdcb # v4.1.0 | ||
| with: | ||
| miniforge-version: 26.7.2-0 | ||
| activate-environment: "" | ||
| conda-remove-defaults: "true" | ||
|
|
||
| - name: Install the package and run ci/test.py | ||
| env: | ||
| PYTHON_VERSION: ${{ matrix.python }} | ||
| EVENT: ${{ startsWith(github.ref, 'refs/tags/') && 'tag' || github.event_name == 'pull_request' && 'pr' || 'push' }} | ||
| COMMIT: ${{ github.event.pull_request.head.sha || github.sha }} | ||
| run: >- | ||
| python ci/hooks.py --python "$PYTHON_VERSION" --artifacts "$RUNNER_TEMP/artifacts" | ||
| --work "$RUNNER_TEMP/hooks" --event "$EVENT" --commit "$COMMIT" | ||
|
|
||
| build-wheel: | ||
| name: ${{ matrix.name }} Wheels Python ${{ matrix.python }} | ||
| needs: matrix | ||
| 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') }} | ||
| timeout-minutes: 90 | ||
| strategy: | ||
| fail-fast: false | ||
| matrix: ${{ fromJSON(needs.matrix.outputs.wheel) }} | ||
| defaults: | ||
| run: | ||
| shell: bash | ||
| steps: | ||
| - uses: actions/checkout@3d3c42e5aac5ba805825da76410c181273ba90b1 # v7.0.1 | ||
| with: | ||
| persist-credentials: false | ||
|
|
||
| - uses: actions/setup-python@5fda3b95a4ea91299a34e894583c3862153e4b97 # v7.0.0 | ||
| with: | ||
| python-version: "3.14" | ||
|
|
||
| - name: Install cibuildwheel | ||
| run: python -m pip install --no-input cibuildwheel==4.3.5 | ||
|
|
||
| - name: Build the wheel | ||
| env: | ||
| PYTHON_VERSION: ${{ matrix.python }} | ||
| run: python ci/build.py --system wheel --python "$PYTHON_VERSION" --output "$RUNNER_TEMP/output" | ||
|
|
||
| - uses: actions/upload-artifact@cf430e030ddbb5b0abf93d22962f4752f3646cd9 # v7.0.2 | ||
| with: | ||
| name: mkl-service ${{ matrix.name }} Wheels Python ${{ matrix.python }} | ||
| path: ${{ runner.temp }}/output/*.whl | ||
| if-no-files-found: error | ||
| retention-days: ${{ startsWith(github.ref, 'refs/tags/') && 30 || 3 }} | ||
|
|
||
| test-wheel: | ||
| name: Test ${{ matrix.name }} Wheels Python ${{ matrix.python }} | ||
| needs: [matrix, build-wheel] | ||
| # Test every package that built, even when another build failed | ||
| if: ${{ !cancelled() && needs.matrix.result == 'success' }} | ||
| 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') }} | ||
| timeout-minutes: 45 | ||
| strategy: | ||
| fail-fast: false | ||
| matrix: ${{ fromJSON(needs.matrix.outputs.wheel) }} | ||
| defaults: | ||
| run: | ||
| shell: bash -el {0} | ||
| steps: | ||
| - uses: actions/checkout@3d3c42e5aac5ba805825da76410c181273ba90b1 # v7.0.1 | ||
| with: | ||
| persist-credentials: false | ||
|
|
||
| - uses: actions/download-artifact@9000827ccba6bdab643e8b6fd33ac0654aef8333 # v8.0.2 | ||
| with: | ||
| name: mkl-service ${{ matrix.name }} Wheels Python ${{ matrix.python }} | ||
| path: ${{ runner.temp }}/artifacts | ||
|
|
||
| - uses: conda-incubator/setup-miniconda@be893c923ea9cf1cf7cd510fbdde27c7e18cbdcb # v4.1.0 | ||
| with: | ||
| miniforge-version: 26.7.2-0 | ||
| activate-environment: "" | ||
| conda-remove-defaults: "true" | ||
|
|
||
| - name: Install the wheel and run ci/test.py | ||
| env: | ||
| PYTHON_VERSION: ${{ matrix.python }} | ||
| EVENT: ${{ startsWith(github.ref, 'refs/tags/') && 'tag' || github.event_name == 'pull_request' && 'pr' || 'push' }} | ||
| COMMIT: ${{ github.event.pull_request.head.sha || github.sha }} | ||
| run: >- | ||
| python ci/hooks.py --kind wheel --python "$PYTHON_VERSION" --artifacts "$RUNNER_TEMP/artifacts" | ||
| --work "$RUNNER_TEMP/hooks" --event "$EVENT" --commit "$COMMIT" | ||
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
If
GH_CI_RUNNERis ever pointed at a self-hosted runner, fork PRs would run on it. Fine today, just keep it in mind.There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Agreed. Fork PRs are meant to run, as long as the author is an intel-innersource member, but that check happens in Jenkins: Actions runs every fork PR before Jenkins looks at it. So pointing
GH_CI_RUNNERat a self-hosted runner here would need a gate of its own first. Nothing sets it today; every job in the last run was on a GitHub-hosted runner.