Update lock files #26
This file contains 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
# Workflow to update lock files | |
name: Update lock files | |
on: | |
workflow_dispatch: | |
schedule: | |
- cron: '0 5 * * 1' | |
# XXX Set the right permissions, per step?? | |
# Can we set read only at the global level here and then elevate to write for some steps? | |
#permissions: read-all | |
jobs: | |
update_lock_files: | |
if: github.repository == 'scikit-learn/scikit-learn' | |
runs-on: ubuntu-latest | |
strategy: | |
# Ensure that each build will continue even if one build in the matrix fails | |
fail-fast: false | |
matrix: | |
include: | |
- name: main | |
update_script_args: "--select-tag main-ci" | |
additional_commit_message: "[doc build]" | |
- name: scipy-dev | |
update_script_args: "--select-tag scipy-dev" | |
additional_commit_message: "[scipy-dev]" | |
- name: cirrus-arm | |
update_script_args: "--select-tag arm" | |
additional_commit_message: "[cirrus arm]" | |
- name: array-api | |
update_script_args: "--select-tag cuda" | |
steps: | |
- uses: actions/checkout@v4 | |
- name: Generate lock files | |
run: | | |
source build_tools/shared.sh | |
source $CONDA/bin/activate | |
conda install -n base conda conda-libmamba-solver -y | |
conda config --set solver libmamba | |
conda install -c conda-forge "$(get_dep conda-lock min)" -y | |
python build_tools/update_environments_and_lock_files.py ${{ matrix.update_script_args }} | |
- name: Create Pull Request | |
id: cpr | |
uses: peter-evans/create-pull-request@v6 | |
with: | |
token: ${{ secrets.BOT_GITHUB_TOKEN }} | |
push-to-fork: scikit-learn-bot/scikit-learn | |
commit-message: Update CI lock files ${{ matrix.additional_commit_message }} | |
committer: "Lock file bot <noreply@github.com>" | |
author: "Lock file bot <noreply@github.com>" | |
delete-branch: true | |
branch: auto-update-lock-files-${{ matrix.name }} | |
title: ":lock: :robot: CI Update lock files for ${{ matrix.name }} CI build(s) :lock: :robot:" | |
body: | | |
Update lock files. | |
### Note | |
If the CI tasks fail, create a new branch based on this PR and add the required fixes to that branch. | |
# The CUDA workflow needs to be triggered explicitly as it uses an expensive runner | |
- name: Trigger additional tests | |
if: steps.cpr.outputs.pull-request-number != '' && matrix.name == 'array-api' | |
env: | |
GH_TOKEN: ${{ github.token }} | |
run: | | |
gh workflow run .github/workflows/cuda-gpu-ci.yml -f pr_id=${{steps.cpr.outputs.pull-request-number}} | |
- name: Check Pull Request | |
if: steps.cpr.outputs.pull-request-number != '' | |
run: | | |
echo "### :rocket: Pull-Request Summary" >> ${GITHUB_STEP_SUMMARY} | |
echo "" >> ${GITHUB_STEP_SUMMARY} | |
echo "The following lock files pull-request has been auto-generated:" | |
echo "- **PR** #${{ steps.cpr.outputs.pull-request-number }}" >> ${GITHUB_STEP_SUMMARY} | |
echo "- **URL** ${{ steps.cpr.outputs.pull-request-url }}" >> ${GITHUB_STEP_SUMMARY} | |
echo "- **Operation** [${{ steps.cpr.outputs.pull-request-operation }}]" >> ${GITHUB_STEP_SUMMARY} | |
echo "- **SHA** ${{ steps.cpr.outputs.pull-request-head-sha }}" >> ${GITHUB_STEP_SUMMARY} |