Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Fix mdbook and add format check #43

Merged
merged 1 commit into from
Oct 10, 2023
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
32 changes: 27 additions & 5 deletions .github/workflows/deploy_mdbook.yml
Original file line number Diff line number Diff line change
@@ -1,14 +1,36 @@
name: Deploy Book
on:
pull_request:
push:
branches:
- main

jobs:
ci:
name: CI
build-book:
name: Build Book
runs-on: ubuntu-latest
permissions:
contents: write
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
Loading