Skip to content

Commit def0fa0

Browse files
committed
Merge branch 'main' of github.com:komadori/bevy into gltf-custom-attributes
2 parents 0527579 + 4a62afb commit def0fa0

File tree

575 files changed

+38661
-18283
lines changed

Some content is hidden

Large Commits have some content hidden by default. Use the searchbox below for content that may be hidden.

575 files changed

+38661
-18283
lines changed

.cargo/config_fast_builds

Lines changed: 12 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -7,13 +7,21 @@
77
linker = "clang"
88
rustflags = ["-Clink-arg=-fuse-ld=lld", "-Zshare-generics=y"]
99

10-
# NOTE: you must manually install https://github.com/michaeleisel/zld on mac. you can easily do this with the "brew" package manager:
11-
# `brew install michaeleisel/zld/zld`
10+
# NOTE: you must install [Mach-O LLD Port](https://lld.llvm.org/MachO/index.html) on mac. you can easily do this by installing llvm which includes lld with the "brew" package manager:
11+
# `brew install llvm`
1212
[target.x86_64-apple-darwin]
13-
rustflags = ["-C", "link-arg=-fuse-ld=/usr/local/bin/zld", "-Zshare-generics=y"]
13+
rustflags = [
14+
"-C",
15+
"link-arg=-fuse-ld=/usr/local/opt/llvm/bin/ld64.lld",
16+
"-Zshare-generics=y",
17+
]
1418

1519
[target.aarch64-apple-darwin]
16-
rustflags = ["-C", "link-arg=-fuse-ld=/opt/homebrew/bin/zld", "-Zshare-generics=y"]
20+
rustflags = [
21+
"-C",
22+
"link-arg=-fuse-ld=/opt/homebrew/opt/llvm/bin/ld64.lld",
23+
"-Zshare-generics=y",
24+
]
1725

1826
[target.x86_64-pc-windows-msvc]
1927
linker = "rust-lld.exe"

.github/FUNDING.yml

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,3 +1,3 @@
11
# These are supported funding model platforms
22

3-
github: cart
3+
custom: https://bevyengine.org/community/donate/

.github/bors.toml

Lines changed: 0 additions & 24 deletions
This file was deleted.

