Skip to content

feat: Complete Rewrite #183

New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Merged
merged 39 commits into from
Feb 1, 2025
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
Show all changes
39 commits
Select commit Hold shift + click to select a range
bbfda42
feat: complete plugin re-write
makspll Jan 5, 2025
b9ca7ae
chore: release v0.9.0-alpha.2 (#189)
github-actions[bot] Jan 5, 2025
eff1cc3
chore: replace wildcard import for uuid with fixed version
makspll Jan 5, 2025
e6f817c
chore: add lua publish feature to bevy_mod_scripting package
makspll Jan 5, 2025
fc03230
feat: make script contexts public (#193)
makspll Jan 8, 2025
7595742
feat: Improvements to BMS in multi-language context (#194)
makspll Jan 13, 2025
a61e9c6
chore: use matrix job generation from xtask in CI/CD (#198)
makspll Jan 13, 2025
5462a6e
chore: Improve CI/CD further (#199)
makspll Jan 13, 2025
f77f246
chore: fix release plz config
makspll Jan 13, 2025
099cdb3
chore: disable default features for cargo commands in xtask, move uns…
makspll Jan 13, 2025
d9bfc37
chore: don't add profile arg for fmt commands in xtask
makspll Jan 13, 2025
7921e19
chore: Fix bindings stability, order things more (#200)
makspll Jan 13, 2025
c1b6375
feat: Implement global namespace registration (#202)
makspll Jan 13, 2025
c109fb6
chore: release v0.9.0-alpha.3 (#203)
github-actions[bot] Jan 14, 2025
bc83c5a
fix: remove test time dependencies from functions (#204)
makspll Jan 14, 2025
39cf747
chore: Improve docs (#205)
makspll Jan 14, 2025
614431f
chore: fix edit url in mdbook (#207)
makspll Jan 14, 2025
7aedd1a
chore: Improve test coverage (#208)
makspll Jan 17, 2025
67b253d
chore: release v0.9.0-alpha.4 (#206)
github-actions[bot] Jan 17, 2025
b874050
fix: Fix missing functions in codegen (#210)
makspll Jan 19, 2025
ecf613d
chore: release v0.9.0-alpha.5 (#215)
github-actions[bot] Jan 19, 2025
eb1f46f
feat: Don't panic! (#216)
makspll Jan 19, 2025
6c92a68
chore: release v0.9.0-alpha.6 (#217)
github-actions[bot] Jan 19, 2025
9b9dd57
feat: Add component `upsert` function (#218)
makspll Jan 20, 2025
c9a6ffa
docs: Update docs for refactor (#221)
makspll Jan 20, 2025
f71561f
feat!: Remove `WorldCallbackAccess` & Combine context args for dynami…
makspll Jan 20, 2025
c71fa0a
chore: release v0.9.0-alpha.7 (#220)
github-actions[bot] Jan 20, 2025
b2c39d0
feat: Add world.with_or_insert_component_mut() (#223)
shanecelis Jan 22, 2025
361ca78
feat: re-implement rhai again (#222)
makspll Jan 24, 2025
dbfef74
feat: Add `optional` arguments to script functions (#225)
makspll Jan 25, 2025
db8a7c3
feat: Call custom `get` and `set` functions on the type when indexing…
makspll Jan 25, 2025
638aaea
feat: Add `functions` script method, and create function info scaffol…
makspll Jan 27, 2025
cc93c1e
feat: add `ScriptValue::Map` and create appropriate conversions in lu…
makspll Jan 27, 2025
70bad5a
chore: release v0.9.0-alpha.8 (#224)
github-actions[bot] Jan 28, 2025
f0dee39
fix: prevent allocation and component ID ranges from overlapping (#230)
makspll Jan 28, 2025
3ad3fcf
chore: release v0.9.0-alpha.9 (#231)
github-actions[bot] Jan 28, 2025
9629224
feat: Profiling First Draft (#232)
gallexme Jan 31, 2025
f1b93bd
docs: Update docs (#235)
makspll Feb 1, 2025
fc2e522
docs: Improve docs (#236)
makspll Feb 1, 2025
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
The table of contents is too big for display.
Diff view
Diff view
  •  
  •  
  •  
3 changes: 3 additions & 0 deletions .cargo/config.toml
Original file line number Diff line number Diff line change
@@ -1,2 +1,5 @@
[env]
TARGET_DIR = { value = "target", relative = true }

[alias]
xtask = "run --package xtask --"
133 changes: 0 additions & 133 deletions .github/workflows/bevy_api_gen.yml

This file was deleted.

223 changes: 117 additions & 106 deletions .github/workflows/bevy_mod_scripting.yml
Original file line number Diff line number Diff line change
@@ -1,17 +1,27 @@
on:
push:
branches:
- main
- staging
paths-ignore:
- '.github/workflows/release-plz.yml'
- 'docs/**'
pull_request:
branches:
- "**"
paths-ignore:
- 'crates/bevy_api_gen/**'
- 'crates/macro_tests/**'
- '.github/workflows/release-plz.yml'
- '.github/workflows/bevy_api_gen.yml'
- '.github/workflows/macro_tests.yml'
- 'docs/**'


name: Check and Lint - bevy_mod_scripting
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 }}

concurrency:
# Use github.run_id on main branch
Expand All @@ -21,120 +31,121 @@ concurrency:
cancel-in-progress: true

jobs:
check:
name: Check - ${{ matrix.run_args.label }}
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: 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:
permissions:
pull-requests: write
contents: write
name: Check - ${{ matrix.run_args.name }}
runs-on: ${{ matrix.run_args.os }}
# container: ${{ env.REGISTRY }}/${{ env.IMAGE_NAME }}:latest
needs:
- generate-job-matrix
strategy:
matrix:
run_args: [
{label: Windows - All Features, os: windows-latest, features: "lua54,rhai,teal,lua_script_api,rhai_script_api,rune", cross: x86_64-pc-windows-msvc },
{label: MacOS - All Features, os: macOS-latest, features: "lua54,rhai,teal,lua_script_api,rhai_script_api,rune", cross: x86_64-apple-darwin },
{label: Ubuntu - All Features, os: ubuntu-latest, features: "lua54,lua_script_api,rhai,teal,rhai_script_api,rune", cross: x86_64-unknown-linux-gnu },
{label: Ubuntu Aarch64 - All Features, os: ubuntu-latest, features: "lua54,rhai,teal,lua_script_api,rhai_script_api,rune", cross: aarch64-unknown-linux-gnu },
{label: Ubuntu - Lua51, os: ubuntu-latest, features: "lua51,lua_script_api", cross: x86_64-unknown-linux-gnu },
{label: Ubuntu - Lua52, os: ubuntu-latest, features: "lua52,lua_script_api", cross: x86_64-unknown-linux-gnu },
{label: Ubuntu - Lua53, os: ubuntu-latest, features: "lua53,lua_script_api", cross: x86_64-unknown-linux-gnu },
{label: Ubuntu - Luajit, os: ubuntu-latest, features: "luajit,lua_script_api", cross: x86_64-unknown-linux-gnu },
{label: Ubuntu - Luajit52, os: ubuntu-latest, features: "luajit52,lua_script_api", cross: x86_64-unknown-linux-gnu },
{label: Ubuntu - Luau, os: ubuntu-latest, features: "luau,lua_script_api", cross: x86_64-unknown-linux-gnu }

]
run_args: ${{fromJson(needs.generate-job-matrix.outputs.matrix)}}
steps:
- if: runner.os == 'linux'
name: Install alsa and udev
run: sudo apt-get update; sudo apt-get install --no-install-recommends libasound2-dev libudev-dev
- uses: actions/checkout@v2
- uses: actions-rs/toolchain@v1
with:
profile: minimal
toolchain: stable
override: true
- name: Rust Cache
uses: Swatinem/rust-cache@v2.7.3
- if: runner.os != 'windows'
name: Clear space
run: rm -rf /usr/share/dotnet; rm -rf /opt/ghc; rm -rf "/usr/local/share/boost"; rm -rf "$AGENT_TOOLSDIRECTORY"
- uses: houseabsolute/actions-rust-cross@v0
with:
command: check
target: ${{ matrix.run_args.cross }}
args: --workspace --features=${{ matrix.run_args.features }} --profile=ephemeral-build
- name: Checkout
uses: actions/checkout@v4

fmt:
name: Rustfmt
runs-on: ubuntu-latest
steps:
- name: Install alsa and udev
run: sudo apt-get update; sudo apt-get install --no-install-recommends libasound2-dev libudev-dev
- uses: actions/checkout@v2
if: runner.os == 'linux'
run: |
sudo apt-get update; sudo apt-get install --no-install-recommends libasound2-dev libudev-dev
sudo rm -rf /usr/share/dotnet; sudo rm -rf /opt/ghc; sudo rm -rf "/usr/local/share/boost"; sudo rm -rf "$AGENT_TOOLSDIRECTORY"
- uses: actions-rs/toolchain@v1
with:
profile: minimal
components: rustfmt
toolchain: stable
override: true
- name: Rust Cache
uses: Swatinem/rust-cache@v2.7.3
- uses: actions-rs/cargo@v1
with:
command: fmt
args: --all -- --check

clippy:
name: Clippy
runs-on: ubuntu-latest
steps:
- name: Install alsa and udev
run: sudo apt-get update; sudo apt-get install --no-install-recommends libasound2-dev libudev-dev
- uses: actions/checkout@v2
- uses: actions-rs/toolchain@v1
with:
toolchain: stable
components: clippy
override: true
- name: Rust Cache
uses: Swatinem/rust-cache@v2.7.3
- uses: actions-rs/cargo@v1
with:
command: clippy
args: --features=lua54,rhai,teal,lua_script_api,rhai_script_api,rune --profile=ephemeral-build -- -D warnings
tests:
name: Tests
runs-on: ubuntu-latest
steps:
- name: Clear space
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
uses: actions/checkout@v3
- name: Install alsa and udev
run: sudo apt-get update; sudo apt-get install --no-install-recommends libasound2-dev libudev-dev
- uses: actions-rs/toolchain@v1
with:
toolchain: stable
override: true
- name: Rust Cache
uses: Swatinem/rust-cache@v2.7.3
- uses: actions-rs/cargo@v1

- name: Setup
run: |
cargo xtask init

- name: Check
run: |
${{ matrix.run_args.command }}

- name: Upload coverage artifact
if: ${{ matrix.run_args.generates_coverage }}
uses: actions/upload-artifact@v4
with:
command: test
args: --workspace --features=lua54,rhai,teal,lua_script_api,rhai_script_api,rune --profile=ephemeral-build
docs:
name: Docs
name: code-coverage-report
path: target/coverage/html/

- name: Update coverage badge
if: ${{ matrix.run_args.generates_coverage && github.ref == 'refs/heads/main' }}
run: |
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 add badges/coverage.svg

if [[ -n $(git status -s) ]]; then
git commit -m "chore(badge): Update coverage badge" -m "[skip ci]"
git push
fi
generate_bindings:
name: Bindings - Synchronise
permissions:
contents: write
pull-requests: write
runs-on: ubuntu-latest
steps:
- name: Install alsa and udev
run: sudo apt-get update; sudo apt-get install --no-install-recommends libasound2-dev libudev-dev
- uses: actions/checkout@v2
- uses: actions-rs/toolchain@v1
with:
toolchain: stable
override: true
- name: Rust Cache
uses: Swatinem/rust-cache@v2.7.3
- name: Find docs.rs features
run: echo "DOCS_FEATURES=$(cargo metadata --no-deps | python -c "import sys,json; [print(','.join(x['metadata']['docs.rs']['features'])) for x in json.load(sys.stdin)['packages'] if x['name'] == 'bevy_mod_scripting']")" >> $GITHUB_OUTPUT
id: features
- uses: actions-rs/cargo@v1
with:
command: doc
args: --workspace --features=${{ steps.features.outputs.DOCS_FEATURES }} --profile=ephemeral-build
- name: Checkout
uses: actions/checkout@v4
- 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 checkout -b ${{ env.CODEGEN_BRANCH_NAME }} || git checkout ${{ env.CODEGEN_BRANCH_NAME }}
git add -A
git commit -m "chore(codegen): update bevy bindings"
git push -u origin ${{ env.CODEGEN_BRANCH_NAME }} --force
- uses: jwalton/gh-find-current-pr@master
if: steps.check_changes.outputs.changes
id: findPR
with:
state: all
- name: Create Or Update PR
if: steps.check_changes.outputs.changes && success() && steps.findPR.outputs.number
run: |
gh pr list --base ${{ github.ref }} --search "chore(codegen): update bevy bindings" --json number > prs.json
if [ $(jq '. | length' prs.json) -eq 0 ]; then
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
fi
Loading
Loading