forked from scikit-learn/scikit-learn
-
Notifications
You must be signed in to change notification settings - Fork 0
82 lines (72 loc) · 3.28 KB
/
update-lock-files.yml
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
# 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 <[email protected]>"
author: "Lock file bot <[email protected]>"
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 commit_hash=`git rev-parse HEAD`
- 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}