Skip to content

Commit fd9ce75

Browse files
celinvaloli-obk
authored andcommitted
Fix mdbook and add format check
1 parent 8b4868e commit fd9ce75

File tree

4 files changed

+54
-13
lines changed

4 files changed

+54
-13
lines changed

.github/workflows/deploy_mdbook.yml

Lines changed: 27 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -1,14 +1,36 @@
1+
name: Deploy Book
12
on:
3+
pull_request:
24
push:
35
branches:
46
- main
57

68
jobs:
7-
ci:
8-
name: CI
9+
build-book:
10+
name: Build Book
911
runs-on: ubuntu-latest
12+
permissions:
13+
contents: write
1014
steps:
11-
- uses: actions/checkout@v3
12-
- uses: XAMPPRocky/deploy-mdbook@v1
15+
- name: Checkout
16+
uses: actions/checkout@v3
17+
18+
- name: Install mdbook
19+
run: cargo install mdbook --version "^0.4" --locked
20+
21+
- name: Run mdbook
22+
run: mdbook build
23+
24+
- name: Upload book
25+
uses: actions/upload-pages-artifact@v2
26+
with:
27+
path: book/
28+
retention-days: "3"
29+
30+
- name: Deploy Book
31+
uses: JamesIves/github-pages-deploy-action@v4
32+
if: ${{ github.event_name == 'push' && startsWith('refs/heads/main', github.ref) }}
1333
with:
14-
token: ${{ secrets.GITHUB_TOKEN }}
34+
branch: gh-pages
35+
folder: book/
36+
single-commit: true

.github/workflows/format.yml

Lines changed: 17 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,17 @@
1+
# Run a job to ensure formatting is OK
2+
name: Format Check
3+
on:
4+
pull_request:
5+
push:
6+
branches:
7+
- main
8+
9+
jobs:
10+
format-check:
11+
runs-on: ubuntu-latest
12+
steps:
13+
- name: Checkout
14+
uses: actions/checkout@v3
15+
16+
- name: Run Rust Format
17+
run: cargo fmt --check

tools/compiletest/src/args.rs

Lines changed: 1 addition & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -56,8 +56,7 @@ impl From<Mode> for ui_test::Mode {
5656
match mode {
5757
Mode::Pass | Mode::CargoPass => ui_test::Mode::Pass,
5858
Mode::Run => ui_test::Mode::Run { exit_code: 0 },
59-
Mode::FixMe |
60-
Mode::Fail => ui_test::Mode::Fail {
59+
Mode::FixMe | Mode::Fail => ui_test::Mode::Fail {
6160
require_patterns: false,
6261
rustfix: RustfixMode::Disabled,
6362
},

tools/test-drive/src/main.rs

Lines changed: 9 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -38,13 +38,16 @@ type TestResult = Result<(), String>;
3838
/// `cargo rustc --check-smir`.
3939
fn main() -> ExitCode {
4040
let args = std::env::args();
41-
let (smir_args, rustc_args) : (Vec<String>, _) = args.partition
42-
(|arg| arg
43-
.starts_with
44-
("--smir"));
41+
let (smir_args, rustc_args): (Vec<String>, _) = args.partition(|arg| arg.starts_with("--smir"));
4542
let callback = if smir_args.contains(&CHECK_ARG.to_string()) {
46-
VERBOSE.store(smir_args.contains(&VERBOSE_ARG.to_string()), Ordering::Relaxed);
47-
FIXME_CHECKS.store(smir_args.contains(&FIXME_ARG.to_string()), Ordering::Relaxed);
43+
VERBOSE.store(
44+
smir_args.contains(&VERBOSE_ARG.to_string()),
45+
Ordering::Relaxed,
46+
);
47+
FIXME_CHECKS.store(
48+
smir_args.contains(&FIXME_ARG.to_string()),
49+
Ordering::Relaxed,
50+
);
4851
test_stable_mir
4952
} else {
5053
|_: TyCtxt| ControlFlow::<()>::Continue(())

0 commit comments

Comments
 (0)