@@ -15,35 +15,7 @@ defaults:
15
15
shell : bash
16
16
17
17
jobs :
18
- changelog :
19
- runs-on : ubuntu-latest
20
-
21
- steps :
22
- - name : Checkout
23
- uses : actions/checkout@v4
24
- with :
25
- ref : ${{ github.ref }}
26
-
27
- # Run
28
- - name : Check Changelog
29
- run : |
30
- MESSAGE=$(git log --format=%B -n 1)
31
- PR=$(echo "$MESSAGE" | grep -o "#[0-9]*" | head -1 | sed -e 's/^#//')
32
- body=$(curl -H "Authorization: token ${{ secrets.GITHUB_TOKEN }}" -s "https://api.github.com/repos/rust-lang/rust-clippy/pulls/$PR" | \
33
- python -c "import sys, json; print(json.load(sys.stdin)['body'])")
34
- output=$(grep "^changelog:\s*\S" <<< "$body" | sed "s/changelog:\s*//g") || {
35
- echo "ERROR: PR body must contain 'changelog: ...'"
36
- exit 1
37
- }
38
- if [[ "$output" = "none" ]]; then
39
- echo "WARNING: changelog is 'none'"
40
- else
41
- echo "changelog: $output"
42
- fi
43
- env :
44
- PYTHONIOENCODING : ' utf-8'
45
18
base :
46
- needs : changelog
47
19
strategy :
48
20
matrix :
49
21
include :
63
35
# Setup
64
36
- name : Checkout
65
37
uses : actions/checkout@v4
38
+ with :
39
+ persist-credentials : false
66
40
67
41
- name : Install i686 dependencies
68
42
if : matrix.host == 'i686-unknown-linux-gnu'
74
48
- name : Install toolchain
75
49
run : |
76
50
rustup set default-host ${{ matrix.host }}
77
- rustup show active-toolchain
51
+ # Use a way compatible with Rustup pre-1.28.0 and Rustup 1.28.0
52
+ rustup show active-toolchain || rustup toolchain install
78
53
79
54
# Run
80
55
- name : Build
@@ -114,31 +89,37 @@ jobs:
114
89
OS : ${{ runner.os }}
115
90
116
91
metadata_collection :
117
- needs : changelog
118
92
runs-on : ubuntu-latest
119
93
120
94
steps :
121
95
# Setup
122
96
- name : Checkout
123
97
uses : actions/checkout@v4
98
+ with :
99
+ persist-credentials : false
124
100
125
101
- name : Install toolchain
126
- run : rustup show active-toolchain
102
+ run : |
103
+ # Use a way compatible with Rustup pre-1.28.0 and Rustup 1.28.0
104
+ rustup show active-toolchain || rustup toolchain install
127
105
128
106
- name : Test metadata collection
129
107
run : cargo collect-metadata
130
108
131
109
integration_build :
132
- needs : changelog
133
110
runs-on : ubuntu-latest
134
111
135
112
steps :
136
113
# Setup
137
114
- name : Checkout
138
115
uses : actions/checkout@v4
116
+ with :
117
+ persist-credentials : false
139
118
140
119
- name : Install toolchain
141
- run : rustup show active-toolchain
120
+ run : |
121
+ # Use a way compatible with Rustup pre-1.28.0 and Rustup 1.28.0
122
+ rustup show active-toolchain || rustup toolchain install
142
123
143
124
# Run
144
125
- name : Build Integration Test
@@ -188,9 +169,13 @@ jobs:
188
169
# Setup
189
170
- name : Checkout
190
171
uses : actions/checkout@v4
172
+ with :
173
+ persist-credentials : false
191
174
192
175
- name : Install toolchain
193
- run : rustup show active-toolchain
176
+ run : |
177
+ # Use a way compatible with Rustup pre-1.28.0 and Rustup 1.28.0
178
+ rustup show active-toolchain || rustup toolchain install
194
179
195
180
# Download
196
181
- name : Download target dir
@@ -205,13 +190,13 @@ jobs:
205
190
# Run
206
191
- name : Test ${{ matrix.integration }}
207
192
run : |
208
- TOOLCHAIN=$(rustup show active-toolchain | cut -f1 -d' ')
193
+ TOOLCHAIN=$(rustup show active-toolchain | head -n 1 | cut -f1 -d' ')
209
194
rustup run $TOOLCHAIN $CARGO_TARGET_DIR/debug/integration --show-output
210
195
env :
211
196
INTEGRATION : ${{ matrix.integration }}
212
197
213
198
conclusion :
214
- needs : [ changelog, base, metadata_collection, integration_build, integration ]
199
+ needs : [ base, metadata_collection, integration_build, integration ]
215
200
# We need to ensure this job does *not* get skipped if its dependencies fail,
216
201
# because a skipped job is considered a success by GitHub. So we have to
217
202
# overwrite `if:`. We use `!cancelled()` to ensure the job does still not get run
0 commit comments