Skip to content

Commit c099807

Browse files
committed
merged changes
2 parents e3a899c + 651bcd3 commit c099807

File tree

346 files changed

+45693
-32803
lines changed

Some content is hidden

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

346 files changed

+45693
-32803
lines changed

.github/ISSUE_TEMPLATE/bug_report.md

Lines changed: 17 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,17 @@
1+
---
2+
name: Bug report
3+
about: Create a report to help us improve
4+
title: ":bug: {insert concise and search friendly title}"
5+
labels: bug
6+
assignees: ''
7+
8+
---
9+
10+
## Summary
11+
**summarise what problem you found and why it's a bug**
12+
13+
## Reproducing
14+
**add any information that will help with reproducing the bug**
15+
16+
## Additional Data
17+
**insert screenshots, bms + bevy trace/debug logs if possible**
Lines changed: 20 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,20 @@
1+
---
2+
name: Feature request
3+
about: Suggest an idea for this project
4+
title: ''
5+
labels: ''
6+
assignees: ''
7+
8+
---
9+
10+
**Is your feature request related to a problem? Please describe.**
11+
A clear and concise description of what the problem is. Ex. I'm always frustrated when [...]
12+
13+
**Describe the solution you'd like**
14+
A clear and concise description of what you want to happen.
15+
16+
**Describe alternatives you've considered**
17+
A clear and concise description of any alternative solutions or features you've considered.
18+
19+
**Additional context**
20+
Add any other context or screenshots about the feature request here.
Lines changed: 14 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,14 @@
1+
---
2+
name: Request New Language
3+
about: Request support for an additional language
4+
title: ":sparkles: Support `{enter language name}`"
5+
labels: language request
6+
assignees: ''
7+
8+
---
9+
10+
## Summary
11+
**name the language, describe it, provide links to it, explain why it'd be beneficial for consumers of this crate**
12+
13+
## Feasibilty
14+
**explain how the language fulfils the feasibility criteria over at: https://makspll.github.io/bevy_mod_scripting/Development/AddingLanguages/evaluating-feasibility.html**

.github/pull_request_template.md

Lines changed: 25 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,25 @@
1+
# Summary
2+
- enter PR summary here
3+
- what did you change
4+
- why did you do it this way?
5+
- Are there alternative ways we need to keep in mind?
6+
7+
## Testing (Read & Delete Me)
8+
- Did you write tests to cover new or modified behavior?
9+
- These are not necessary, but very welcome
10+
- I am always happy to receive any PR's, but adding tests makes it easier for me to merge them!
11+
12+
## Conventional PR Titles (Read & Delete me)
13+
- This crate uses `release-plz` to manage our deploys
14+
- A CI check will verify your PR title to make sure it uses a valid conventional prefix like:
15+
- `feat: {title}` - corresponds to `Added` heading in changelog, backwards compatibile changes
16+
- `fix: {title}` - corresponds to `Fixed` heading in changelog, fixes bugs or bad behavior
17+
- `chore: {title}` - does not appear in the changelog, useful for "meta" work that doesn't affect the API
18+
- `docs: {title}` - does not appear in the changelog, for docuemntation changes.
19+
- `tests: {title}` - does not appear in changelog, purely adds or changes tests.
20+
- Adding a `!` before the `:` will signify this is also a breaking change
21+
- This sort of change will cause a `MAJOR` version bump.
22+
- You can also use scopes to further detail the area your PR is changing i.e.:
23+
- `feat(ladfile): add global types`
24+
- `fix(ladfile_builder): fix globals not getting exported`
25+
- `docs(bms): document weird vector behavior on MacOS`

.github/workflows/bevy_mod_scripting.yml

Lines changed: 77 additions & 33 deletions
Original file line numberDiff line numberDiff line change
@@ -3,15 +3,9 @@ on:
33
branches:
44
- main
55
- staging
6-
paths-ignore:
7-
- '.github/workflows/release-plz.yml'
8-
- 'docs/**'
96
pull_request:
107
branches:
118
- "**"
12-
paths-ignore:
13-
- '.github/workflows/release-plz.yml'
14-
- 'docs/**'
159

1610

