Use Leafwing-Studios/cargo-cache in CI #2
Workflow file for this run
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
name: Create Caches | |
on: | |
schedule: | |
# Run at 0:00 daily. (Basically as early as possible.) | |
- cron: 0 0 * * * | |
workflow_dispatch: | |
# TODO: Remove this. It is for testing purposes only. | |
pull_request: | |
# Prevent this workflow from being run more than once at a time. | |
concurrency: | |
group: ${{ github.workflow }} | |
jobs: | |
build: | |
name: Build | |
strategy: | |
# Don't cancel everything if one configuration happens to fail. | |
fail-fast: false | |
matrix: | |
os: [ubuntu-latest, windows-latest, macos-latest] | |
toolchain: [stable] | |
runs-on: ${{ matrix.os }} | |
steps: | |
- name: Checkout | |
uses: actions/checkout@v4 | |
- name: Install Rust | |
uses: dtolnay/rust-toolchain@master | |
with: | |
toolchain: ${{ matrix.toolchain }} | |
- name: Install Linux dependencies | |
uses: ./.github/actions/install-linux-deps | |
- name: Build workspace | |
run: cargo build --workspace | |
- name: Save cache | |
uses: ./.github/actions/cache | |
with: | |
kind: build | |
toolchain: ${{ matrix.toolchain }} | |
action: save | |
check: | |
name: Check | |
strategy: | |
# Don't cancel everything if one configuration happens to fail. | |
fail-fast: false | |
matrix: | |
include: | |
- os: ubuntu-latest | |
toolchain: nightly | |
target: default | |
- os: macos-latest | |
toolchain: nightly | |
target: default | |
- os: ubuntu-latest | |
toolchain: stable | |
target: wasm | |
- os: ubuntu-latest | |
toolchain: nightly | |
target: wasm-atomics | |
runs-on: ${{ matrix.os }} | |
steps: | |
- name: Checkout | |
uses: actions/checkout@v4 | |
- name: Install Rust | |
uses: dtolnay/rust-toolchain@master | |
with: | |
toolchain: ${{ matrix.toolchain }} | |
- name: Install Linux dependencies | |
uses: ./.github/actions/install-linux-deps | |
- name: Build workspace | |
run: cargo check --workspace | |
- name: Save cache | |
uses: ./.github/actions/cache | |
with: | |
kind: check | |
toolchain: ${{ matrix.toolchain }} | |
target: ${{ matrix.target }} | |
action: save | |
doc: | |
name: Doc | |
strategy: | |
# Don't cancel everything if one configuration happens to fail. | |
fail-fast: false | |
matrix: | |
os: [ubuntu-latest] | |
toolchain: [nightly] | |
runs-on: ${{ matrix.os }} | |
steps: | |
- name: Checkout | |
uses: actions/checkout@v4 | |
- name: Install Rust | |
uses: dtolnay/rust-toolchain@master | |
with: | |
toolchain: ${{ matrix.toolchain }} | |
- name: Install Linux dependencies | |
uses: ./.github/actions/install-linux-deps | |
- name: Build workspace | |
run: cargo doc -p bevy --no-deps | |
- name: Save cache | |
uses: ./.github/actions/cache | |
with: | |
kind: doc | |
toolchain: ${{ matrix.toolchain }} | |
action: save |