Skip to content

Commit 19859b0

Browse files
committed
Try to merge (it's been a while)
2 parents c209369 + fff6087 commit 19859b0

File tree

573 files changed

+18956
-20400
lines changed

Some content is hidden

Large Commits have some content hidden by default. Use the searchbox below for content that may be hidden.

573 files changed

+18956
-20400
lines changed

.cargo/config.toml

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,2 @@
1+
[alias]
2+
xtask = "run --manifest-path=crates/xtask/Cargo.toml --"

.git-blame-ignore-revs

Lines changed: 26 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,26 @@
1+
# Use `git config blame.ignorerevsfile .git-blame-ignore-revs` to make `git blame` ignore the following commits.
2+
3+
# rustfmt
4+
ad0794a0bd692e4f2ff23b85e361889620e93f51
5+
# rustfmt and use_try_shorthand
6+
75bbd55128083897d40c3f5265cc5b1f10314ddb
7+
# rustfmt
8+
382fc4139b96bde3c4b8875b499c720eabc89c6a
9+
# rustfmt
10+
154e0fb3080c6ffc225b0d47b5d835e589789892
11+
# rustfmt
12+
5835da243244bfc5c95c6c6db96f453da4bb5740
13+
# rustfmt
14+
fd9d27e082f5e9eea50e4fa9fa3a22060d02c66b
15+
# rustfmt
16+
1d69ccae4854f13552d452d0bffef95cbff70364
17+
# rustfmt
18+
3688f73052454bf510a5acc85cf55aae450c6e46
19+
# rustfmt
20+
742dbbc91700dce1b7d910bca6b3e10a5ae46b86
21+
# rustfmt 1.38
22+
b88839cc25a6fd1c782101e94318959e8079bb20
23+
# rustfmt 1.40
24+
2f59943c04f0aa204a9238d6a699ba9cc06c88d9
25+
# Rustfmt for 2024
26+
c7b67e363bb9ce3383636ee615e8e761bf185b33

.gitattributes

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -6,3 +6,5 @@
66
*.ttf binary
77
*.otf binary
88
*.png binary
9+
*.eot binary
10+
*.woff2 binary

.github/renovate.json5

Lines changed: 71 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,71 @@
1+
{
2+
schedule: ['before 5am on the first day of the month'],
3+
// Raise from default of 2 to reduce trickle.
4+
prHourlyLimit: 6,
5+
dependencyDashboard: true,
6+
// Creates PRs if this renovate config file needs updating.
7+
configMigration: true,
8+
ignorePaths: [
9+
'guide/src/for_developers/mdbook-wordcount/',
10+
],
11+
customManagers: [
12+
// Custom manager to extract the version of cargo-semver-checks from the workflow.
13+
{
14+
customType: 'regex',
15+
managerFilePatterns: [
16+
'/^.github.workflows.main.yml$/',
17+
],
18+
matchStrings: [
19+
'cargo-semver-checks.releases.download.v(?<currentValue>\\d+\\.\\d+(\\.\\d+)?)',
20+
],
21+
depNameTemplate: 'cargo-semver-checks',
22+
packageNameTemplate: 'obi1kenobi/cargo-semver-checks',
23+
datasourceTemplate: 'github-releases',
24+
},
25+
],
26+
packageRules: [
27+
// The next two rules disable compatible dependency updates. I wasn't
28+
// able to get Renovate to be able to update Cargo.toml for compatible
29+
// updates only, update all transitive dependencies, and do that all
30+
// in a single PR. Instead, the `update-dependencies.sh` will handle
31+
// that.
32+
{
33+
matchManagers: ['cargo'],
34+
matchUpdateTypes: ['patch'],
35+
enabled: false,
36+
},
37+
{
38+
matchManagers: ['cargo'],
39+
matchCurrentVersion: '>=1.0.0',
40+
matchUpdateTypes: ['minor'],
41+
enabled: false,
42+
},
43+
// Allow minor updates for pre-1.0 dependencies (semver-breaking)
44+
{
45+
matchManagers: ['cargo'],
46+
matchCurrentVersion: '<1.0.0',
47+
matchUpdateTypes: ['minor'],
48+
},
49+
// Allow major updates for stable dependencies (semver-breaking)
50+
{
51+
matchManagers: ['cargo'],
52+
matchCurrentVersion: '>=1.0.0',
53+
matchUpdateTypes: ['major'],
54+
},
55+
// Update cargo-semver-checks when a new version is available.
56+
{
57+
commitMessageTopic: 'cargo-semver-checks',
58+
matchManagers: [
59+
'custom.regex',
60+
],
61+
matchDepNames: [
62+
'cargo-semver-checks',
63+
],
64+
extractVersion: '^v(?<version>\\d+\\.\\d+\\.\\d+)',
65+
schedule: [
66+
'* * * * *',
67+
],
68+
internalChecksFilter: 'strict',
69+
},
70+
]
71+
}

.github/workflows/deploy.yml

Lines changed: 16 additions & 18 deletions
Original file line numberDiff line numberDiff line change
@@ -17,11 +17,11 @@ jobs:
1717
matrix:
1818
include:
1919
- target: aarch64-unknown-linux-musl
20-
os: ubuntu-20.04
20+
os: ubuntu-22.04
2121
- target: x86_64-unknown-linux-gnu
22-
os: ubuntu-20.04
22+
os: ubuntu-22.04
2323
- target: x86_64-unknown-linux-musl
24-
os: ubuntu-20.04
24+
os: ubuntu-22.04
2525
- target: x86_64-apple-darwin
2626
os: macos-latest
2727
- target: aarch64-apple-darwin
@@ -30,7 +30,7 @@ jobs:
3030
os: windows-latest
3131
name: Deploy ${{ matrix.target }}
3232
steps:
33-
- uses: actions/checkout@v4
33+
- uses: actions/checkout@v5
3434
- name: Install Rust
3535
run: ci/install-rust.sh stable ${{ matrix.target }}
3636
- name: Build asset
@@ -43,27 +43,25 @@ jobs:
4343
name: GitHub Pages
4444
runs-on: ubuntu-latest
4545
steps:
46-
- uses: actions/checkout@v4
46+
- uses: actions/checkout@v5
4747
- name: Install Rust (rustup)
4848
run: rustup update stable --no-self-update && rustup default stable
49-
- name: Build book
50-
run: cargo run -- build guide
51-
- name: Deploy to GitHub
52-
env:
53-
GITHUB_DEPLOY_KEY: ${{ secrets.GITHUB_DEPLOY_KEY }}
54-
run: |
55-
touch guide/book/.nojekyll
56-
curl -LsSf https://raw.githubusercontent.com/rust-lang/simpleinfra/master/setup-deploy-keys/src/deploy.rs | rustc - -o /tmp/deploy
57-
cd guide/book
58-
/tmp/deploy
49+
- name: Deploy the User Guide to GitHub Pages using the gh-pages branch
50+
run: ci/publish-guide.sh
5951
publish:
6052
name: Publish to crates.io
6153
runs-on: ubuntu-latest
54+
permissions:
55+
# Required for OIDC token exchange
56+
id-token: write
6257
steps:
63-
- uses: actions/checkout@v4
58+
- uses: actions/checkout@v5
6459
- name: Install Rust (rustup)
6560
run: rustup update stable --no-self-update && rustup default stable
61+
- name: Authenticate with crates.io
62+
id: auth
63+
uses: rust-lang/crates-io-auth-action@v1
6664
- name: Publish
6765
env:
68-
CARGO_REGISTRY_TOKEN: ${{ secrets.CARGO_REGISTRY_TOKEN }}
69-
run: cargo publish --no-verify
66+
CARGO_REGISTRY_TOKEN: ${{ steps.auth.outputs.token }}
67+
run: cargo publish --workspace --no-verify

.github/workflows/main.yml

Lines changed: 68 additions & 9 deletions
Original file line numberDiff line numberDiff line change
@@ -22,7 +22,7 @@ jobs:
2222
rust: nightly
2323
target: x86_64-unknown-linux-gnu
2424
- name: stable x86_64-unknown-linux-musl
25-
os: ubuntu-20.04
25+
os: ubuntu-22.04
2626
rust: stable
2727
target: x86_64-unknown-linux-musl
2828
- name: stable x86_64 macos
@@ -38,24 +38,24 @@ jobs:
3838
rust: stable
3939
target: x86_64-pc-windows-msvc
4040
- name: msrv
41-
os: ubuntu-20.04
41+
os: ubuntu-22.04
4242
# sync MSRV with docs: guide/src/guide/installation.md and Cargo.toml
43-
rust: 1.74.0
43+
rust: 1.88.0
4444
target: x86_64-unknown-linux-gnu
4545
name: ${{ matrix.name }}
4646
steps:
47-
- uses: actions/checkout@v4
47+
- uses: actions/checkout@v5
4848
- name: Install Rust
4949
run: bash ci/install-rust.sh ${{ matrix.rust }} ${{ matrix.target }}
5050
- name: Build and run tests
51-
run: cargo test --locked --target ${{ matrix.target }}
51+
run: cargo test --workspace --locked --target ${{ matrix.target }}
5252
- name: Test no default
53-
run: cargo test --no-default-features --target ${{ matrix.target }}
53+
run: cargo test --workspace --no-default-features --target ${{ matrix.target }}
5454

5555
aarch64-cross-builds:
56-
runs-on: ubuntu-20.04
56+
runs-on: ubuntu-22.04
5757
steps:
58-
- uses: actions/checkout@v4
58+
- uses: actions/checkout@v5
5959
- name: Install Rust
6060
run: bash ci/install-rust.sh stable aarch64-unknown-linux-musl
6161
- name: Build
@@ -65,11 +65,65 @@ jobs:
6565
name: Rustfmt
6666
runs-on: ubuntu-latest
6767
steps:
68-
- uses: actions/checkout@v4
68+
- uses: actions/checkout@v5
6969
- name: Install Rust
7070
run: rustup update stable && rustup default stable && rustup component add rustfmt
7171
- run: cargo fmt --check
7272

73+
gui:
74+
name: GUI tests
75+
runs-on: ubuntu-latest
76+
steps:
77+
- uses: actions/checkout@v5
78+
- name: Install Rust
79+
run: bash ci/install-rust.sh stable x86_64-unknown-linux-gnu
80+
- name: Install npm
81+
uses: actions/setup-node@v6
82+
with:
83+
node-version: 24
84+
- name: Install browser-ui-test
85+
run: npm install
86+
- name: Run eslint
87+
run: npm run lint
88+
- name: Build and run tests (+ GUI)
89+
run: cargo test --locked --target x86_64-unknown-linux-gnu --test gui
90+
91+
# Ensure there are no clippy warnings
92+
clippy:
93+
runs-on: ubuntu-latest
94+
steps:
95+
- uses: actions/checkout@v5
96+
- name: Install Rust
97+
run: bash ci/install-rust.sh stable x86_64-unknown-linux-gnu
98+
- run: rustup component add clippy
99+
- run: cargo clippy --workspace --all-targets --no-deps -- -D warnings
100+
101+
docs:
102+
name: Check API docs
103+
runs-on: ubuntu-latest
104+
steps:
105+
- uses: actions/checkout@v5
106+
- name: Install Rust
107+
run: bash ci/install-rust.sh stable x86_64-unknown-linux-gnu
108+
- name: Ensure intradoc links are valid
109+
run: cargo doc --workspace --document-private-items --no-deps
110+
env:
111+
RUSTDOCFLAGS: -D warnings
112+
113+
check-version-bump:
114+
name: Check version bump
115+
runs-on: ubuntu-latest
116+
steps:
117+
- uses: actions/checkout@v5
118+
- run: rustup update stable && rustup default stable
119+
- name: Install cargo-semver-checks
120+
run: |
121+
mkdir installed-bins
122+
curl -Lf https://github.com/obi1kenobi/cargo-semver-checks/releases/download/v0.45.0/cargo-semver-checks-x86_64-unknown-linux-gnu.tar.gz \
123+
| tar -xz --directory=./installed-bins
124+
echo `pwd`/installed-bins >> $GITHUB_PATH
125+
- run: cargo semver-checks --workspace
126+
73127
# The success job is here to consolidate the total success/failure state of
74128
# all other jobs. This job is then included in the GitHub branch protection
75129
# rule which prevents merges unless all other jobs are passing. This makes
@@ -81,6 +135,11 @@ jobs:
81135
needs:
82136
- test
83137
- rustfmt
138+
- aarch64-cross-builds
139+
- gui
140+
- clippy
141+
- docs
142+
- check-version-bump
84143
runs-on: ubuntu-latest
85144
steps:
86145
- run: jq --exit-status 'all(.result == "success")' <<< '${{ toJson(needs) }}'
Lines changed: 21 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,21 @@
1+
name: Update dependencies
2+
on:
3+
schedule:
4+
- cron: '0 0 1 * *'
5+
workflow_dispatch:
6+
7+
jobs:
8+
update:
9+
name: Update dependencies
10+
runs-on: ubuntu-latest
11+
if: github.repository == 'rust-lang/mdBook'
12+
steps:
13+
- uses: actions/checkout@v5
14+
- name: Install Rust
15+
run: bash ci/install-rust.sh stable x86_64-unknown-linux-gnu
16+
- name: Install cargo-edit
17+
run: cargo install cargo-edit --locked
18+
- name: Update dependencies
19+
run: ci/update-dependencies.sh
20+
env:
21+
GH_TOKEN: ${{ github.token }}

.gitignore

Lines changed: 7 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -8,11 +8,17 @@ guide/book
88

99
.vscode
1010
tests/dummy_book/book/
11-
test_book/book/
11+
tests/gui/books/*/book/
12+
tests/testsuite/*/*/book/
1213

1314
# Ignore Jetbrains specific files.
1415
.idea/
1516

1617
# Ignore Vim temporary and swap files.
1718
*.sw?
1819
*~
20+
21+
# GUI tests
22+
node_modules
23+
package-lock.json
24+
package.json

0 commit comments

Comments
 (0)