From 739d52e55e0e6067e2d2b7bd61a15cc50d411346 Mon Sep 17 00:00:00 2001 From: AmeKnite <104745335+ameknite@users.noreply.github.com> Date: Sun, 31 Mar 2024 14:59:31 -0600 Subject: [PATCH] use nightly flag --- .github/workflows/ci.yml | 2 +- .github/workflows/docs.yml | 2 +- tools/ci/src/main.rs | 17 ++++++++++++----- 3 files changed, 14 insertions(+), 7 deletions(-) diff --git a/.github/workflows/ci.yml b/.github/workflows/ci.yml index bbcf4913bef3d..2d27e60ef8458 100644 --- a/.github/workflows/ci.yml +++ b/.github/workflows/ci.yml @@ -290,7 +290,7 @@ jobs: run: sudo apt-get update; sudo apt-get install --no-install-recommends libasound2-dev libudev-dev libwayland-dev libxkbcommon-dev - name: Build and check doc # See tools/ci/src/main.rs for the commands this runs - run: cargo run -p ci -- doc-check --deploy-docs + run: cargo run -p ci -- doc-check --nightly env: CARGO_INCREMENTAL: 0 RUSTFLAGS: "-C debuginfo=0" diff --git a/.github/workflows/docs.yml b/.github/workflows/docs.yml index 5264f32bdca67..2400f8376d61e 100644 --- a/.github/workflows/docs.yml +++ b/.github/workflows/docs.yml @@ -49,7 +49,7 @@ jobs: echo "" > header.html - name: Build docs - run: cargo run -p ci -- doc-check --deploy-docs + run: cargo run -p ci -- doc-check --nightly --deploy-docs # This adds the following: # - A top level redirect to the bevy crate documentation diff --git a/tools/ci/src/main.rs b/tools/ci/src/main.rs index c297c121ca43e..dcfdafe95357c 100644 --- a/tools/ci/src/main.rs +++ b/tools/ci/src/main.rs @@ -24,8 +24,9 @@ bitflags! { bitflags! { #[derive(Clone, Copy, Debug, PartialEq, Eq)] struct Flag: u32 { - const KEEP_GOING = 0b00000001; - const DEPLOY_DOCS = 0b00000010; + const NIGHTLY = 0b00000001; + const KEEP_GOING = 0b00000010; + const DEPLOY_DOCS = 0b00000100; } } @@ -70,6 +71,7 @@ fn main() { ]; let flag_arguments = [ + ("--nightly", Flag::KEEP_GOING), ("--keep-going", Flag::KEEP_GOING), ("--deploy-docs", Flag::DEPLOY_DOCS), ]; @@ -229,14 +231,19 @@ fn main() { let mut rust_doc_flags = "-D warnings"; let mut docs_type = vec!["doc"]; - if flags.contains(Flag::DEPLOY_DOCS) { - // Nightly + if flags.contains(Flag::NIGHTLY) { docs_type.insert(0, "+nightly"); rust_doc_flags = "-D warnings -Zunstable-options --cfg=docsrs"; args.push("-Zunstable-options"); args.push("-Zrustdoc-scrape-examples"); } + if flags.contains(Flag::DEPLOY_DOCS) { + args.remove(args.iter().position(|&arg| arg == "--workspace").unwrap()); + args.push("-p"); + args.push("bevy"); + } + if flags.contains(Flag::KEEP_GOING) { args.push("--keep-going"); } @@ -306,7 +313,7 @@ fn main() { ); } - if checks.contains(Check::CFG_CHECK) { + if checks.contains(Check::CFG_CHECK) && flags.contains(Flag::NIGHTLY) { // Check cfg and imports let mut args = vec!["-Zcheck-cfg", "--workspace"]; if flags.contains(Flag::KEEP_GOING) {