Skip to content

Commit 1e3629a

Browse files
authored
Merge pull request #893 from Kobzol/blacksmith-cache
Make blacksmith optional
2 parents 944ed47 + dd8d532 commit 1e3629a

File tree

4 files changed

+16
-1
lines changed

4 files changed

+16
-1
lines changed

.github/workflows/deploy.yml

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -10,6 +10,7 @@ jobs:
1010
build:
1111
env:
1212
MDBOOK_VERSION: 0.4.51
13+
RUN_BLACKSMITH: 1
1314
runs-on: ubuntu-latest
1415
steps:
1516
- uses: actions/checkout@v4

.github/workflows/test.yml

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -8,6 +8,7 @@ jobs:
88
runs-on: ubuntu-latest
99
env:
1010
MDBOOK_VERSION: 0.4.51
11+
RUN_BLACKSMITH: 1
1112
steps:
1213
- uses: actions/checkout@v4
1314
- name: Install mdbook

README.md

Lines changed: 8 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -30,6 +30,14 @@ On CI, we automatically check if all intra-doc links in the Forge Markdown files
3030
perform this check locally, install `mdbook-linkcheck` using `cargo install [email protected] --locked` and then
3131
simply run `mdbook build` or `mdbook serve`.
3232

33+
## Blacksmith
34+
35+
Blacksmith is a tool that can run before the Forge is built. It downloads information about Rust releases, which is used
36+
to render a page with historical Rust releases.
37+
38+
Since it takes a while to compile and run, it is disabled by default. To enable it, run `mdbook serve` or `mdbook build`
39+
with the environment variable `RUN_BLACKSMITH=1`.
40+
3341
## JavaScript
3442

3543
Forge uses JavaScript to display dates for releases and "no tools breakage

build.bash

Lines changed: 6 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -4,4 +4,9 @@ set -euo pipefail
44
CARGO_TARGET_DIR=${CARGO_TARGET_DIR:-"$PWD"/target}
55
export CARGO_TARGET_DIR
66

7-
cargo run --locked --manifest-path=blacksmith/Cargo.toml -- "$@"
7+
if [ "${RUN_BLACKSMITH:-0}" = "1" ]; then
8+
cargo run --locked --manifest-path=blacksmith/Cargo.toml -- "$@"
9+
else
10+
# This actually tells mdbook that we don't support the given renderer
11+
exit 1
12+
fi

0 commit comments

Comments
 (0)