Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Use Leafwing-Studios/cargo-cache in CI #13040

Open
wants to merge 24 commits into
base: main
Choose a base branch
from
Open
Show file tree
Hide file tree
Changes from 18 commits
Commits
Show all changes
24 commits
Select commit Hold shift + click to select a range
f1fbe70
feat: create cache action
BD103 Apr 20, 2024
9798709
feat: create caches workflow
BD103 Apr 20, 2024
47d7144
feat: more improvements
BD103 Apr 20, 2024
142a504
feat: even more improvements
BD103 Apr 20, 2024
2800287
fix: install wayland dependencies in docs
BD103 Apr 20, 2024
4fe2114
fix: don't check workspace in wasm
BD103 Apr 20, 2024
30cde58
fix: exclude `bevy_dylib` from build
BD103 Apr 20, 2024
7a99df5
feat: test first in doc
BD103 Apr 20, 2024
427046b
feat: use new cache action in `ci.yml`
BD103 Apr 20, 2024
f9d6a94
fix: *not* merge group
BD103 Apr 20, 2024
ec17d1d
fix: don't save caches from merge queues
BD103 Apr 20, 2024
b32c80a
feat!: use Leafwing-Studios/cargo-cache instead
BD103 Apr 22, 2024
6600cb0
Merge branch 'main' into cache-shenanigans
BD103 Apr 22, 2024
04e7bd5
feat: remove caching from validation jobs
BD103 Apr 22, 2024
56c1670
Merge branch 'main' into cache-shenanigans
BD103 Apr 26, 2024
93ea40d
Merge branch 'main' into cache-shenanigans
BD103 May 2, 2024
76e74d5
Merge branch 'main' into cache-shenanigans
BD103 May 17, 2024
c62a6fc
Merge branch 'main' into cache-shenanigans
BD103 Jun 25, 2024
e9e2426
feat: bump to `cargo-cache@v2`
BD103 Jul 17, 2024
5c84b23
Merge branch 'main' into cache-shenanigans
BD103 Jul 20, 2024
9e9f57f
feat: `save-if` to only save on the `main` branch
BD103 Jul 20, 2024
602dd09
Merge branch 'main' into cache-shenanigans
BD103 Aug 13, 2024
5f96881
fix: remove leftover validation cache
BD103 Aug 13, 2024
2923973
Merge branch 'main' into cache-shenanigans
BD103 Aug 13, 2024
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
99 changes: 12 additions & 87 deletions .github/workflows/ci.yml
Original file line number Diff line number Diff line change
Expand Up @@ -26,16 +26,8 @@ jobs:
timeout-minutes: 30
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-build-stable-${{ hashFiles('**/Cargo.toml') }}
- uses: dtolnay/rust-toolchain@stable
- uses: Leafwing-Studios/cargo-cache@v1
- name: Install Linux dependencies
uses: ./.github/actions/install-linux-deps
- name: Build & run tests
Expand All @@ -50,18 +42,8 @@ jobs:
timeout-minutes: 30
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-ci-${{ hashFiles('**/Cargo.toml') }}
- uses: dtolnay/rust-toolchain@stable
with:
components: rustfmt, clippy
- uses: Leafwing-Studios/cargo-cache@v1
- name: Install Linux dependencies
uses: ./.github/actions/install-linux-deps
with:
Expand All @@ -77,19 +59,11 @@ jobs:
timeout-minutes: 60
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-miri-${{ hashFiles('**/Cargo.toml') }}
- uses: dtolnay/rust-toolchain@master
with:
toolchain: ${{ env.NIGHTLY_TOOLCHAIN }}
components: miri
- uses: Leafwing-Studios/cargo-cache@v1
- name: CI job
# To run the tests one item at a time for troubleshooting, use
# cargo --quiet test --lib -- --list | sed 's/: test$//' | MIRIFLAGS="-Zmiri-disable-isolation -Zmiri-permissive-provenance -Zmiri-disable-weak-memory-emulation" xargs -n1 cargo miri test -p bevy_ecs --lib -- --exact
Expand All @@ -109,20 +83,8 @@ jobs:
needs: ci
steps:
- uses: actions/checkout@v4
- uses: actions/cache@v4
with:
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
- uses: Leafwing-Studios/cargo-cache@v1
- name: Install Linux dependencies
uses: ./.github/actions/install-linux-deps
- name: Check Compile
Expand All @@ -135,18 +97,10 @@ 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: ubuntu-assets-cargo-build-wasm-stable-${{ hashFiles('**/Cargo.toml') }}
- uses: dtolnay/rust-toolchain@stable
with:
target: wasm32-unknown-unknown
- uses: Leafwing-Studios/cargo-cache@v1
- name: Check wasm
run: cargo check --target wasm32-unknown-unknown