1711
name: CI
@@ -31,6 +25,31 @@ concurrency:
3125
cancel-in-progress: true
3226

3327
jobs:
28+
29+
check-needs-run:
30+
runs-on: ubuntu-latest
31+
outputs:
32+
any-changes: ${{ steps.changes.outputs.src }}
33+
permissions:
34+
pull-requests: read
35+
contents: read
36+
steps:
37+
- name: Checkout
38+
uses: actions/checkout@v4
39+
- uses: dorny/paths-filter@v3
40+
id: changes
41+
with:
42+
base: main
43+
filters: |
44+
src:
45+
- 'src/**'
46+
- 'crates/**'
47+
- 'examples/**'
48+
- 'assets/**'
49+
- 'docs/**'
50+
- '.github/workflows/bevy_mod_scripting.yml'
51+
52+
3453
generate-job-matrix:
3554
runs-on: ubuntu-latest
3655
# container: ${{ env.REGISTRY }}/${{ env.IMAGE_NAME }}:latest
@@ -39,6 +58,12 @@ jobs:
3958
steps:
4059
- name: Checkout
4160
uses: actions/checkout@v4
61+
- name: Rust Cache
62+
uses: Swatinem/[email protected]
63+
with:
64+
# reasoning: we want to cache xtask, most of the jobs in the matrix will be sped up a good bit thanks to that
65+
save-if: ${{ github.ref == 'refs/heads/main' }}
66+
cache-all-crates: true
4267
- name: Generate matrix
4368
id: generate-matrix
4469
run: |
@@ -49,52 +74,75 @@ jobs:
4974
echo "matrix=$(cat matrix-one-line.json)" >> $GITHUB_OUTPUT
5075
5176
check:
77+
needs: [check-needs-run, generate-job-matrix]
5278
permissions:
5379
pull-requests: write
5480
contents: write
5581
issues: write
5682
name: Check - ${{ matrix.run_args.name }}
5783
runs-on: ${{ matrix.run_args.os }}
58-
# container: ${{ env.REGISTRY }}/${{ env.IMAGE_NAME }}:latest
59-
needs:
60-
- generate-job-matrix
6184
strategy:
6285
matrix:
6386
run_args: ${{fromJson(needs.generate-job-matrix.outputs.matrix)}}
6487
steps:
88+
# - name: Free Disk Space (Ubuntu)
89+
# if: runner.os == 'Linux'
90+
# uses: jlumbroso/free-disk-space@main
91+
# with:
92+
# tool-cache: false
93+
# android: true
94+
# dotnet: true
95+
# haskell: true
96+
# large-packages: true
97+
# docker-images: true
98+
# swap-storage: true
99+
# # - if: runner.os == 'linux'
100+
# # run: |
101+
# # sudo rm -rf /usr/share/dotnet; sudo rm -rf /opt/ghc; sudo rm -rf "/usr/local/share/boost"; sudo rm -rf "$AGENT_TOOLSDIRECTORY"
65102
- name: Checkout
103+
if: ${{ needs.check-needs-run.outputs.any-changes == 'true' }}
66104
uses: actions/checkout@v4
67-
68-
- name: Install alsa and udev
69-
if: runner.os == 'linux'
70-
run: |
71-
sudo apt-get update; sudo apt-get install --no-install-recommends libasound2-dev libudev-dev
72-
sudo rm -rf /usr/share/dotnet; sudo rm -rf /opt/ghc; sudo rm -rf "/usr/local/share/boost"; sudo rm -rf "$AGENT_TOOLSDIRECTORY"
73105
- uses: actions-rs/toolchain@v1
106+
if: ${{ needs.check-needs-run.outputs.any-changes == 'true' }}
74107
with:
75108
toolchain: stable
76109
override: true
77-
78110
- name: Rust Cache
79-
uses: Swatinem/[email protected]
111+
if: ${{ needs.check-needs-run.outputs.any-changes == 'true' }}
112+
uses: Swatinem/[email protected]
113+
with:
114+
# reasoning: we want to cache xtask, most of the jobs in the matrix will be sped up a good bit thanks to that
115+
save-if: ${{ github.ref == 'refs/heads/main' }}
116+
cache-all-crates: true
80117

