From 58a73924ebf4b8afadaa48a9f0bbf2f057292a43 Mon Sep 17 00:00:00 2001 From: Benjamin Brienen Date: Thu, 7 Nov 2024 01:56:22 +0100 Subject: [PATCH] Make doc CI use nightly (#16147) # Objective Fixes #15427 Follow-up to #15428 ## Solution Use nightly and add the environment variables as suggested here: https://github.com/bevyengine/bevy/pull/15428#pullrequestreview-2331294421 ## Testing CI should run --- .github/workflows/ci.yml | 10 ++++++---- .github/workflows/weekly.yml | 8 ++++---- tools/ci/src/commands/doc_check.rs | 2 +- 3 files changed, 11 insertions(+), 9 deletions(-) diff --git a/.github/workflows/ci.yml b/.github/workflows/ci.yml index 4d6ab6f153..89c24e3a9a 100644 --- a/.github/workflows/ci.yml +++ b/.github/workflows/ci.yml @@ -127,7 +127,7 @@ jobs: - name: Check Compile # See tools/ci/src/main.rs for the commands this runs run: cargo run -p ci -- compile - + check-compiles-no-std: runs-on: ubuntu-latest timeout-minutes: 30 @@ -301,7 +301,7 @@ jobs: with: name: example-run-macos path: example-run/ - + check-doc: runs-on: ubuntu-latest timeout-minutes: 30 @@ -316,7 +316,9 @@ jobs: ~/.cargo/git/db/ target/ key: ${{ runner.os }}-check-doc-${{ hashFiles('**/Cargo.toml') }} - - uses: dtolnay/rust-toolchain@stable + - uses: dtolnay/rust-toolchain@master + with: + toolchain: ${{ env.NIGHTLY_TOOLCHAIN }} - name: Install Linux dependencies uses: ./.github/actions/install-linux-deps with: @@ -327,7 +329,7 @@ jobs: run: cargo run -p ci -- doc env: CARGO_INCREMENTAL: 0 - RUSTFLAGS: "-C debuginfo=0" + RUSTFLAGS: "-C debuginfo=0 --cfg docsrs_dep" # This currently report a lot of false positives # Enable it again once it's fixed - https://github.com/bevyengine/bevy/issues/1983 # - name: Installs cargo-deadlinks diff --git a/.github/workflows/weekly.yml b/.github/workflows/weekly.yml index 8c78f165fe..c824dcee87 100644 --- a/.github/workflows/weekly.yml +++ b/.github/workflows/weekly.yml @@ -75,7 +75,7 @@ jobs: run: cargo run -p ci -- doc env: CARGO_INCREMENTAL: 0 - RUSTFLAGS: "-C debuginfo=0" + RUSTFLAGS: "-C debuginfo=0 --cfg docsrs_dep" open-issue: name: Warn that weekly CI fails @@ -83,7 +83,7 @@ jobs: needs: [test, lint, check-compiles, check-doc] permissions: issues: write - # Use always() so the job doesn't get canceled if any other jobs fail + # Use always() so the job doesn't get canceled if any other jobs fail if: ${{ always() && contains(needs.*.result, 'failure') }} steps: - name: Create issue @@ -94,7 +94,7 @@ jobs: --jq '.[0].number') if [[ -n $previous_issue_number ]]; then gh issue comment $previous_issue_number \ - --body "Weekly pipeline still fails: ${{ github.server_url }}/${{ github.repository }}/actions/runs/${{ github.run_id }}" + --body "Weekly pipeline still fails: ${{ github.server_url }}/${{ github.repository }}/actions/runs/${{ github.run_id }}" else gh issue create \ --title "$TITLE" \ @@ -106,6 +106,6 @@ jobs: GH_REPO: ${{ github.repository }} TITLE: Main branch fails to compile on Rust beta. LABELS: C-Bug,S-Needs-Triage - BODY: | + BODY: | ## Weekly CI run has failed. [The offending run.](${{ github.server_url }}/${{ github.repository }}/actions/runs/${{ github.run_id }}) diff --git a/tools/ci/src/commands/doc_check.rs b/tools/ci/src/commands/doc_check.rs index ef5fc502df..b00c5d27f8 100644 --- a/tools/ci/src/commands/doc_check.rs +++ b/tools/ci/src/commands/doc_check.rs @@ -16,6 +16,6 @@ impl Prepare for DocCheckCommand { ), "Please fix doc warnings in output above.", ) - .with_env_var("RUSTDOCFLAGS", "-D warnings")] + .with_env_var("RUSTDOCFLAGS", "-D warnings --cfg=docsrs")] } }