Skip to content

Commit 82feb9c

Browse files
committedJun 5, 2021
Ensure html-checker is run on CI
1 parent c50d9cb commit 82feb9c

File tree

2 files changed

+14
-9
lines changed

2 files changed

+14
-9
lines changed
 

‎src/bootstrap/test.rs

+12-8
Original file line numberDiff line numberDiff line change
@@ -144,6 +144,14 @@ You can skip linkcheck with --exclude src/tools/linkchecker"
144144
}
145145
}
146146

147+
fn check_if_tidy_is_installed() -> bool {
148+
Command::new("tidy")
149+
.arg("--version")
150+
.stdout(Stdio::null())
151+
.status()
152+
.map_or(false, |status| status.success())
153+
}
154+
147155
#[derive(Debug, Copy, Clone, PartialEq, Eq, Hash)]
148156
pub struct HtmlCheck {
149157
target: TargetSelection,
@@ -155,25 +163,21 @@ impl Step for HtmlCheck {
155163
const ONLY_HOSTS: bool = true;
156164

157165
fn should_run(run: ShouldRun<'_>) -> ShouldRun<'_> {
158-
run.path("src/tools/html-checker")
166+
let run = run.path("src/tools/html-checker");
167+
run.default_condition(check_if_tidy_is_installed())
159168
}
160169

161170
fn make_run(run: RunConfig<'_>) {
162171
run.builder.ensure(HtmlCheck { target: run.target });
163172
}
164173

165174
fn run(self, builder: &Builder<'_>) {
166-
if !Command::new("tidy")
167-
.arg("--version")
168-
.stdout(Stdio::null())
169-
.status()
170-
.map_or(false, |status| status.success())
171-
{
175+
if !check_if_tidy_is_installed() {
172176
eprintln!("not running HTML-check tool because `tidy` is missing");
173177
eprintln!(
174178
"Note that `tidy` is not the in-tree `src/tools/tidy` but needs to be installed"
175179
);
176-
return;
180+
panic!("Cannot run html-check tests");
177181
}
178182
// Ensure that a few different kinds of documentation are available.
179183
builder.default_doc(&[]);

‎src/ci/docker/host-x86_64/x86_64-gnu-tools/Dockerfile

+2-1
Original file line numberDiff line numberDiff line change
@@ -12,7 +12,8 @@ RUN apt-get update && apt-get install -y --no-install-recommends \
1212
cmake \
1313
libssl-dev \
1414
sudo \
15-
xz-utils
15+
xz-utils \
16+
tidy
1617

1718
# Install dependencies for chromium browser
1819
RUN apt-get install -y \

0 commit comments

Comments
 (0)
Please sign in to comment.