-
Notifications
You must be signed in to change notification settings - Fork 92
89 lines (75 loc) · 3.21 KB
/
toolchain-upgrade.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
83
84
85
86
87
88
89
# Copyright Kani Contributors
# SPDX-License-Identifier: Apache-2.0 OR MIT
name: Attempt toolchain update
on:
schedule:
- cron: "30 2 * * *" # Run this every day at 02:30 UTC
workflow_dispatch: # Allow manual dispatching for a custom branch / tag.
permissions:
checks: write
contents: write
issues: write
pull-requests: write
jobs:
create-toolchain-pr:
runs-on: ubuntu-22.04
steps:
- name: Checkout Kani
uses: actions/checkout@v4
- name: Setup Kani Dependencies
uses: ./.github/actions/setup
with:
os: ubuntu-22.04
- name: Update toolchain config
env:
GH_TOKEN: ${{ github.token }}
run: |
source scripts/toolchain_update.sh
- name: Clean untracked files
run: git clean -f
- name: Create Pull Request
id: create_pr
if: ${{ env.next_step == 'create_pr' }}
uses: peter-evans/create-pull-request@v7
with:
commit-message: Upgrade Rust toolchain to nightly-${{ env.next_toolchain_date }}
branch: toolchain-${{ env.next_toolchain_date }}
delete-branch: true
title: 'Automatic toolchain upgrade to nightly-${{ env.next_toolchain_date }}'
body: >
Update Rust toolchain from nightly-${{ env.current_toolchain_date }} to
nightly-${{ env.next_toolchain_date }} without any other source changes.
- name: Add debugging hints
if: ${{ steps.create_pr.outputs.pull-request-number }}
uses: actions/github-script@v7
with:
script: |
github.rest.issues.createComment({
issue_number: ${{ steps.create_pr.outputs.pull-request-number }},
owner: context.repo.owner,
repo: context.repo.repo,
body: `This is an automatically generated pull request. If any of the CI checks fail,
manual intervention is required. In such a case, review the changes at
https://github.com/rust-lang/rust from
https://github.com/rust-lang/rust/commit/${{ env.current_toolchain_hash }} up to
https://github.com/rust-lang/rust/commit/${{ env.next_toolchain_hash }}. The log
for this commit range is:
` + process.env.git_log
})
- name: Create Issue
if: ${{ env.next_step == 'create_issue' }}
uses: dacbd/create-issue-action@main
with:
token: ${{ github.token }}
title: 'Toolchain upgrade to nightly-${{ env.next_toolchain_date }} failed'
body: >
Updating Rust toolchain from nightly-${{ env.current_toolchain_date }} to
nightly-${{ env.next_toolchain_date }} requires source changes.
The failed automated run
[can be found here.](https://github.com/${{ github.repository }}/actions/runs/${{ github.run_id }})
Please review the changes at
https://github.com/rust-lang/rust from
https://github.com/rust-lang/rust/commit/${{ env.current_toolchain_hash }} up to
https://github.com/rust-lang/rust/commit/${{ env.next_toolchain_hash }}. The log
for this commit range is:
${{ env.git_log }}