77 runs-on : ubuntu-latest
88 steps :
99 - uses : actions/checkout@master
10+ with :
11+ submodules : true
1012 - name : Update rustup
1113 run : rustup self update
1214 - name : Install Rust
@@ -32,16 +34,18 @@ jobs:
3234 # sure all the crates can be resolved when running the tests.
3335 - name : Build `trpl` crate
3436 run : |
35- cd packages/trpl
37+ cd mdbook-check/ packages/trpl
3638 cargo build
3739 - name : Run tests
3840 run :
39- mdbook test --library-path packages/trpl/target/debug/deps
41+ mdbook test --library-path mdbook-check/ packages/trpl/target/debug/deps
4042 package_tests :
4143 name : Run package tests
4244 runs-on : ubuntu-latest
4345 steps :
4446 - uses : actions/checkout@master
47+ with :
48+ submodules : true
4549 - name : Update rustup
4650 run : rustup self update
4751 - name : Install Rust
@@ -53,14 +57,21 @@ jobs:
5357 run : |
5458 cargo test
5559 - name : Run `mdbook-trpl` package tests
56- working-directory : packages/mdbook-trpl
60+ working-directory : mdbook-check/ packages/mdbook-trpl
5761 run : |
5862 cargo test
5963 lint :
6064 name : Run lints
6165 runs-on : ubuntu-latest
6266 steps :
6367 - uses : actions/checkout@master
68+ with :
69+ submodules : recursive
70+ fetch-depth : 0
71+ - name : Force fetch submodules
72+ run : |
73+ git submodule update --init
74+ git submodule foreach --recursive git submodule update --init
6475 - name : Update rustup
6576 run : rustup self update
6677 - name : Install Rust
7485 curl -sSL https://github.com/rust-lang/mdBook/releases/download/v0.4.45/mdbook-v0.4.45-x86_64-unknown-linux-gnu.tar.gz | tar -xz --directory=bin
7586 echo "$(pwd)/bin" >> "${GITHUB_PATH}"
7687 - name : Install mdbook-trpl binaries
77- run : cargo install --path packages/mdbook-trpl
88+ run : cargo install --path mdbook-check/ packages/mdbook-trpl
7889 - name : Install aspell
7990 run : sudo apt-get install aspell
8091 - name : Install shellcheck
@@ -87,18 +98,33 @@ jobs:
8798 aspell --version
8899 shellcheck --version
89100 - name : Shellcheck
90- run : find . -name '*.sh' -print0 | xargs -0 shellcheck
101+ run : |
102+ exclude_dirs=(
103+ "*/packages/autocorrect/**"
104+ "*/src/fuzz/books/codes/.venv/**"
105+ "*/book/**"
106+ )
107+
108+ find_args=()
109+
110+ for pattern in "${exclude_dirs[@]}"; do
111+ find_args+=(-not -path "$pattern")
112+ done
113+
114+ find . -name "*.sh" -type f "${find_args[@]}" -exec shellcheck {} +
91115 - name : Spellcheck
92- run : bash ci/spellcheck.sh list
116+ run : bash mdbook-check/ ci/spellcheck.sh list
93117 - name : Lint for local file paths
94118 run : |
95119 mdbook build
96120 cargo run --bin lfp src
97121 - name : Validate references
98- run : bash ci/validate.sh
122+ run : bash mdbook-check/ ci/validate.sh
99123 - name : Check for broken links
100124 run : |
101125 curl -sSLo linkcheck.sh \
102126 https://raw.githubusercontent.com/rust-lang/rust/HEAD/src/tools/linkchecker/linkcheck.sh
103127 # Cannot use --all here because of the generated redirect pages aren't available.
104128 sh linkcheck.sh book
129+ - name : Check Markdown Lint
130+ run : make check-lint
0 commit comments