Skip to content

Commit

Permalink
Merge branch 'main' into quat-reflect-struct
Browse files Browse the repository at this point in the history
  • Loading branch information
alice-i-cecile authored Oct 2, 2023
2 parents 2ecb178 + 21518de commit 17afe01
Show file tree
Hide file tree
Showing 646 changed files with 31,973 additions and 18,835 deletions.
50 changes: 1 addition & 49 deletions .github/workflows/ci-comment-failures.yml
Original file line number Diff line number Diff line change
Expand Up @@ -14,54 +14,6 @@ on:
- completed

jobs:
example-run:
runs-on: ubuntu-latest
if: >
github.event.workflow_run.event == 'pull_request' &&
github.event.workflow_run.conclusion == 'failure'
steps:
- name: 'Download artifact'
id: find-artifact
uses: actions/github-script@v6
with:
result-encoding: string
script: |
var artifacts = await github.rest.actions.listWorkflowRunArtifacts({
owner: context.repo.owner,
repo: context.repo.repo,
run_id: ${{github.event.workflow_run.id }},
});
var matchArtifacts = artifacts.data.artifacts.filter((artifact) => {
return artifact.name == "example-run"
});
if (matchArtifacts.length == 0) { return "false" }
var matchArtifact = matchArtifacts[0];
var download = await github.rest.actions.downloadArtifact({
owner: context.repo.owner,
repo: context.repo.repo,
artifact_id: matchArtifact.id,
archive_format: 'zip',
});
var fs = require('fs');
fs.writeFileSync('${{github.workspace}}/example-run.zip', Buffer.from(download.data));
return "true"
- run: unzip example-run.zip
if: ${{ steps.find-artifact.outputs.result == 'true' }}
- name: 'Comment on PR'
if: ${{ steps.find-artifact.outputs.result == 'true' }}
uses: actions/github-script@v6
with:
github-token: ${{ secrets.GITHUB_TOKEN }}
script: |
var fs = require('fs');
var issue_number = Number(fs.readFileSync('./NR'));
var last_example_run = fs.readFileSync('./last_example_run');
await github.rest.issues.createComment({
owner: context.repo.owner,
repo: context.repo.repo,
issue_number: issue_number,
body: 'Example `' + last_example_run + '` failed to run, please try running it locally and check the result.'
});

missing-examples:
runs-on: ubuntu-latest
Expand Down Expand Up @@ -117,7 +69,7 @@ jobs:
owner: context.repo.owner,
repo: context.repo.repo,
issue_number: issue_number,
body: 'You added a new example but didn\'t update the readme. Please run `cargo run -p build-templated-pages -- update examples` to update it, and commit the file change.'
body: 'The generated `examples/README.md` is out of sync with the example metadata in `Cargo.toml` or the example readme template. Please run `cargo run -p build-templated-pages -- update examples` to update it, and commit the file change.'
});
}
Expand Down
103 changes: 46 additions & 57 deletions .github/workflows/ci.yml
Original file line number Diff line number Diff line change
Expand Up @@ -19,7 +19,7 @@ jobs:
runs-on: ${{ matrix.os }}
timeout-minutes: 30
steps:
- uses: actions/checkout@v3
- uses: actions/checkout@v4
- uses: actions/cache@v3
with:
path: |
Expand All @@ -44,7 +44,7 @@ jobs:
runs-on: ubuntu-latest
timeout-minutes: 30
steps:
- uses: actions/checkout@v3
- uses: actions/checkout@v4
- uses: actions/cache@v3
with:
path: |
Expand All @@ -67,7 +67,7 @@ jobs:
runs-on: ubuntu-latest
timeout-minutes: 60
steps:
- uses: actions/checkout@v3
- uses: actions/checkout@v4
- uses: actions/cache@v3
with:
path: |
Expand Down Expand Up @@ -101,7 +101,7 @@ jobs:
timeout-minutes: 30
needs: ci
steps:
- uses: actions/checkout@v3
- uses: actions/checkout@v4
- uses: actions/cache@v3
with:
path: |
Expand All @@ -127,7 +127,7 @@ jobs:
timeout-minutes: 30
needs: build
steps:
- uses: actions/checkout@v3
- uses: actions/checkout@v4
- uses: actions/cache@v3
with:
path: |
Expand All @@ -151,7 +151,7 @@ jobs:
needs: check-missing-features-in-docs
if: always()
steps:
- uses: actions/checkout@v3
- uses: actions/checkout@v4
with:
# Full git history is needed to get a proper list of changed files within `super-linter`
fetch-depth: 0
Expand All @@ -163,22 +163,14 @@ jobs:
VALIDATE_MARKDOWN: true
DEFAULT_BRANCH: main

