diff --git a/.github/workflows/ci.yml b/.github/workflows/ci.yml index 8ae7f6597ede9..f7dd5ef4d6d6e 100644 --- a/.github/workflows/ci.yml +++ b/.github/workflows/ci.yml @@ -7,6 +7,7 @@ on: branches: - release-* +# Environment variables must be kept in sync with all workflows that defines them. env: CARGO_TERM_COLOR: always CARGO_INCREMENTAL: 0 @@ -30,15 +31,20 @@ jobs: timeout-minutes: 30 steps: - uses: actions/checkout@v4 - - uses: actions/cache@v4 + - uses: actions/cache/restore@v4 with: + # key won't match, will rely on restore-keys + key: ${{ runner.os }}-stable--${{ hashFiles('**/Cargo.toml') }}- + # See .github/workflows/validation-jobs.yml for how keys are generated + restore-keys: | + ${{ runner.os }}-stable--${{ hashFiles('**/Cargo.toml') }}- + ${{ runner.os }}-stable-- path: | ~/.cargo/bin/ ~/.cargo/registry/index/ ~/.cargo/registry/cache/ ~/.cargo/git/db/ target/ - key: ${{ runner.os }}-cargo-build-stable-${{ hashFiles('**/Cargo.toml') }} - uses: dtolnay/rust-toolchain@stable - name: Install Linux dependencies uses: ./.github/actions/install-linux-deps @@ -53,15 +59,20 @@ jobs: timeout-minutes: 30 steps: - uses: actions/checkout@v4 - - uses: actions/cache@v4 + - uses: actions/cache/restore@v4 with: + # key won't match, will rely on restore-keys + key: ${{ runner.os }}-stable--${{ hashFiles('**/Cargo.toml') }}- + # See .github/workflows/validation-jobs.yml for how keys are generated + restore-keys: | + ${{ runner.os }}-stable--${{ hashFiles('**/Cargo.toml') }}- + ${{ runner.os }}-stable-- path: | ~/.cargo/bin/ ~/.cargo/registry/index/ ~/.cargo/registry/cache/ ~/.cargo/git/db/ target/ - key: ${{ runner.os }}-cargo-ci-${{ hashFiles('**/Cargo.toml') }} - uses: dtolnay/rust-toolchain@stable with: components: rustfmt, clippy @@ -79,15 +90,20 @@ jobs: timeout-minutes: 60 steps: - uses: actions/checkout@v4 - - uses: actions/cache@v4 + - uses: actions/cache/restore@v4 with: + # key won't match, will rely on restore-keys + key: ${{ runner.os }}-${{ env.NIGHTLY_TOOLCHAIN }}--${{ hashFiles('**/Cargo.toml') }}- + # See .github/workflows/validation-jobs.yml for how keys are generated + restore-keys: | + ${{ runner.os }}-${{ env.NIGHTLY_TOOLCHAIN }}--${{ hashFiles('**/Cargo.toml') }}- + ${{ runner.os }}-${{ env.NIGHTLY_TOOLCHAIN }}-- path: | ~/.cargo/bin/ ~/.cargo/registry/index/ ~/.cargo/registry/cache/ ~/.cargo/git/db/ target/ - key: ${{ runner.os }}-cargo-miri-${{ hashFiles('**/Cargo.toml') }} - uses: dtolnay/rust-toolchain@master with: toolchain: ${{ env.NIGHTLY_TOOLCHAIN }} @@ -110,17 +126,20 @@ jobs: needs: ci steps: - uses: actions/checkout@v4 - - uses: actions/cache@v4 + - uses: actions/cache/restore@v4 with: + # key won't match, will rely on restore-keys + key: ${{ runner.os }}-stable--${{ hashFiles('**/Cargo.toml') }}- + # See .github/workflows/validation-jobs.yml for how keys are generated + restore-keys: | + ${{ runner.os }}-stable--${{ hashFiles('**/Cargo.toml') }}- + ${{ runner.os }}-stable-- path: | ~/.cargo/bin/ ~/.cargo/registry/index/ ~/.cargo/registry/cache/ ~/.cargo/git/db/ target/ - crates/bevy_ecs_compile_fail_tests/target/ - crates/bevy_reflect_compile_fail_tests/target/ - key: ${{ runner.os }}-cargo-check-compiles-${{ hashFiles('**/Cargo.toml') }} - uses: dtolnay/rust-toolchain@stable with: toolchain: stable @@ -129,23 +148,27 @@ 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 needs: ci steps: - uses: actions/checkout@v4 - - uses: actions/cache@v4 + - uses: actions/cache/restore@v4 with: + # key won't match, will rely on restore-keys + key: ${{ runner.os }}-stable-x86_64-unknown-none-${{ hashFiles('**/Cargo.toml') }}- + # See .github/workflows/validation-jobs.yml for how keys are generated + restore-keys: | + ${{ runner.os }}-stable-x86_64-unknown-none-${{ hashFiles('**/Cargo.toml') }}- + ${{ runner.os }}-stable-x86_64-unknown-none- path: | ~/.cargo/bin/ ~/.cargo/registry/index/ ~/.cargo/registry/cache/ ~/.cargo/git/db/ target/ - crates/bevy_ecs_compile_fail_tests/target/ - crates/bevy_reflect_compile_fail_tests/target/ - key: ${{ runner.os }}-cargo-check-compiles-no-std-${{ hashFiles('**/Cargo.toml') }} - uses: dtolnay/rust-toolchain@stable with: targets: x86_64-unknown-none @@ -153,23 +176,27 @@ jobs: uses: ./.github/actions/install-linux-deps - name: Check Compile run: cargo check -p bevy --no-default-features --features default_no_std --target x86_64-unknown-none + check-compiles-no-std-portable-atomic: runs-on: ubuntu-latest timeout-minutes: 30 needs: ci steps: - uses: actions/checkout@v4 - - uses: actions/cache@v4 + - uses: actions/cache/restore@v4 with: + # key won't match, will rely on restore-keys + key: ${{ runner.os }}-stable-thumbv6m-none-eabi-${{ hashFiles('**/Cargo.toml') }}- + # See .github/workflows/validation-jobs.yml for how keys are generated + restore-keys: | + ${{ runner.os }}-stable-thumbv6m-none-eabi-${{ hashFiles('**/Cargo.toml') }}- + ${{ runner.os }}-stable-thumbv6m-none-eabi- path: | ~/.cargo/bin/ ~/.cargo/registry/index/ ~/.cargo/registry/cache/ ~/.cargo/git/db/ target/ - crates/bevy_ecs_compile_fail_tests/target/ - crates/bevy_reflect_compile_fail_tests/target/ - key: ${{ runner.os }}-cargo-check-compiles-no-std-portable-atomic-${{ hashFiles('**/Cargo.toml') }} - uses: dtolnay/rust-toolchain@stable with: targets: thumbv6m-none-eabi @@ -184,17 +211,20 @@ jobs: needs: ci steps: - uses: actions/checkout@v4 - - uses: actions/cache@v4 + - uses: actions/cache/restore@v4 with: + # key won't match, will rely on restore-keys + key: ${{ runner.os }}-stable-x86_64-unknown-none-${{ hashFiles('**/Cargo.toml') }}- + # See .github/workflows/validation-jobs.yml for how keys are generated + restore-keys: | + ${{ runner.os }}-stable-x86_64-unknown-none-${{ hashFiles('**/Cargo.toml') }}- + ${{ runner.os }}-stable-x86_64-unknown-none- path: | ~/.cargo/bin/ ~/.cargo/registry/index/ ~/.cargo/registry/cache/ ~/.cargo/git/db/ target/ - crates/bevy_ecs_compile_fail_tests/target/ - crates/bevy_reflect_compile_fail_tests/target/ - key: ${{ runner.os }}-cargo-check-compiles-no-std-examples-${{ hashFiles('**/Cargo.toml') }} - uses: dtolnay/rust-toolchain@stable with: targets: x86_64-unknown-none @@ -209,15 +239,20 @@ jobs: needs: build steps: - uses: actions/checkout@v4 - - uses: actions/cache@v4 + - uses: actions/cache/restore@v4 with: + # key won't match, will rely on restore-keys + key: ${{ runner.os }}-stable-wasm32-unknown-unknown-${{ hashFiles('**/Cargo.toml') }}- + # See .github/workflows/validation-jobs.yml for how keys are generated + restore-keys: | + ${{ runner.os }}-stable-wasm32-unknown-unknown-${{ hashFiles('**/Cargo.toml') }}- + ${{ runner.os }}-stable-wasm32-unknown-unknown- path: | ~/.cargo/bin/ ~/.cargo/registry/index/ ~/.cargo/registry/cache/ ~/.cargo/git/db/ target/ - key: ubuntu-assets-cargo-build-wasm-stable-${{ hashFiles('**/Cargo.toml') }} - uses: dtolnay/rust-toolchain@stable with: target: wasm32-unknown-unknown @@ -230,15 +265,20 @@ jobs: needs: build steps: - uses: actions/checkout@v4 - - uses: actions/cache@v4 + - uses: actions/cache/restore@v4 with: + # key won't match, will rely on restore-keys + key: ${{ runner.os }}-${{ env.NIGHTLY_TOOLCHAIN }}-wasm32-unknown-unknown-${{ hashFiles('**/Cargo.toml') }}- + # See .github/workflows/validation-jobs.yml for how keys are generated + restore-keys: | + ${{ runner.os }}-${{ env.NIGHTLY_TOOLCHAIN }}-wasm32-unknown-unknown-${{ hashFiles('**/Cargo.toml') }}- + ${{ runner.os }}-${{ env.NIGHTLY_TOOLCHAIN }}-wasm32-unknown-unknown- path: | ~/.cargo/bin/ ~/.cargo/registry/index/ ~/.cargo/registry/cache/ ~/.cargo/git/db/ target/ - key: ubuntu-assets-cargo-build-wasm-nightly-${{ hashFiles('**/Cargo.toml') }} - uses: dtolnay/rust-toolchain@master with: toolchain: ${{ env.NIGHTLY_TOOLCHAIN }} @@ -309,15 +349,20 @@ jobs: timeout-minutes: 30 steps: - uses: actions/checkout@v4 - - uses: actions/cache@v4 + - uses: actions/cache/restore@v4 with: + # key won't match, will rely on restore-keys + key: ${{ runner.os }}-stable--${{ hashFiles('**/Cargo.toml') }}- + # See .github/workflows/validation-jobs.yml for how keys are generated + restore-keys: | + ${{ runner.os }}-stable--${{ hashFiles('**/Cargo.toml') }}- + ${{ runner.os }}-stable-- path: | ~/.cargo/bin/ ~/.cargo/registry/index/ ~/.cargo/registry/cache/ ~/.cargo/git/db/ target/ - key: ${{ runner.os }}-check-doc-${{ hashFiles('**/Cargo.toml') }} - uses: dtolnay/rust-toolchain@stable - name: Install Linux dependencies uses: ./.github/actions/install-linux-deps @@ -412,15 +457,6 @@ jobs: needs: build steps: - uses: actions/checkout@v4 - - uses: actions/cache@v4 - with: - path: | - ~/.cargo/bin/ - ~/.cargo/registry/index/ - ~/.cargo/registry/cache/ - ~/.cargo/git/db/ - target/ - key: ${{ runner.os }}-cargo-msrv-${{ hashFiles('**/Cargo.toml') }} - uses: dtolnay/rust-toolchain@stable - name: get MSRV id: msrv @@ -430,6 +466,20 @@ jobs: - uses: dtolnay/rust-toolchain@master with: toolchain: ${{ steps.msrv.outputs.msrv }} + - uses: actions/cache/restore@v4 + with: + # key won't match, will rely on restore-keys + key: ${{ runner.os }}-${{ steps.msrv.outputs.msrv }}--${{ hashFiles('**/Cargo.toml') }}- + # See .github/workflows/validation-jobs.yml for how keys are generated + restore-keys: | + ${{ runner.os }}-${{ steps.msrv.outputs.msrv }}--${{ hashFiles('**/Cargo.toml') }}- + ${{ runner.os }}-${{ steps.msrv.outputs.msrv }}-- + path: | + ~/.cargo/bin/ + ~/.cargo/registry/index/ + ~/.cargo/registry/cache/ + ~/.cargo/git/db/ + target/ - name: Install Linux dependencies uses: ./.github/actions/install-linux-deps - name: Run cargo check diff --git a/.github/workflows/example-run.yml b/.github/workflows/example-run.yml index 676f676db5758..d26faeee56dd9 100644 --- a/.github/workflows/example-run.yml +++ b/.github/workflows/example-run.yml @@ -8,6 +8,7 @@ on: branches: - main +# Environment variables must be kept in sync with all workflows that defines them. env: CARGO_TERM_COLOR: always CARGO_INCREMENTAL: 0 @@ -24,6 +25,20 @@ jobs: - name: Disable audio # Disable audio through a patch. on github m1 runners, audio timeouts after 15 minutes run: git apply --ignore-whitespace tools/example-showcase/disable-audio.patch + - uses: actions/cache/restore@v4 + with: + # key won't match, will rely on restore-keys + key: ${{ runner.os }}-stable--${{ hashFiles('**/Cargo.toml') }}- + # See .github/workflows/validation-jobs.yml for how keys are generated + restore-keys: | + ${{ runner.os }}-stable--${{ hashFiles('**/Cargo.toml') }}- + ${{ runner.os }}-stable-- + path: | + ~/.cargo/bin/ + ~/.cargo/registry/index/ + ~/.cargo/registry/cache/ + ~/.cargo/git/db/ + target/ - name: Run examples run: | for example in .github/example-run/*.ron; do @@ -84,16 +99,21 @@ jobs: run: | sudo add-apt-repository ppa:kisak/turtle -y sudo apt-get install --no-install-recommends libxkbcommon-x11-0 xvfb libgl1-mesa-dri libxcb-xfixes0-dev mesa-vulkan-drivers - - uses: actions/cache@v4 + - uses: dtolnay/rust-toolchain@stable + - uses: actions/cache/restore@v4 with: + # key won't match, will rely on restore-keys + key: ${{ runner.os }}-stable--${{ hashFiles('**/Cargo.toml') }}- + # See .github/workflows/validation-jobs.yml for how keys are generated + restore-keys: | + ${{ runner.os }}-stable--${{ hashFiles('**/Cargo.toml') }}- + ${{ runner.os }}-stable-- path: | ~/.cargo/bin/ ~/.cargo/registry/index/ ~/.cargo/registry/cache/ ~/.cargo/git/db/ target/ - key: ${{ runner.os }}-cargo-run-examples-${{ hashFiles('**/Cargo.toml') }} - - uses: dtolnay/rust-toolchain@stable - name: Run examples run: | for example in .github/example-run/*.ron; do @@ -143,6 +163,20 @@ jobs: steps: - uses: actions/checkout@v4 - uses: dtolnay/rust-toolchain@stable + - uses: actions/cache/restore@v4 + with: + # key won't match, will rely on restore-keys + key: ${{ runner.os }}-stable--${{ hashFiles('**/Cargo.toml') }}- + # See .github/workflows/validation-jobs.yml for how keys are generated + restore-keys: | + ${{ runner.os }}-stable--${{ hashFiles('**/Cargo.toml') }}- + ${{ runner.os }}-stable-- + path: | + ~/.cargo/bin/ + ~/.cargo/registry/index/ + ~/.cargo/registry/cache/ + ~/.cargo/git/db/ + target/ - name: Run examples shell: bash run: | diff --git a/.github/workflows/update-caches.yml b/.github/workflows/update-caches.yml new file mode 100644 index 0000000000000..e08eb6dedc432 --- /dev/null +++ b/.github/workflows/update-caches.yml @@ -0,0 +1,137 @@ +name: Update Actions Caches + +on: + # Manually + workflow_dispatch: + # On PR merge + push: + branches: + - main + # After nightly release + schedule: + - cron: "0 1 * * *" + +# Environment variables must be kept in sync with all workflows that defines them. +env: + CARGO_INCREMENTAL: 0 + CARGO_PROFILE_TEST_DEBUG: 0 + CARGO_PROFILE_DEV_DEBUG: 0 + # If nightly is breaking CI, modify this variable to target a specific nightly version. + NIGHTLY_TOOLCHAIN: nightly + +jobs: + env: + runs-on: ubuntu-latest + outputs: + NIGHTLY_TOOLCHAIN: ${{ steps.env.outputs.NIGHTLY_TOOLCHAIN }} + MSRV: ${{ steps.msrv.outputs.MSRV }} + steps: + - uses: actions/checkout@v4 + - uses: dtolnay/rust-toolchain@stable + - name: get MSRV + id: msrv + run: | + msrv=`cargo metadata --no-deps --format-version 1 | jq --raw-output '.packages[] | select(.name=="bevy") | .rust_version'` + echo "MSRV=$msrv" >> $GITHUB_OUTPUT + - name: Expose Env + id: env + run: | + echo "NIGHTLY_TOOLCHAIN=${{ env.NIGHTLY_TOOLCHAIN }}" >> $GITHUB_OUTPUT + + build-caches: + name: Build Caches + needs: ["env"] + runs-on: ${{ matrix.os }} + strategy: + matrix: + include: + - os: ubuntu-latest + toolchain: stable + target: "" + - os: macos-latest + toolchain: stable + target: "" + - os: windows-latest + toolchain: stable + target: "" + - os: ubuntu-latest + toolchain: ${{ needs.env.outputs.NIGHTLY_TOOLCHAIN }} + target: "" + - os: ubuntu-latest + toolchain: ${{ needs.env.outputs.MSRV }} + target: "" + - os: macos-latest + toolchain: ${{ needs.env.outputs.NIGHTLY_TOOLCHAIN }} + target: "" + - os: ubuntu-latest + toolchain: ${{ needs.env.outputs.NIGHTLY_TOOLCHAIN }} + target: wasm32-unknown-unknown + - os: ubuntu-latest + toolchain: stable + target: wasm32-unknown-unknown + - os: ubuntu-latest + toolchain: stable + target: x86_64-unknown-none + - os: ubuntu-latest + toolchain: stable + target: thumbv6m-none-eabi + - os: ubuntu-latest + toolchain: stable + target: aarch64-linux-android + - os: macos-latest + toolchain: stable + target: aarch64-apple-ios-sim + + steps: + - name: Get Date + id: get-date + run: | + echo "date=$(/bin/date -u "+%Y%m%d")" >> $GITHUB_OUTPUT + shell: bash + + - name: Checkout Bevy main branch + uses: actions/checkout@v4 + with: + repository: "bevyengine/bevy" + ref: "main" + + - name: Setup Rust + id: rust + uses: dtolnay/rust-toolchain@main + with: + toolchain: ${{ matrix.toolchain }} + target: ${{ matrix.target }} + + - name: Create lock file + run: cargo update + + - name: Install Bevy dependencies + uses: ./.github/actions/install-linux-deps + with: + wayland: true + xkb: true + + - uses: actions/cache/restore@v4 + id: cache + with: + key: ${{ runner.os }}-${{ matrix.toolchain }}-${{ matrix.target }}-${{ hashFiles('**/Cargo.toml') }}-${{ hashFiles('Cargo.lock') }}-${{ steps.get-date.outputs.date }} + + - name: Build dev cache + if: steps.cache.outputs.cache-hit != 'true' + run: cargo build --profile dev --package bevy + + - name: Build test cache + if: steps.cache.outputs.cache-hit != 'true' + run: cargo build --profile test --package bevy + + - name: Save cache + if: steps.cache.outputs.cache-hit != 'true' + uses: actions/cache/save@v4 + with: + path: | + ~/.cargo/bin/ + ~/.cargo/registry/index/ + ~/.cargo/registry/cache/ + ~/.cargo/git/db/ + target/ + key: ${{ runner.os }}-${{ matrix.toolchain }}-${{ matrix.target }}-${{ hashFiles('**/Cargo.toml') }}-${{ hashFiles('Cargo.lock') }}-${{ steps.get-date.outputs.date }} diff --git a/.github/workflows/validation-jobs.yml b/.github/workflows/validation-jobs.yml index 36679408578ed..47bd3fe054bbf 100644 --- a/.github/workflows/validation-jobs.yml +++ b/.github/workflows/validation-jobs.yml @@ -11,6 +11,7 @@ concurrency: group: ${{github.workflow}}-${{github.ref}} cancel-in-progress: ${{github.event_name == 'pull_request'}} +# Environment variables must be kept in sync with all workflows that defines them. env: CARGO_TERM_COLOR: always CARGO_INCREMENTAL: 0 @@ -29,15 +30,23 @@ jobs: - uses: dtolnay/rust-toolchain@stable - - uses: actions/cache@v4 + - uses: actions/cache/restore@v4 with: + # key won't match, will rely on restore-keys + key: ${{ runner.os }}-stable-aarch64-apple-ios-sim-${{ hashFiles('**/Cargo.toml') }}- + # See .github/workflows/validation-jobs.yml for how keys are generated + restore-keys: | + ${{ runner.os }}-stable-aarch64-apple-ios-sim-${{ hashFiles('**/Cargo.toml') }}- + ${{ runner.os }}-stable-aarch64-apple-ios-sim- path: | - target - key: ${{ runner.os }}-ios-install-${{ hashFiles('**/Cargo.lock') }} + ~/.cargo/bin/ + ~/.cargo/registry/index/ + ~/.cargo/registry/cache/ + ~/.cargo/git/db/ + target/ - # TODO: remove x86 target once it always run on arm GitHub runners - name: Add iOS targets - run: rustup target add aarch64-apple-ios x86_64-apple-ios aarch64-apple-ios-sim + run: rustup target add aarch64-apple-ios-sim - name: Build and install iOS app in iOS Simulator. run: cd examples/mobile && make install @@ -54,18 +63,23 @@ jobs: - name: Set up JDK 17 uses: actions/setup-java@v4 with: - java-version: '17' - distribution: 'temurin' + java-version: "17" + distribution: "temurin" - - uses: actions/cache@v4 + - uses: actions/cache/restore@v4 with: + # key won't match, will rely on restore-keys + key: ${{ runner.os }}-stable-aarch64-linux-android-${{ hashFiles('**/Cargo.toml') }}- + # See .github/workflows/validation-jobs.yml for how keys are generated + restore-keys: | + ${{ runner.os }}-stable-aarch64-linux-android-${{ hashFiles('**/Cargo.toml') }}- + ${{ runner.os }}-stable-aarch64-linux-android- path: | ~/.cargo/bin/ ~/.cargo/registry/index/ ~/.cargo/registry/cache/ ~/.cargo/git/db/ target/ - key: ${{ runner.os }}-cargo-build-android-${{ hashFiles('**/Cargo.toml') }} - name: Install Android targets run: rustup target add aarch64-linux-android @@ -90,16 +104,20 @@ jobs: with: target: wasm32-unknown-unknown - - uses: actions/cache@v4 + - uses: actions/cache/restore@v4 with: + # key won't match, will rely on restore-keys + key: ${{ runner.os }}-stable-wasm32-unknown-unknown-${{ hashFiles('**/Cargo.toml') }}- + # See .github/workflows/validation-jobs.yml for how keys are generated + restore-keys: | + ${{ runner.os }}-stable-wasm32-unknown-unknown-${{ hashFiles('**/Cargo.toml') }}- + ${{ runner.os }}-stable-wasm32-unknown-unknown- path: | ~/.cargo/bin/ ~/.cargo/registry/index/ ~/.cargo/registry/cache/ ~/.cargo/git/db/ - ~/.github/start-wasm-example/node_modules target/ - key: ${{ runner.os }}-wasm-run-examples-${{ hashFiles('**/Cargo.toml') }} - name: Install wasm-bindgen run: cargo install --force wasm-bindgen-cli @@ -167,18 +185,23 @@ jobs: timeout-minutes: 30 steps: - uses: actions/checkout@v4 - - uses: actions/cache@v4 + - uses: dtolnay/rust-toolchain@master with: + toolchain: ${{ env.NIGHTLY_TOOLCHAIN }} + - uses: actions/cache/restore@v4 + with: + # key won't match, will rely on restore-keys + key: ${{ runner.os }}-${{ env.NIGHTLY_TOOLCHAIN }}--${{ hashFiles('**/Cargo.toml') }}- + # See .github/workflows/validation-jobs.yml for how keys are generated + restore-keys: | + ${{ runner.os }}-${{ env.NIGHTLY_TOOLCHAIN }}--${{ hashFiles('**/Cargo.toml') }}- + ${{ runner.os }}-${{ env.NIGHTLY_TOOLCHAIN }}-- path: | ~/.cargo/bin/ ~/.cargo/registry/index/ ~/.cargo/registry/cache/ ~/.cargo/git/db/ target/ - key: ${{ runner.os }}-cargo-check-unused-dependencies-${{ hashFiles('**/Cargo.toml') }} - - uses: dtolnay/rust-toolchain@master - with: - toolchain: ${{ env.NIGHTLY_TOOLCHAIN }} - name: Installs cargo-udeps run: cargo install --force cargo-udeps - name: Install Linux dependencies @@ -192,16 +215,21 @@ jobs: timeout-minutes: 30 steps: - uses: actions/checkout@v4 - - uses: actions/cache@v4 + - uses: dtolnay/rust-toolchain@stable + - uses: actions/cache/restore@v4 with: + # key won't match, will rely on restore-keys + key: ${{ runner.os }}-stable--${{ hashFiles('**/Cargo.toml') }}- + # See .github/workflows/validation-jobs.yml for how keys are generated + restore-keys: | + ${{ runner.os }}-stable--${{ hashFiles('**/Cargo.toml') }}- + ${{ runner.os }}-stable-- path: | ~/.cargo/bin/ ~/.cargo/registry/index/ ~/.cargo/registry/cache/ ~/.cargo/git/db/ target/ - key: ${{ runner.os }}-cargo-check-showcase-patches-${{ hashFiles('**/Cargo.toml') }} - - uses: dtolnay/rust-toolchain@stable - name: Install Linux dependencies uses: ./.github/actions/install-linux-deps - name: Apply patches