Expand All @@ -156,20 +110,12 @@ 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: ubuntu-assets-cargo-build-wasm-nightly-${{ hashFiles('**/Cargo.toml') }}
- uses: dtolnay/rust-toolchain@master
with:
toolchain: ${{ env.NIGHTLY_TOOLCHAIN }}
targets: wasm32-unknown-unknown
components: rust-src
- uses: Leafwing-Studios/cargo-cache@v1
- name: Check wasm
run: cargo check --target wasm32-unknown-unknown -Z build-std=std,panic_abort
env:
Expand Down Expand Up @@ -237,6 +183,7 @@ jobs:
steps:
- uses: actions/checkout@v4
- uses: dtolnay/rust-toolchain@stable
- uses: Leafwing-Studios/cargo-cache@v1
- 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
Expand Down Expand Up @@ -280,16 +227,10 @@ jobs:
timeout-minutes: 30
steps:
- uses: actions/checkout@v4
- uses: actions/cache@v4
- uses: dtolnay/rust-toolchain@master
with:
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
toolchain: ${{ env.NIGHTLY_TOOLCHAIN }}
- uses: Leafwing-Studios/cargo-cache@v1
- name: Install Linux dependencies
uses: ./.github/actions/install-linux-deps
with:
Expand Down Expand Up @@ -382,15 +323,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') }}
- name: get MSRV
id: msrv
run: |
Expand All @@ -399,6 +331,7 @@ jobs:
- uses: dtolnay/rust-toolchain@master
with:
toolchain: ${{ steps.msrv.outputs.msrv }}
- uses: Leafwing-Studios/cargo-cache@v1
- name: Install Linux dependencies
uses: ./.github/actions/install-linux-deps
- name: Run cargo check
Expand Down Expand Up @@ -441,18 +374,10 @@ jobs:
timeout-minutes: 30
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 }}-check-doc-${{ hashFiles('**/Cargo.toml') }}
- uses: dtolnay/rust-toolchain@master
with:
toolchain: ${{ env.NIGHTLY_TOOLCHAIN }}
- uses: Leafwing-Studios/cargo-cache@v1
- name: Install Linux dependencies
uses: ./.github/actions/install-linux-deps
with:
Expand Down
54 changes: 1 addition & 53 deletions .github/workflows/validation-jobs.yml
Original file line number Diff line number Diff line change
Expand Up @@ -27,11 +27,7 @@ jobs:

- uses: dtolnay/rust-toolchain@stable

- uses: actions/cache@v4
with:
path: |
target
key: ${{ runner.os }}-ios-install-${{ matrix.toolchain }}-${{ hashFiles('**/Cargo.lock') }}
- uses: Leafwing-Studios/cargo-cache@v1

# TODO: remove x86 target once it always run on arm GitHub runners
- name: Add iOS targets
Expand All @@ -49,16 +45,6 @@ jobs:

- uses: dtolnay/rust-toolchain@stable

- uses: actions/cache@v4
with:
path: |
~/.cargo/bin/
~/.cargo/registry/index/
~/.cargo/registry/cache/
~/.cargo/git/db/
target/
key: ${{ runner.os }}-cargo-build-android-${{ hashFiles('**/Cargo.toml') }}

BD103 marked this conversation as resolved.
Show resolved Hide resolved
- name: Install Android targets
run: rustup target add aarch64-linux-android armv7-linux-androideabi

Expand All @@ -81,15 +67,6 @@ jobs:
run: |
sudo add-apt-repository ppa:kisak/turtle -y
sudo apt-get install --no-install-recommends libxkbcommon-x11-0 xvfb libegl1-mesa libgl1-mesa-dri libxcb-xfixes0-dev mesa-vulkan-drivers
- uses: actions/cache@v4
with:
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: Build bevy
# this uses the same command as when running the example to ensure build is reused
Expand Down Expand Up @@ -183,17 +160,6 @@ jobs:
with:
target: wasm32-unknown-unknown

- uses: actions/cache@v4
with:
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 xvfb, llvmpipe and lavapipe
run: |
sudo apt-get update -y -qq
Expand Down Expand Up @@ -268,15 +234,6 @@ jobs:
timeout-minutes: 30
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-check-unused-dependencies-${{ hashFiles('**/Cargo.toml') }}
- uses: dtolnay/rust-toolchain@master
with:
toolchain: ${{ env.NIGHTLY_TOOLCHAIN }}
Expand All @@ -293,15 +250,6 @@ jobs:
timeout-minutes: 30
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-check-showcase-patches-${{ hashFiles('**/Cargo.toml') }}
- uses: dtolnay/rust-toolchain@stable
- name: Install Linux dependencies
uses: ./.github/actions/install-linux-deps
Expand Down