run-examples:
runs-on: ubuntu-latest
timeout-minutes: 30
run-examples-on-windows-dx12:
runs-on: windows-latest
timeout-minutes: 60
steps:
- name: Install Bevy dependencies
run: |
sudo apt-get update;
DEBIAN_FRONTEND=noninteractive sudo apt-get install --no-install-recommends -yq \
libasound2-dev libudev-dev;
- name: install xvfb, llvmpipe and lavapipe
run: |
sudo apt-get update -y -qq
sudo add-apt-repository ppa:oibaf/graphics-drivers -y
sudo apt-get update
sudo apt install -y xvfb libegl1-mesa libgl1-mesa-dri libxcb-xfixes0-dev mesa-vulkan-drivers
- uses: actions/checkout@v3
- uses: actions/checkout@v4

- uses: dtolnay/rust-toolchain@stable

- uses: actions/cache@v3
with:
path: |
Expand All @@ -187,54 +179,29 @@ jobs:
~/.cargo/registry/cache/
~/.cargo/git/db/
target/
key: ${{ runner.os }}-cargo-run-examples-${{ hashFiles('**/Cargo.toml') }}
- uses: dtolnay/rust-toolchain@stable
key: ${{ runner.os }}-windows-run-examples-${{ hashFiles('**/Cargo.toml') }}

