From 5b8fed8fd8b24a67e14041aa6744c660bf34bee9 Mon Sep 17 00:00:00 2001 From: Eric Huss Date: Thu, 20 Feb 2020 17:39:30 -0800 Subject: [PATCH] Use common script for link checking. --- .github/workflows/main.yml | 7 +++++-- tests/linkcheck.sh | 28 ---------------------------- 2 files changed, 5 insertions(+), 30 deletions(-) delete mode 100755 tests/linkcheck.sh diff --git a/.github/workflows/main.yml b/.github/workflows/main.yml index dca743a23..086b907ae 100644 --- a/.github/workflows/main.yml +++ b/.github/workflows/main.yml @@ -17,7 +17,7 @@ jobs: - name: Install mdbook run: | mkdir bin - curl -sSL https://github.com/rust-lang/mdBook/releases/download/v0.3.4/mdbook-v0.3.4-x86_64-unknown-linux-gnu.tar.gz | tar -xz --directory=bin + curl -sSL https://github.com/rust-lang/mdBook/releases/download/v0.3.5/mdbook-v0.3.5-x86_64-unknown-linux-gnu.tar.gz | tar -xz --directory=bin echo "##[add-path]$(pwd)/bin" - name: Report versions run: | @@ -29,4 +29,7 @@ jobs: - name: Check for unstable features run: (cd stable-check && cargo run -- ../src) - name: Check for broken links - run: tests/linkcheck.sh + run: | + curl -sSLo linkcheck.sh \ + https://raw.githubusercontent.com/rust-lang/rust/master/src/tools/linkchecker/linkcheck.sh + sh linkcheck.sh --all reference diff --git a/tests/linkcheck.sh b/tests/linkcheck.sh deleted file mode 100755 index 59cab4a5d..000000000 --- a/tests/linkcheck.sh +++ /dev/null @@ -1,28 +0,0 @@ -#!/bin/sh - -set -e - -if [ ! -f book.toml ] -then - echo "Run command in root directory with book.toml" - exit 1 -fi - -rm -rf tests/linkcheck tests/linkchecker - -mkdir tests/linkchecker -curl -o tests/linkchecker/Cargo.toml \ - https://raw.githubusercontent.com/rust-lang/rust/master/src/tools/linkchecker/Cargo.toml -curl -o tests/linkchecker/main.rs \ - https://raw.githubusercontent.com/rust-lang/rust/master/src/tools/linkchecker/main.rs - -mdbook build - -cp -R $(rustc --print sysroot)/share/doc/rust/html tests/linkcheck -rm -rf tests/linkcheck/reference -cp -R book tests/linkcheck/reference - -cargo run --manifest-path=tests/linkchecker/Cargo.toml -- tests/linkcheck/reference - -rm -rf tests/linkcheck tests/linkchecker -echo "Linkcheck completed successfully!"