Skip to content

Commit

Permalink
use nightly flag
Browse files Browse the repository at this point in the history
  • Loading branch information
ameknite committed Mar 31, 2024
1 parent 40a6ec9 commit 739d52e
Show file tree
Hide file tree
Showing 3 changed files with 14 additions and 7 deletions.
2 changes: 1 addition & 1 deletion .github/workflows/ci.yml
Original file line number Diff line number Diff line change
Expand Up @@ -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"
Expand Down
2 changes: 1 addition & 1 deletion .github/workflows/docs.yml
Original file line number Diff line number Diff line change
Expand Up @@ -49,7 +49,7 @@ jobs:
echo "<meta name=\"robots\" content=\"noindex\">" > 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
Expand Down
17 changes: 12 additions & 5 deletions tools/ci/src/main.rs
Original file line number Diff line number Diff line change
Expand Up @@ -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;
}
}

Expand Down Expand Up @@ -70,6 +71,7 @@ fn main() {
];

let flag_arguments = [
("--nightly", Flag::KEEP_GOING),
("--keep-going", Flag::KEEP_GOING),
("--deploy-docs", Flag::DEPLOY_DOCS),
];
Expand Down Expand Up @@ -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");
}
Expand Down Expand Up @@ -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) {
Expand Down

0 comments on commit 739d52e

Please sign in to comment.