81118
- name: Setup
119+
if: ${{ needs.check-needs-run.outputs.any-changes == 'true' }}
82120
run: |
83121
cargo xtask init
84122
123+
- name: Setup GPU Drivers
124+
if: ${{ needs.check-needs-run.outputs.any-changes == 'true' && matrix.run_args.requires_gpu }}
125+
run: |
126+
sudo add-apt-repository ppa:kisak/turtle -y
127+
sudo apt-get install --no-install-recommends libxkbcommon-x11-0 xvfb libgl1-mesa-dri libxcb-xfixes0-dev mesa-vulkan-drivers
85128
- name: Check
129+
if: ${{ needs.check-needs-run.outputs.any-changes == 'true' && !matrix.run_args.requires_gpu }}
86130
run: |
87131
${{ matrix.run_args.command }}
132+
- name: Check With virtual X11 server
133+
if: ${{ needs.check-needs-run.outputs.any-changes == 'true' && matrix.run_args.requires_gpu }}
134+
run: |
135+
xvfb-run ${{ matrix.run_args.command }}
88136
89137
- name: Upload coverage artifact
90-
if: ${{ matrix.run_args.generates_coverage }}
138+
if: ${{ needs.check-needs-run.outputs.any-changes == 'true' && matrix.run_args.generates_coverage }}
91139
uses: actions/upload-artifact@v4
92140
with:
93141
name: code-coverage-report
94142
path: target/coverage/html/
95143

96144
- name: Update coverage badge
97-
if: ${{ matrix.run_args.generates_coverage }}
145+
if: ${{ needs.check-needs-run.outputs.any-changes == 'true' && matrix.run_args.generates_coverage }}
98146
continue-on-error: true
99147
run: |
100148
git checkout -b chore/_update-coverage-badge || git checkout chore/_update-coverage-badge
@@ -122,6 +170,15 @@ jobs:
122170
steps:
123171
- name: Checkout
124172
uses: actions/checkout@v4
173+
with:
174+
ref: ${{ github.head_ref || github.ref_name }}
175+
- name: Rust Cache
176+
if: ${{ needs.check-needs-run.outputs.any-changes == 'true' }}
177+
uses: Swatinem/[email protected]
178+
with:
179+
# reasoning: we want to cache xtask, most of the jobs in the matrix will be sped up a good bit thanks to that
180+
save-if: ${{ github.ref == 'refs/heads/main' }}
181+
cache-all-crates: true
125182
- name: Setup Bot GitHub Credentials
126183
run: |
127184
git config user.name "github-actions[bot]"
@@ -141,19 +198,6 @@ jobs:
141198
- name: Commit Changes
142199
if: steps.check_changes.outputs.changes
143200
run: |
144-
git checkout -b ${{ env.CODEGEN_BRANCH_NAME }} || git checkout ${{ env.CODEGEN_BRANCH_NAME }}
145201
git add -A
146202
git commit -m "chore(codegen): update bevy bindings"
147-
git push -u origin ${{ env.CODEGEN_BRANCH_NAME }} --force
148-
- uses: jwalton/gh-find-current-pr@master
149-
if: steps.check_changes.outputs.changes
150-
id: findPR
151-
with:
152-
state: all
153-
- name: Create Or Update PR
154-
if: steps.check_changes.outputs.changes && success() && steps.findPR.outputs.number
155-
run: |
156-
gh pr list --base ${{ github.ref }} --search "chore(codegen): update bevy bindings" --json number > prs.json
157-
if [ $(jq '. | length' prs.json) -eq 0 ]; then
158-
gh pr create --title "chore(codegen): update bevy bindings" --body "This PR updates the bevy bindings for #${{ steps.findPR.outputs.number }}" --base ${{ github.ref }} --head ${{ env.CODEGEN_BRANCH_NAME }} || true
159-
fi
203+
git push

.github/workflows/mdbook.yml