- name: Build bevy
shell: bash
# this uses the same command as when running the example to ensure build is reused
run: |
TRACE_CHROME=trace-alien_cake_addict.json CI_TESTING_CONFIG=.github/example-run/alien_cake_addict.ron cargo build --example alien_cake_addict --features "bevy_ci_testing,trace,trace_chrome"
WGPU_BACKEND=dx12 CI_TESTING_CONFIG=.github/example-run/alien_cake_addict.ron cargo build --example alien_cake_addict --features "bevy_ci_testing"
- name: Run examples
shell: bash
run: |
for example in .github/example-run/*.ron; do
example_name=`basename $example .ron`
echo -n $example_name > last_example_run
echo "running $example_name - "`date`
time TRACE_CHROME=trace-$example_name.json CI_TESTING_CONFIG=$example xvfb-run cargo run --example $example_name --features "bevy_ci_testing,trace,trace_chrome"
time WGPU_BACKEND=dx12 CI_TESTING_CONFIG=$example cargo run --example $example_name --features "bevy_ci_testing"
sleep 10
if [ `find ./ -maxdepth 1 -name 'screenshot-*.png' -print -quit` ]; then
mkdir screenshots-$example_name
mv screenshot-*.png screenshots-$example_name/
fi
done
zip traces.zip trace*.json
zip -r screenshots.zip screenshots-*
- name: save traces
uses: actions/upload-artifact@v3
with:
name: example-traces.zip
path: traces.zip
- name: save screenshots
uses: actions/upload-artifact@v3
with:
name: screenshots.zip
path: screenshots.zip
- name: Save PR number
if: ${{ failure() && github.event_name == 'pull_request' }}
run: |
mkdir -p ./example-run
echo ${{ github.event.number }} > ./example-run/NR
mv last_example_run ./example-run/
- uses: actions/upload-artifact@v2
if: ${{ failure() && github.event_name == 'pull_request' }}
with:
name: example-run
path: example-run/
check-doc:
runs-on: ubuntu-latest
timeout-minutes: 30
steps:
- uses: actions/checkout@v3
- uses: actions/checkout@v4
- uses: actions/cache@v3
with:
path: |
Expand Down Expand Up @@ -266,7 +233,7 @@ jobs:
runs-on: ubuntu-latest
timeout-minutes: 30
steps:
- uses: actions/checkout@v3
- uses: actions/checkout@v4
- name: check for missing metadata
id: missing-metadata
run: cargo run -p build-templated-pages -- check-missing examples
Expand Down Expand Up @@ -300,7 +267,7 @@ jobs:
timeout-minutes: 30
needs: check-missing-examples-in-docs
steps:
- uses: actions/checkout@v3
- uses: actions/checkout@v4
- name: check for missing features
id: missing-features
run: cargo run -p build-templated-pages -- check-missing features
Expand Down Expand Up @@ -334,7 +301,7 @@ jobs:
timeout-minutes: 30
needs: build
steps:
- uses: actions/checkout@v3
- uses: actions/checkout@v4
- uses: actions/cache@v3
with:
path: |
Expand Down Expand Up @@ -366,3 +333,25 @@ jobs:
with:
name: msrv
path: msrv/

check-bevy-internal-imports:
runs-on: ubuntu-latest
timeout-minutes: 30
steps:
- uses: actions/checkout@v4
- name: Check for bevy_internal imports
shell: bash
run: |
errors=""
for file in $(find examples tests -name '*.rs'); do
if grep -q "use bevy_internal" "$file"; then
errors+="ERROR: Detected 'use bevy_internal' in $file\n"
fi
done
if [ -n "$errors" ]; then
echo -e "$errors"
echo " Avoid importing bevy_internal, it should not be used directly"
echo " Fix the issue by replacing 'bevy_internal' with 'bevy'"
echo " Example: 'use bevy::sprite::MaterialMesh2dBundle;' instead of 'bevy_internal::sprite::MaterialMesh2dBundle;'"
exit 1
fi
19 changes: 16 additions & 3 deletions .github/workflows/daily.yml
Original file line number Diff line number Diff line change
Expand Up @@ -11,10 +11,11 @@ env:

jobs:
build-for-iOS:
if: github.repository == 'bevyengine/bevy'
runs-on: macos-latest
timeout-minutes: 30
steps:
- uses: actions/checkout@v3
- uses: actions/checkout@v4

- uses: dtolnay/rust-toolchain@stable

Expand All @@ -38,10 +39,11 @@ jobs:
-F "custom_id=$GITHUB_RUN_ID"
build-for-Android:
if: github.repository == 'bevyengine/bevy'
runs-on: ubuntu-latest
timeout-minutes: 30
steps:
- uses: actions/checkout@v3
- uses: actions/checkout@v4

- uses: dtolnay/rust-toolchain@stable

Expand All @@ -65,6 +67,7 @@ jobs:
-F "custom_id=$GITHUB_RUN_ID"
nonce:
if: github.repository == 'bevyengine/bevy'
runs-on: ubuntu-latest
timeout-minutes: 30
outputs:
Expand All @@ -74,6 +77,7 @@ jobs:
run: echo "result=${{ github.run_id }}-$(date +%s)" >> $GITHUB_OUTPUT

run:
if: github.repository == 'bevyengine/bevy'
runs-on: ubuntu-latest
timeout-minutes: 30
needs: [nonce, build-for-iOS, build-for-Android]
Expand All @@ -85,10 +89,18 @@ jobs:
include:
- device: "iPhone 13"
os_version: "15"
- device: "iPhone 14"
os_version: "16"
- device: "iPhone 15"
os_version: "17"
- device: "Xiaomi Redmi Note 11"
os_version: "11.0"
- device: "Google Pixel 6"
os_version: "12.0"
- device: "Samsung Galaxy S23"
os_version: "13.0"
steps:
- uses: actions/checkout@v3
- uses: actions/checkout@v4

- name: Run Example
run: |
Expand All @@ -112,6 +124,7 @@ jobs:
path: .github/start-mobile-example/*.png

check-result:
if: github.repository == 'bevyengine/bevy'
runs-on: ubuntu-latest
timeout-minutes: 30
needs: [run]
Expand Down
33 changes: 29 additions & 4 deletions .github/workflows/dependencies.yml
Original file line number Diff line number Diff line change
Expand Up @@ -19,7 +19,7 @@ jobs:
check-advisories:
runs-on: ubuntu-latest
steps:
- uses: actions/checkout@v3
- uses: actions/checkout@v4
- uses: dtolnay/rust-toolchain@stable
- name: Install cargo-deny
run: cargo install cargo-deny
Expand All @@ -29,17 +29,42 @@ jobs:
check-bans:
runs-on: ubuntu-latest
steps:
- uses: actions/checkout@v3
# on main, prepare a new cargo tree output and cache it
- name: On main, prepare new cargo tree cache
if: github.ref == 'refs/heads/main'
run: cargo tree --depth 3 > cargo-tree-from-main
- name: On main, save the new cargo tree cache
if: github.ref == 'refs/heads/main'
uses: actions/cache/save@v3
with:
path: cargo-tree-from-main
key: cargo-tree-from-main
# on other branch, restore the cached cargo tree output
- name: On PR, restore cargo tree cache
uses: actions/cache/restore@v3
if: github.ref != 'refs/heads/main'
with:
path: cargo-tree-from-main
key: cargo-tree-from-main
- uses: actions/checkout@v4
- uses: dtolnay/rust-toolchain@stable
# if not on main, check that the cargo tree output is unchanged
- name: Check if the cargo tree changed from main
if: github.ref != 'refs/heads/main'
continue-on-error: true
id: cargo-tree-changed
run: diff cargo-tree-from-main <(cargo tree --depth 3)
- name: Install cargo-deny
run: cargo install cargo-deny
# if the check was not a success (either skipped because on main or failed because of a change), run the check
- name: Check for banned and duplicated dependencies
if: steps.cargo-tree-changed.outcome != 'success'
run: cargo deny check bans

check-licenses:
runs-on: ubuntu-latest
steps:
- uses: actions/checkout@v3
- uses: actions/checkout@v4
- uses: dtolnay/rust-toolchain@stable
- name: Install cargo-deny
run: cargo install cargo-deny
Expand All @@ -49,7 +74,7 @@ jobs:
check-sources:
runs-on: ubuntu-latest
steps:
- uses: actions/checkout@v3
- uses: actions/checkout@v4
- uses: dtolnay/rust-toolchain@stable
- name: Install cargo-deny
run: cargo install cargo-deny
Expand Down
Loading

0 comments on commit 17afe01

Please sign in to comment.