.github/contributing/example_style_guide.md

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -38,7 +38,7 @@ For more advice on writing examples, see the [relevant section](../../CONTRIBUTI
3838
4. In Queries, prefer `With<T>` filters over actually fetching unused data with `&T`.
3939
5. Prefer disjoint queries using `With` and `Without` over param sets when you need more than one query in a single system.
4040
6. Prefer structs with named fields over tuple structs except in the case of single-field wrapper types.
41-
7. Use enum-labels over string-labels for system / stage / etc. labels.
41+
7. Use enum-labels over string-labels for app / schedule / etc. labels.
4242

4343
## "Feature" examples
4444

Lines changed: 30 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,30 @@
1+
name: Action on PR labeled
2+
3+
# This workflow has write permissions on the repo
4+
# It must not checkout a PR and run untrusted code
5+
6+
on:
7+
pull_request_target:
8+
types:
9+
- labeled
10+
11+
permissions:
12+
pull-requests: 'write'
13+
14+
jobs:
15+
comment-on-breaking-change-label:
16+
runs-on: ubuntu-latest
17+
if: github.event.label.name == 'C-Breaking-Change' && !contains(github.event.pull_request.body, '## Migration Guide')
18+
steps:
19+
- uses: actions/github-script@v6
20+
with:
21+
script: |
22+
await github.rest.issues.createComment({
23+
issue_number: context.issue.number,
24+
owner: context.repo.owner,
25+
repo: context.repo.repo,
26+
body: `It looks like your PR is a breaking change, but you didn't provide a migration guide.
27+
28+
Could you add some context on what users should update when this change get released in a new version of Bevy?
29+
It will be used to help writing the migration guide for the version. Putting it after a \`## Migration Guide\` will help it get automatically picked up by our tooling.`
30+
})
Lines changed: 228 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,228 @@
1+
name: CI - PR Comments
2+
3+
# This workflow has write permissions on the repo
4+
# It must not checkout a PR and run untrusted code
5+
6+
# Also requesting write permissions on PR to be able to comment
7+
permissions:
8+
pull-requests: 'write'
9+
10+
on:
11+
workflow_run:
12+
workflows: ["CI"]
13+
types:
14+
- completed
15+
16+
jobs:
17+
example-run:
18+
runs-on: ubuntu-latest
19+
if: >
20+
github.event.workflow_run.event == 'pull_request' &&
21+
github.event.workflow_run.conclusion == 'failure'
22+
steps:
23+
- name: 'Download artifact'
24+
id: find-artifact
25+
uses: actions/github-script@v6
26+
with:
27+
result-encoding: string
28+
script: |
29+
var artifacts = await github.rest.actions.listWorkflowRunArtifacts({
30+
owner: context.repo.owner,
31+
repo: context.repo.repo,
32+
run_id: ${{github.event.workflow_run.id }},
33+
});
34+
var matchArtifacts = artifacts.data.artifacts.filter((artifact) => {
35+
return artifact.name == "example-run"
36+
});
37+
if (matchArtifacts.length == 0) { return "false" }
38+
var matchArtifact = matchArtifacts[0];
39+
var download = await github.rest.actions.downloadArtifact({
40+
owner: context.repo.owner,
41+
repo: context.repo.repo,
42+
artifact_id: matchArtifact.id,
43+
archive_format: 'zip',
44+
});
45+
var fs = require('fs');
46+
fs.writeFileSync('${{github.workspace}}/example-run.zip', Buffer.from(download.data));
47+
return "true"
48+
- run: unzip example-run.zip
49+
if: ${{ steps.find-artifact.outputs.result == 'true' }}
50+
- name: 'Comment on PR'
51+
if: ${{ steps.find-artifact.outputs.result == 'true' }}
52+
uses: actions/github-script@v6
53+
with:
54+
github-token: ${{ secrets.GITHUB_TOKEN }}
55+
script: |
56+
var fs = require('fs');
57+
var issue_number = Number(fs.readFileSync('./NR'));
58+
var last_example_run = fs.readFileSync('./last_example_run');
59+
await github.rest.issues.createComment({
60+
owner: context.repo.owner,
61+
repo: context.repo.repo,
62+
issue_number: issue_number,
63+
body: 'Example `' + last_example_run + '` failed to run, please try running it locally and check the result.'
64+
});
65+
66+
missing-examples:
67+
runs-on: ubuntu-latest
68+
if: >
69+
github.event.workflow_run.event == 'pull_request' &&
70+
github.event.workflow_run.conclusion == 'failure'
71+
steps:
72+
- name: 'Download artifact'
73+
id: find-artifact
74+
uses: actions/github-script@v6
75+
with:
76+
result-encoding: string
77+
script: |
78+
var artifacts = await github.rest.actions.listWorkflowRunArtifacts({
79+
owner: context.repo.owner,
80+
repo: context.repo.repo,
81+
run_id: ${{github.event.workflow_run.id }},
82+
});
83+
var matchArtifacts = artifacts.data.artifacts.filter((artifact) => {
84+
return artifact.name == "missing-examples"
85+
});
86+
if (matchArtifacts.length == 0) { return "false" }
87+
var matchArtifact = matchArtifacts[0];
88+
var download = await github.rest.actions.downloadArtifact({
89+
owner: context.repo.owner,
90+
repo: context.repo.repo,
91+
artifact_id: matchArtifact.id,
92+
archive_format: 'zip',
93+
});
94+
var fs = require('fs');
95+
fs.writeFileSync('${{github.workspace}}/missing-examples.zip', Buffer.from(download.data));
96+
return "true"
97+
- run: unzip missing-examples.zip
98+
if: ${{ steps.find-artifact.outputs.result == 'true' }}
99+
- name: 'Comment on PR'
100+
if: ${{ steps.find-artifact.outputs.result == 'true' }}
101+
uses: actions/github-script@v6
102+
with:
103+
github-token: ${{ secrets.GITHUB_TOKEN }}
104+
script: |
105+
var fs = require('fs');
106+
var issue_number = Number(fs.readFileSync('./NR'));
107+
if (fs.existsSync('./missing-metadata')) {
108+
await github.rest.issues.createComment({
109+
owner: context.repo.owner,
110+
repo: context.repo.repo,
111+
issue_number: issue_number,
112+
body: 'You added a new example but didn\'t add metadata for it. Please update the root Cargo.toml file.'
113+
});
114+
}
115+
if (fs.existsSync('./missing-update')) {
116+
await github.rest.issues.createComment({
117+
owner: context.repo.owner,
118+
repo: context.repo.repo,
119+
issue_number: issue_number,
120+
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.'
121+
});
122+
}
123+
124+
missing-features:
125+
runs-on: ubuntu-latest
126+
if: >
127+
github.event.workflow_run.event == 'pull_request' &&
128+
github.event.workflow_run.conclusion == 'failure'
129+
steps:
130+
- name: 'Download artifact'
131+
id: find-artifact
132+
uses: actions/github-script@v6
133+
with:
134+
result-encoding: string
135+
script: |
136+
var artifacts = await github.rest.actions.listWorkflowRunArtifacts({
137+
owner: context.repo.owner,
138+
repo: context.repo.repo,
139+
run_id: ${{github.event.workflow_run.id }},
140+
});
141+
var matchArtifacts = artifacts.data.artifacts.filter((artifact) => {
142+
return artifact.name == "missing-features"
143+
});
144+
if (matchArtifacts.length == 0) { return "false" }
145+
var matchArtifact = matchArtifacts[0];
146+
var download = await github.rest.actions.downloadArtifact({
147+
owner: context.repo.owner,
148+
repo: context.repo.repo,
149+
artifact_id: matchArtifact.id,
150+
archive_format: 'zip',
151+
});
152+
var fs = require('fs');
153+
fs.writeFileSync('${{github.workspace}}/missing-features.zip', Buffer.from(download.data));
154+
return "true"
155+
- run: unzip missing-features.zip
156+
if: ${{ steps.find-artifact.outputs.result == 'true' }}
157+
- name: 'Comment on PR'
158+
if: ${{ steps.find-artifact.outputs.result == 'true' }}
159+
uses: actions/github-script@v6
160+
with:
161+
github-token: ${{ secrets.GITHUB_TOKEN }}
162+
script: |
163+
var fs = require('fs');
164+
var issue_number = Number(fs.readFileSync('./NR'));
165+
if (fs.existsSync('./missing-features')) {
166+
await github.rest.issues.createComment({
167+
owner: context.repo.owner,
168+
repo: context.repo.repo,
169+
issue_number: issue_number,
170+
body: 'You added a new feature but didn\'t add a description for it. Please update the root Cargo.toml file.'
171+
});
172+
}
173+
if (fs.existsSync('./missing-update')) {
174+
await github.rest.issues.createComment({
175+
owner: context.repo.owner,
176+
repo: context.repo.repo,
177+
issue_number: issue_number,
178+
body: 'You added a new feature but didn\'t update the readme. Please run `cargo run -p build-templated-pages -- update features` to update it, and commit the file change.'
179+
});
180+
}
181+
182+
msrv:
183+
runs-on: ubuntu-latest
184+
if: >
185+
github.event.workflow_run.event == 'pull_request' &&
186+
github.event.workflow_run.conclusion == 'failure'
187+
steps:
188+
- name: 'Download artifact'
189+
id: find-artifact
190+
uses: actions/github-script@v6
191+
with:
192+
result-encoding: string
193+
script: |
194+
var artifacts = await github.rest.actions.listWorkflowRunArtifacts({
195+
owner: context.repo.owner,
196+
repo: context.repo.repo,
197+
run_id: ${{github.event.workflow_run.id }},
198+
});
199+
var matchArtifacts = artifacts.data.artifacts.filter((artifact) => {
200+
return artifact.name == "msrv"
201+
});
202+
if (matchArtifacts.length == 0) { return "false" }
203+
var matchArtifact = matchArtifacts[0];
204+
var download = await github.rest.actions.downloadArtifact({
205+
owner: context.repo.owner,
206+
repo: context.repo.repo,
207+
artifact_id: matchArtifact.id,
208+
archive_format: 'zip',
209+
});
210+
var fs = require('fs');
211+
fs.writeFileSync('${{github.workspace}}/msrv.zip', Buffer.from(download.data));
212+
return "true"
213+
- run: unzip msrv.zip
214+
if: ${{ steps.find-artifact.outputs.result == 'true' }}
215+
- name: 'Comment on PR'
216+
if: ${{ steps.find-artifact.outputs.result == 'true' }}
217+
uses: actions/github-script@v6
218+
with:
219+
github-token: ${{ secrets.GITHUB_TOKEN }}
220+
script: |
221+
var fs = require('fs');
222+
var issue_number = Number(fs.readFileSync('./NR'));
223+
await github.rest.issues.createComment({
224+
owner: context.repo.owner,
225+
repo: context.repo.repo,
226+
issue_number: issue_number,
227+
body: 'Your PR increases Bevy Minimum Supported Rust Version. Please update the `rust-version` field in the root Cargo.toml file.'
228+
});

0 commit comments

Comments
 (0)