@@ -17,8 +17,11 @@ permissions: read-all
17
17
18
18
jobs :
19
19
roll :
20
- name : Roll pinned toolchain versions
21
20
runs-on : ubuntu-latest
21
+ strategy :
22
+ matrix :
23
+ toolchain : ["stable", "nightly"]
24
+ name : Roll pinned toolchain ${{ matrix.toolchain }} version
22
25
steps :
23
26
- name : Checkout code
24
27
uses : actions/checkout@8ade135a41bc03ea155e62e844d188df1ea18608 # v4.1.0
@@ -30,17 +33,20 @@ jobs:
30
33
# date has actually been published yet. This allows us to not worry
31
34
# about what time of day this job runs.
32
35
run : echo "ZC_TARGET_NIGHTLY=nightly-$(date -d '-1 day' +%Y-%m-%d)" >> $GITHUB_ENV
36
+ if : matrix.toolchain == 'nightly'
33
37
- name : Install Rust with ${{ env.ZC_TARGET_NIGHTLY }} toolchain
34
38
uses : dtolnay/rust-toolchain@00b49be78f40fba4e87296b2ead62868750bdd83 # stable
35
39
with :
36
40
toolchain : ${{ env.ZC_TARGET_NIGHTLY }}
41
+ if : matrix.toolchain == 'nightly'
37
42
# Install whatever the latest stable release is. This has the side
38
43
# effect of determining the latest stable release so that we can update
39
44
# `Cargo.toml`.
40
45
- name : Install Rust with stable toolchain
41
46
uses : dtolnay/rust-toolchain@00b49be78f40fba4e87296b2ead62868750bdd83 # stable
42
47
with :
43
48
toolchain : stable
49
+ if : matrix.toolchain == 'stable'
44
50
- name : Update files
45
51
run : |
46
52
set -eo pipefail
@@ -74,20 +80,24 @@ jobs:
74
80
TRYBUILD=overwrite cargo "+$VERSION_FOR_CARGO" test --package zerocopy-derive
75
81
}
76
82
77
- STABLE_VERSION="$(cargo +stable version | sed -e 's/^cargo \([0-9\.]*\) .*/\1/')"
78
- update-pinned-version stable "$ STABLE_VERSION" stable '--features __internal_use_only_features_that_work_on_stable'
79
- update-pinned-version nightly "$ZC_TARGET_NIGHTLY" "$ZC_TARGET_NIGHTLY" --all- features
83
+ if [ "${{ matrix.toolchain }}" == stable ]; then
84
+ STABLE_VERSION="$(cargo + stable version | sed -e 's/^cargo \([0-9\.]*\) .*/\1/')"
85
+ update-pinned-version stable "$STABLE_VERSION" stable '-- features __internal_use_only_features_that_work_on_stable'
80
86
81
- # Used as part of the branch name created by the "Submit PR" step.
82
- echo "ZC_TARGET_STABLE=$STABLE_VERSION" >> $GITHUB_ENV
87
+ # Used as part of the branch name created by the "Submit PR" step.
88
+ echo "ZC_VERSION_FOR_BRANCH_NAME=$STABLE_VERSION" >> $GITHUB_ENV
89
+ else
90
+ update-pinned-version nightly "$ZC_TARGET_NIGHTLY" "$ZC_TARGET_NIGHTLY" --all-features
91
+ echo "ZC_VERSION_FOR_BRANCH_NAME=$ZC_TARGET_NIGHTLY" >> $GITHUB_ENV
92
+ fi
83
93
84
94
- name : Submit PR
85
95
uses : peter-evans/create-pull-request@153407881ec5c347639a548ade7d8ad1d6740e38 # v5.0.2
86
96
with :
87
- commit-message : " [ci] Roll pinned toolchains "
97
+ commit-message : " [ci] Roll pinned ${{ matrix.toolchain }} toolchain "
88
98
author : Google PR Creation Bot <github-pull-request-creation-bot@google.com>
89
99
committer : Google PR Creation Bot <github-pull-request-creation-bot@google.com>
90
- title : " [ci] Roll pinned toolchains "
91
- branch : roll-pinned-toolchain-to- ${{ env.ZC_TARGET_STABLE }}-and- ${{ env.ZC_TARGET_NIGHTLY }}
100
+ title : " [ci] Roll pinned ${{ matrix.toolchain }} toolchain "
101
+ branch : roll-pinned-${{ matrix.toolchain }}-toolchain-to- ${{ env.ZC_VERSION_FOR_BRANCH_NAME }}
92
102
push-to-fork : google-pr-creation-bot/zerocopy
93
103
token : ${{ secrets.GOOGLE_PR_CREATION_BOT_TOKEN }}
0 commit comments