diff --git a/.github/workflows/deploy_mdbook.yml b/.github/workflows/deploy_mdbook.yml index 48f2515..235ff91 100644 --- a/.github/workflows/deploy_mdbook.yml +++ b/.github/workflows/deploy_mdbook.yml @@ -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 diff --git a/.github/workflows/format.yml b/.github/workflows/format.yml new file mode 100644 index 0000000..aa42e1c --- /dev/null +++ b/.github/workflows/format.yml @@ -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 diff --git a/tools/compiletest/src/args.rs b/tools/compiletest/src/args.rs index 29a044c..1335858 100644 --- a/tools/compiletest/src/args.rs +++ b/tools/compiletest/src/args.rs @@ -56,8 +56,7 @@ impl From 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, }, diff --git a/tools/test-drive/src/main.rs b/tools/test-drive/src/main.rs index 8aaf936..614730e 100644 --- a/tools/test-drive/src/main.rs +++ b/tools/test-drive/src/main.rs @@ -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, _) = args.partition - (|arg| arg - .starts_with - ("--smir")); + let (smir_args, rustc_args): (Vec, _) = 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(())