Lines changed: 8 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -7,12 +7,14 @@ on:
77
- staging
88
paths:
99
- 'docs/**'
10+
- 'crates/xtask/**'
1011
- '.github/workflows/mdbook.yml'
1112
pull_request:
1213
branches:
1314
- "**"
1415
paths:
1516
- 'docs/**'
17+
- 'crates/xtask/**'
1618
- '.github/workflows/mdbook.yml'
1719

1820
jobs:
@@ -35,11 +37,14 @@ jobs:
3537
- name: Rust Cache
3638
uses: Swatinem/[email protected]
3739

38-
- name: Install mdBook
39-
run: cargo install mdbook
40+
- name: Setup xtask & GPU drivers
41+
run: |
42+
cargo xtask init --dont-update-ide
43+
sudo add-apt-repository ppa:kisak/turtle -y
44+
sudo apt-get install --no-install-recommends libxkbcommon-x11-0 xvfb libgl1-mesa-dri libxcb-xfixes0-dev mesa-vulkan-drivers
4045
4146
- name: Build the book
42-
run: cd docs && mdbook build
47+
run: xvfb-run cargo xtask docs --no-rust-docs
4348

4449
- name: Deploy to GitHub Pages
4550
if: github.ref == 'refs/heads/main' || github.ref == 'refs/heads/staging'
Lines changed: 57 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,57 @@
1+
name: Missing Documentation Reminder
2+
3+
on:
4+
workflow_dispatch:
5+
push:
6+
branches:
7+
- main
8+
9+
jobs:
10+
find-missing-documentation:
11+
permissions:
12+
contents: read
13+
pull-requests: read
14+
issues: write
15+
runs-on: ubuntu-latest
16+
steps:
17+
- uses: actions/checkout@v4
18+
19+
- name: Find closed PRs with 'needs documentation' label
20+
uses: actions/github-script@v6
21+
id: find-prs
22+
with:
23+
script: |
24+
25+
const query = `repo:makspll/bevy_mod_scripting is:closed label:"needs documentation"`;
26+
const encodedQuery = encodeURIComponent(query);
27+
28+
console.log(encodedQuery);
29+
30+
const { data: { items: pullRequests } } = await github.rest.search.issuesAndPullRequests({
31+
q: query,
32+
per_page: 100
33+
});
34+
35+
console.log(pullRequests)
36+
37+
const prsNeedingDocs = pullRequests.map(pr => `- [ ] ${pr.html_url} by @${pr.user.login}`).join("\n");
38+
if (!prsNeedingDocs) {
39+
return "- [x] All PRs with 'needs documentation' label have been updated in the book.";
40+
} else {
41+
return prsNeedingDocs;
42+
}
43+
result-encoding: string
44+
45+
- name: Update Issue Body
46+
uses: julien-deramond/update-issue-body@v1
47+
with:
48+
issue-number: 255
49+
body: |
50+
This is an automatically generated issue.
51+
52+
The following PRs have been closed but still need updates in the book:
53+
${{ steps.find-prs.outputs.result }}
54+
55+
If you are an author of one of these PRs, please consider updating the boook in `/docs` with appropriate documentation.
56+
Thank you!
57+
edit-mode: replace

.github/workflows/pr-titles.yml

Lines changed: 7 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -25,4 +25,10 @@ jobs:
2525
feat
2626
chore
2727
test
28-
docs
28+
docs
29+
refactor
30+
31+
scopes: |
32+
ladfile
33+
ladfile_builder
34+
bms

.github/workflows/release-plz.yml

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -66,4 +66,5 @@ jobs:
6666
command: release-pr
6767
env:
6868
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }}
69-
CARGO_REGISTRY_TOKEN: ${{ secrets.CARGO_REGISTRY_TOKEN }}
69+
CARGO_REGISTRY_TOKEN: ${{ secrets.CARGO_REGISTRY_TOKEN }}
70+
RELEASE_PLZ_LOG: DEBUG

.gitignore

Lines changed: 5 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -13,4 +13,8 @@ Cargo.lock
1313
**/doc
1414
assets/scripts/tlconfig.lua
1515
**.log
16-
**build/
16+
**build/
17+
.html
18+
19+
/assets/**/*.lad.json
20+
/docs/src/ladfiles/*.lad.json

0 commit comments

Comments
 (0)