Skip to content

Commit

Permalink
Fix mdbook and add format check
Browse files Browse the repository at this point in the history
  • Loading branch information
celinval committed Oct 6, 2023
1 parent f0f892f commit 5dec4c4
Show file tree
Hide file tree
Showing 4 changed files with 52 additions and 13 deletions.
30 changes: 25 additions & 5 deletions .github/workflows/deploy_mdbook.yml
Original file line number Diff line number Diff line change
@@ -1,14 +1,34 @@
name: Deploy Book
on:
pull_request:
push:
branches:
- main

jobs:
ci:
name: CI
build-book:
name: Build Book
runs-on: ubuntu-latest
steps:
- uses: actions/checkout@v3
- uses: XAMPPRocky/deploy-mdbook@v1
- name: Checkout
uses: actions/checkout@v3

- name: Install mdbook
run: cargo install mdbook --version "^0.4" --locked

- name: Run mdbook
run: mdbook build

- name: Upload book
uses: actions/upload-pages-artifact@v2
with:
path: book/
retention-days: "3"

- name: Deploy Book
uses: JamesIves/github-pages-deploy-action@v4
if: ${{ github.event_name == 'push' && startsWith('refs/heads/main', github.ref) }}
with:
token: ${{ secrets.GITHUB_TOKEN }}
branch: gh-pages
folder: book/
single-commit: true
17 changes: 17 additions & 0 deletions .github/workflows/format.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,17 @@
# Run a job to ensure formatting is OK
name: Format Check
on:
pull_request:
push:
branches:
- main

jobs:
format-check:
runs-on: ubuntu-latest
steps:
- name: Checkout
uses: actions/checkout@v3

- name: Run Rust Format
run: cargo fmt --check
3 changes: 1 addition & 2 deletions tools/compiletest/src/args.rs
Original file line number Diff line number Diff line change
Expand Up @@ -56,8 +56,7 @@ impl From<Mode> for ui_test::Mode {
match mode {
Mode::Pass | Mode::CargoPass => ui_test::Mode::Pass,
Mode::Run => ui_test::Mode::Run { exit_code: 0 },
Mode::FixMe |
Mode::Fail => ui_test::Mode::Fail {
Mode::FixMe | Mode::Fail => ui_test::Mode::Fail {
require_patterns: false,
rustfix: RustfixMode::Disabled,
},
Expand Down
15 changes: 9 additions & 6 deletions tools/test-drive/src/main.rs
Original file line number Diff line number Diff line change
Expand Up @@ -37,13 +37,16 @@ type TestResult = Result<(), String>;
/// `cargo rustc --check-smir`.
fn main() -> ExitCode {
let args = std::env::args();
let (smir_args, rustc_args) : (Vec<String>, _) = args.partition
(|arg| arg
.starts_with
("--smir"));
let (smir_args, rustc_args): (Vec<String>, _) = args.partition(|arg| arg.starts_with("--smir"));
let callback = if smir_args.contains(&CHECK_ARG.to_string()) {
VERBOSE.store(smir_args.contains(&VERBOSE_ARG.to_string()), Ordering::Relaxed);
FIXME_CHECKS.store(smir_args.contains(&FIXME_ARG.to_string()), Ordering::Relaxed);
VERBOSE.store(
smir_args.contains(&VERBOSE_ARG.to_string()),
Ordering::Relaxed,
);
FIXME_CHECKS.store(
smir_args.contains(&FIXME_ARG.to_string()),
Ordering::Relaxed,
);
test_stable_mir
} else {
|_: TyCtxt| ControlFlow::<()>::Continue(())
Expand Down

0 comments on commit 5dec4c4

Please sign in to comment.