Skip to content

Upkeep - Update Cache #785

Upkeep - Update Cache

Upkeep - Update Cache #785

name: Upkeep - Update Cache
on:
workflow_dispatch:
schedule:
- cron: "0 0 * * *"
jobs:
build-cache:
name: Build Cache
runs-on: ${{ matrix.os }}
strategy:
matrix:
os: [ubuntu-24.04, macos-14, windows-2025]
steps:
- name: Checkout Bevy main branch
uses: actions/checkout@v6
with:
repository: "bevyengine/bevy"
- name: Checkout patches
uses: actions/checkout@v6
with:
path: "runner-patches"
- name: Apply patches
shell: pwsh
run: |
Get-ChildItem "runner-patches/patches" -Filter *.patch |
Foreach-Object {
Write-Output "Processing $($_.FullName)"
git apply --ignore-whitespace $($_.FullName)
}
- name: Setup Rust
uses: dtolnay/rust-toolchain@stable
- name: Install Bevy dependencies
if: runner.os == 'linux'
run: |
sudo apt-get update;
DEBIAN_FRONTEND=noninteractive sudo apt-get install --no-install-recommends -yq \
libasound2-dev libudev-dev libxkbcommon-x11-0 libwayland-dev;
- name: Install xvfb, llvmpipe and lavapipe
if: runner.os == 'linux'
run: |
sudo apt-get update -y -qq
sudo add-apt-repository ppa:kisak/turtle -y || FAILED=true
# retry as it sometimes timeout
if [ $FAILED ]; then
sleep 5
sudo add-apt-repository ppa:kisak/turtle -y || FAILED=true
if [ $FAILED ]; then
sleep 5
sudo add-apt-repository ppa:kisak/turtle -y
fi
fi
sudo apt-get update
sudo apt install -y xvfb libgl1-mesa-dri libxcb-xfixes0-dev mesa-vulkan-drivers
- name: Build an example (Linux)
if: runner.os == 'linux'
run: xvfb-run -s "-screen 0 1280x1024x24" cargo run -p example-showcase -- --page 1 --per-page 1 run --in-ci --ignore-stress-tests --screenshot-frame 0 --fixed-frame-time 0.02 --stop-frame 50
- name: Build an example (macOS)
if: runner.os == 'macos'
run: cargo run -p example-showcase -- --page 1 --per-page 1 run --in-ci --ignore-stress-tests --screenshot-frame 0 --fixed-frame-time 0.02 --stop-frame 50
- name: Build an example (Windows)
if: runner.os == 'windows'
run: cargo run -p example-showcase -- --page 1 --per-page 1 run --in-ci --ignore-stress-tests --screenshot-frame 0 --fixed-frame-time 0.02 --stop-frame 50
- name: Save cache
uses: actions/cache/save@v5
with:
path: |
~/.cargo/bin/
~/.cargo/registry/index/
~/.cargo/registry/cache/
~/.cargo/git/db/
target/
key: ${{ runner.os }}-cargo-${{ hashFiles('**/Cargo.toml') }}
build-apt-cache:
name: Build apt Cache
runs-on: ubuntu-24.04
steps:
# prepare the date - used to rebuild the cache daily to catch new versions
- name: Get Date
id: get-date
run: |
echo "date=$(/bin/date -u "+%Y%m%d")" >> $GITHUB_OUTPUT
shell: bash
- name: Install llvmpipe and lavapipe
run: |
sudo apt-get update -y -qq
sudo add-apt-repository ppa:kisak/turtle -y
DEBIAN_FRONTEND=noninteractive sudo apt-get install --no-install-recommends -yq \
libgl1-mesa-dri mesa-vulkan-drivers
rm -rf ~/apt-cache; mkdir ~/apt-cache
for package in libgbm1 libgl1-mesa-dri libglx-mesa0 mesa-libgallium libdisplay-info1 mesa-vulkan-drivers; do
echo $package
dpkg -L $package | while IFS= read -r f; do if test -f "$f"; then echo "$f"; fi; done | xargs -d '\n' cp --parents --target-directory ~/apt-cache/
done
- name: Save cache
uses: actions/cache/save@v5
with:
path: |
~/apt-cache/
key: ${{ runner.os }}-apt-${{ steps.get-date.outputs.date }}