Skip to content

Commit

Permalink
feat: use new cache action in ci.yml
Browse files Browse the repository at this point in the history
A few other driveby fixes too. I removed the unecessary `components: rustfmt, clippy` specification. I also made the doc job use nightly Rust.
  • Loading branch information
BD103 committed Apr 20, 2024
1 parent 7a99df5 commit 427046b
Showing 1 changed file with 32 additions and 85 deletions.
117 changes: 32 additions & 85 deletions .github/workflows/ci.yml
Original file line number Diff line number Diff line change
Expand Up @@ -24,16 +24,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 }}-cargo-build-stable-${{ hashFiles('**/Cargo.toml') }}
- uses: dtolnay/rust-toolchain@stable
- uses: ./.github/actions/cache
with:
kind: build
- name: Install Linux dependencies
uses: ./.github/actions/install-linux-deps
- name: Build & run tests
Expand All @@ -48,18 +42,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 }}-cargo-ci-${{ hashFiles('**/Cargo.toml') }}
- uses: dtolnay/rust-toolchain@stable
- uses: ./.github/actions/cache
with:
components: rustfmt, clippy
kind: check
- name: Install Linux dependencies
uses: ./.github/actions/install-linux-deps
with:
Expand All @@ -74,19 +60,14 @@ 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: ./.github/actions/cache
with:
kind: check
toolchain: nightly
- 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 @@ -106,20 +87,10 @@ 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
- uses: ./.github/actions/cache
with:
toolchain: stable
kind: build
- name: Install Linux dependencies
uses: ./.github/actions/install-linux-deps
- name: Check Compile
Expand All @@ -132,18 +103,13 @@ 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: ./.github/actions/cache
with:
kind: check
target: wasm
- name: Check wasm
run: cargo check --target wasm32-unknown-unknown

Expand All @@ -153,20 +119,16 @@ 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: ./.github/actions/cache
with:
kind: check
toolchain: nightly
target: wasm-atomics
- name: Check wasm
run: cargo check --target wasm32-unknown-unknown -Z build-std=std,panic_abort
env:
Expand Down Expand Up @@ -233,6 +195,7 @@ jobs:
steps:
- uses: actions/checkout@v4
- uses: dtolnay/rust-toolchain@stable
# TODO: Cache?
- 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 @@ -276,16 +239,13 @@ 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: ./.github/actions/cache
with:
kind: doc
toolchain: nightly
- name: Install Linux dependencies
uses: ./.github/actions/install-linux-deps
with:
Expand Down Expand Up @@ -378,15 +338,7 @@ 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') }}
# TODO: Cache with Rust version?
- name: get MSRV
run: |
msrv=`cargo metadata --no-deps --format-version 1 | jq --raw-output '.packages[] | select(.name=="bevy") | .rust_version'`
Expand Down Expand Up @@ -436,18 +388,13 @@ 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: ./.github/actions/cache
with:
kind: check
toolchain: nightly
- name: Install Linux dependencies
uses: ./.github/actions/install-linux-deps
with:
Expand Down

0 comments on commit 427046b

Please sign in to comment.