Skip to content

Navigation Menu

Sign in
Appearance settings

Search code, repositories, users, issues, pull requests...

Provide feedback

We read every piece of feedback, and take your input very seriously.

Saved searches

Use saved searches to filter your results more quickly

Appearance settings

feat!: Update to Bevy 0.16 #1078

feat!: Update to Bevy 0.16

feat!: Update to Bevy 0.16 #1078

on:
push:
branches:
- main
- staging
pull_request:
branches:
- "**"
name: CI
env:
REGISTRY: ghcr.io
IMAGE_NAME: bevy-mod-scripting
CODEGEN_BRANCH_NAME: __update-bevy-bindings-${{ github.head_ref || github.ref_name }}
GH_TOKEN: ${{ github.token }}
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }}
BENCHER_API_TOKEN: ${{ secrets.BENCHER_API_TOKEN }}
concurrency:
# Use github.run_id on main branch
# Use github.event.pull_request.number on pull requests, so it's unique per pull request
# Use github.ref on other branches, so it's unique per branch
group: ${{ github.workflow }}-${{ github.ref == 'refs/heads/main' && github.run_id || github.event.pull_request.number || github.ref }}
cancel-in-progress: true
jobs:
check-needs-run:
runs-on: ubuntu-latest
outputs:
any-changes: ${{ steps.changes.outputs.src }}
permissions:
pull-requests: read
contents: read
steps:
- name: Checkout
uses: actions/checkout@v4
- uses: dorny/paths-filter@v3
id: changes
with:
base: main
filters: |
src:
- 'src/**'
- 'crates/**'
- 'examples/**'
- 'assets/**'
- 'docs/**'
- '.github/workflows/bevy_mod_scripting.yml'
generate-job-matrix:
runs-on: ubuntu-latest
# container: ${{ env.REGISTRY }}/${{ env.IMAGE_NAME }}:latest
outputs:
matrix: ${{ steps.generate-matrix.outputs.matrix }}
steps:
- name: Checkout
uses: actions/checkout@v4
- name: Rust Cache
uses: Swatinem/rust-cache@v2.7.7
with:
# reasoning: we want to cache xtask, most of the jobs in the matrix will be sped up a good bit thanks to that
save-if: ${{ github.ref == 'refs/heads/main' }}
cache-all-crates: true
- name: Generate matrix
id: generate-matrix
run: |
cargo xtask ci-matrix > matrix.json
cat matrix.json
echo "Convert to single line JSON"
jq -c . matrix.json > matrix-one-line.json
echo "matrix=$(cat matrix-one-line.json)" >> $GITHUB_OUTPUT
check:
needs: [check-needs-run, generate-job-matrix]
permissions:
pull-requests: write
contents: write
issues: write
checks: write
name: Check - ${{ matrix.run_args.name }}
runs-on: ${{ matrix.run_args.os }}
strategy:
matrix:
run_args: ${{fromJson(needs.generate-job-matrix.outputs.matrix)}}
steps:
# - name: Free Disk Space (Ubuntu)
# if: runner.os == 'Linux'
# uses: jlumbroso/free-disk-space@main
# with:
# tool-cache: false
# android: true
# dotnet: true
# haskell: true
# large-packages: true
# docker-images: true
# swap-storage: true
# # - if: runner.os == 'linux'
# # run: |
# # sudo rm -rf /usr/share/dotnet; sudo rm -rf /opt/ghc; sudo rm -rf "/usr/local/share/boost"; sudo rm -rf "$AGENT_TOOLSDIRECTORY"
- name: Checkout
if: ${{ needs.check-needs-run.outputs.any-changes == 'true' }}
uses: actions/checkout@v4
- uses: actions-rs/toolchain@v1
if: ${{ needs.check-needs-run.outputs.any-changes == 'true' }}
with:
toolchain: stable
override: true
- name: Rust Cache
if: ${{ needs.check-needs-run.outputs.any-changes == 'true' }}
uses: Swatinem/rust-cache@v2.7.7
with:
# reasoning: we want to cache xtask, most of the jobs in the matrix will be sped up a good bit thanks to that
save-if: ${{ github.ref == 'refs/heads/main' }}
cache-all-crates: true
- name: Setup
if: ${{ needs.check-needs-run.outputs.any-changes == 'true' }}
run: |
cargo xtask init
- name: Setup GPU Drivers
if: ${{ needs.check-needs-run.outputs.any-changes == 'true' && matrix.run_args.requires_gpu }}
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
- name: Check
if: ${{ needs.check-needs-run.outputs.any-changes == 'true' && !matrix.run_args.requires_gpu }}
run: |
${{ matrix.run_args.command }}
- name: Check With virtual X11 server
if: ${{ needs.check-needs-run.outputs.any-changes == 'true' && matrix.run_args.requires_gpu }}
run: |
xvfb-run ${{ matrix.run_args.command }}
- name: Upload coverage artifact
if: ${{ needs.check-needs-run.outputs.any-changes == 'true' && matrix.run_args.generates_coverage }}
uses: actions/upload-artifact@v4
with:
name: code-coverage-report
path: target/coverage/html/
- name: Update coverage badge
if: ${{ needs.check-needs-run.outputs.any-changes == 'true' && matrix.run_args.generates_coverage }}
continue-on-error: true
run: |
git checkout -b chore/_update-coverage-badge || git checkout chore/_update-coverage-badge
cp target/coverage/html/badges/for_the_badge.svg badges/coverage.svg
git config user.name "github-actions[bot]"
git config user.email "41898282+github-actions[bot]@users.noreply.github.com"
git config --global push.autoSetupRemote true
git add badges/coverage.svg
if [[ -n $(git status -s) ]]; then
git commit -m "chore(badge): Update coverage badge" -m "[skip ci]"
git push -f
gh pr create --title "chore: Update coverage badge" --body "Updates coverage badge based on test results" --base ${{ github.ref }} --head chore/_update-coverage-badge > pr.txt
sed -n 's/.*pull\/\([0-9]*\).*/\1/p' pr.txt > pr_number.txt
PRNUMBER=$(cat pr_number.txt)
gh pr merge $PRNUMBER --squash
fi
generate_bindings:
name: Bindings - Synchronise
permissions:
contents: write
pull-requests: write
runs-on: ubuntu-latest
steps:
- name: Checkout
uses: actions/checkout@v4
with:
ref: ${{ github.head_ref || github.ref_name }}
- name: Rust Cache
if: ${{ needs.check-needs-run.outputs.any-changes == 'true' }}
uses: Swatinem/rust-cache@v2.7.7
with:
# reasoning: we want to cache xtask, most of the jobs in the matrix will be sped up a good bit thanks to that
save-if: ${{ github.ref == 'refs/heads/main' }}
cache-all-crates: true
- name: Setup Bot GitHub Credentials
run: |
git config user.name "github-actions[bot]"
git config user.email "41898282+github-actions[bot]@users.noreply.github.com"
- name: Setup
run: |
cargo xtask init
- name: Generate Bindings
run: |
cargo xtask codegen
- name: Check for changes
id: check_changes
run: |
if [[ -n $(git status --porcelain) ]]; then
echo "changes=true" >> "$GITHUB_OUTPUT";
fi
- name: Commit Changes
if: steps.check_changes.outputs.changes
run: |
git add -A
git commit -m "chore(codegen): update bevy bindings"
git push
Morty Proxy This is a proxified and sanitized view of the page, visit original site.