-
Notifications
You must be signed in to change notification settings - Fork 1
92 lines (74 loc) · 3.12 KB
/
msrv.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
90
91
92
name: MSRV
permissions:
contents: write
on:
workflow_call:
workflow_dispatch:
inputs:
update-msrv:
type: boolean
jobs:
check-msrv:
if: ${{ !inputs.update-msrv }}
runs-on: ubuntu-latest
steps:
- name: Fetch Repository
uses: actions/checkout@6d193bf28034eafb982f37bd894289fe649468fc # v4.1.7
with:
submodules: true
- name: Install stable toolchain
uses: actions-rust-lang/setup-rust-toolchain@1fbea72663f6d4c03efaab13560c8a24cfd2a7cc # v1.9.0
- uses: cargo-bins/cargo-binstall@9330730a2ae0fec8c2d7e1653888fe7701dd409a #v1.10.3
- name: Install cargo-msrv
# waiting for the stable release
run: cargo binstall cargo-msrv --version 0.16.0-beta.25 -y --force
- name: Get current msrv
id: data-msrv
run: |
current_msrv=$(cargo msrv --path ./ribboncurls show --output-format minimal);
echo "current msrv: $current_msrv";
echo "current=$current_msrv" >> "$GITHUB_OUTPUT";
- name: Run cargo msrv
run: cargo clean && cargo msrv --path ./ribboncurls verify --min ${{ steps.data-msrv.outputs.current }}
update-msrv:
if: inputs.update-msrv
runs-on: ubuntu-latest
steps:
- name: Fetch Repository
uses: actions/checkout@6d193bf28034eafb982f37bd894289fe649468fc # v4.1.7
with:
submodules: true
- run: git pull
- name: Install stable toolchain
uses: actions-rust-lang/setup-rust-toolchain@1fbea72663f6d4c03efaab13560c8a24cfd2a7cc # v1.9.0
- uses: cargo-bins/cargo-binstall@9330730a2ae0fec8c2d7e1653888fe7701dd409a #v1.10.3
- name: Install cargo-msrv
# waiting for the stable release
run: cargo binstall cargo-msrv --version 0.16.0-beta.20 -y --force
- name: Get msrv data
id: data-msrv
run: |
current_msrv=$(cargo msrv --path ./ribboncurls show --output-format minimal);
echo "current msrv: $current_msrv";
echo "current=$current_msrv" >> "$GITHUB_OUTPUT";
new_msrv=$(cargo msrv --path ./ribboncurls --output-format minimal --min $current_msrv);
echo "new msrv: $new_msrv";
echo "new=$new_msrv" >> "$GITHUB_OUTPUT";
- name: Update cargo msrv
run: cargo msrv --path ./ribboncurls set ${{ steps.data-msrv.outputs.new }}
- name: Update readme msrv
uses: jacobtomlinson/gha-find-replace@099c88fbf2a7da26b083521a8bfa13e4f0886b97 # v3.0.3
with:
find: ${{ steps.data-msrv.outputs.current }}
replace: ${{ steps.data-msrv.outputs.new }}
regex: false
include: "README.md"
- run: git pull
- name: Commit and Push
uses: stefanzweifel/git-auto-commit-action@ac8823709a85c7ce090849ac3e5fe24d006f6e18 # v5.0.1
with:
commit_message: "Update MSRV from [${{steps.data-msrv.outputs.current}}] to [${{steps.data-msrv.outputs.new}}]"
branch: ${{ github.head_ref }}
commit_user_name: tinted-theming-bot
commit_user_email: [email protected]
commit_author: tinted-theming-bot <[email protected]>