Skip to content

Commit 16c806d

Browse files
committed
improve xtasks and start integrating with ci
1 parent 9661c33 commit 16c806d

File tree

6 files changed

+311
-360
lines changed

6 files changed

+311
-360
lines changed

.github/workflows/bevy_mod_scripting.yml

Lines changed: 29 additions & 90 deletions
Original file line numberDiff line numberDiff line change
@@ -27,85 +27,22 @@ jobs:
2727
strategy:
2828
matrix:
2929
run_args: [
30-
{label: Windows - All Features, os: windows-latest, features: "lua54,rhai,rune", cross: x86_64-pc-windows-msvc },
31-
{label: MacOS - All Features, os: macOS-latest, features: "lua54,rhai,rune", cross: x86_64-apple-darwin },
32-
{label: Ubuntu - All Features, os: ubuntu-latest, features: "lua54,rhai,rune", cross: x86_64-unknown-linux-gnu },
33-
{label: Ubuntu Aarch64 - All Features, os: ubuntu-latest, features: "lua54,rhai,rune", cross: aarch64-unknown-linux-gnu },
34-
{label: Ubuntu - Lua51, os: ubuntu-latest, features: "lua51", cross: x86_64-unknown-linux-gnu },
35-
{label: Ubuntu - Lua52, os: ubuntu-latest, features: "lua52", cross: x86_64-unknown-linux-gnu },
36-
{label: Ubuntu - Lua53, os: ubuntu-latest, features: "lua53", cross: x86_64-unknown-linux-gnu },
37-
{label: Ubuntu - Luajit, os: ubuntu-latest, features: "luajit", cross: x86_64-unknown-linux-gnu },
38-
{label: Ubuntu - Luajit52, os: ubuntu-latest, features: "luajit52", cross: x86_64-unknown-linux-gnu },
39-
{label: Ubuntu - Luau, os: ubuntu-latest, features: "luau", cross: x86_64-unknown-linux-gnu }
30+
{label: Windows, os: windows-latest, cross: x86_64-pc-windows-msvc },
31+
{label: MacOS, os: macOS-latest, cross: x86_64-apple-darwin },
32+
{label: Ubuntu, os: ubuntu-latest, cross: x86_64-unknown-linux-gnu },
33+
{label: Ubuntu Aarch64, os: ubuntu-latest, cross: aarch64-unknown-linux-gnu }
4034
]
41-
steps:
42-
- if: runner.os == 'linux'
43-
name: Install alsa and udev
44-
run: sudo apt-get update; sudo apt-get install --no-install-recommends libasound2-dev libudev-dev
45-
- uses: actions/checkout@v2
46-
- uses: actions-rs/toolchain@v1
47-
with:
48-
profile: minimal
49-
toolchain: stable
50-
override: true
51-
- name: Rust Cache
52-
uses: Swatinem/rust-cache@v2.7.3
53-
- if: runner.os != 'windows'
54-
name: Clear space
55-
run: rm -rf /usr/share/dotnet; rm -rf /opt/ghc; rm -rf "/usr/local/share/boost"; rm -rf "$AGENT_TOOLSDIRECTORY"
56-
- uses: houseabsolute/actions-rust-cross@v0
57-
with:
58-
command: check
59-
target: ${{ matrix.run_args.cross }}
60-
args: --workspace --features=${{ matrix.run_args.features }} --profile=ephemeral-build
6135

62-
fmt:
63-
name: Rustfmt
64-
runs-on: ubuntu-latest
65-
steps:
66-
- name: Install alsa and udev
67-
run: sudo apt-get update; sudo apt-get install --no-install-recommends libasound2-dev libudev-dev
68-
- uses: actions/checkout@v2
69-
- uses: actions-rs/toolchain@v1
70-
with:
71-
profile: minimal
72-
components: rustfmt
73-
toolchain: stable
74-
override: true
75-
- name: Rust Cache
76-
uses: Swatinem/rust-cache@v2.7.3
77-
- uses: actions-rs/cargo@v1
78-
with:
79-
command: fmt
80-
args: --all -- --check
81-
82-
clippy:
83-
name: Clippy
84-
runs-on: ubuntu-latest
85-
steps:
86-
- name: Install alsa and udev
87-
run: sudo apt-get update; sudo apt-get install --no-install-recommends libasound2-dev libudev-dev
88-
- uses: actions/checkout@v2
89-
- uses: actions-rs/toolchain@v1
90-
with:
91-
toolchain: stable
92-
components: clippy
93-
override: true
94-
- name: Rust Cache
95-
uses: Swatinem/rust-cache@v2.7.3
96-
- uses: actions-rs/cargo@v1
97-
with:
98-
command: clippy
99-
args: --features=lua54,rhai,rune --profile=ephemeral-build -- -D warnings
10036
tests:
10137
name: Tests
102-
runs-on: ubuntu-latest
38+
runs-on: {{ matrix.run_args.os }}
10339
steps:
10440
- name: Clear space
10541
run: sudo rm -rf /usr/share/dotnet; sudo rm -rf /opt/ghc; sudo rm -rf "/usr/local/share/boost"; sudo rm -rf "$AGENT_TOOLSDIRECTORY"
10642
- name: Checkout
10743
uses: actions/checkout@v3
10844
- name: Install alsa and udev
45+
if: {{ matrix.run_args.os != 'windows-latest' }}
10946
run: sudo apt-get update; sudo apt-get install --no-install-recommends libasound2-dev libudev-dev
11047
- uses: actions-rs/toolchain@v1
11148
with:
@@ -115,25 +52,27 @@ jobs:
11552
uses: Swatinem/rust-cache@v2.7.3
11653
- uses: actions-rs/cargo@v1
11754
with:
118-
command: test
55+
command: xtest ci-check
56+
components: clippy, rustfmt, grcov
57+
target: ${{ matrix.run_args.cross }}
11958
args: --workspace --features=lua54,rhai,rune --profile=ephemeral-build
120-
docs:
121-
name: Docs
122-
runs-on: ubuntu-latest
123-
steps:
124-
- name: Install alsa and udev
125-
run: sudo apt-get update; sudo apt-get install --no-install-recommends libasound2-dev libudev-dev
126-
- uses: actions/checkout@v2
127-
- uses: actions-rs/toolchain@v1
128-
with:
129-
toolchain: stable
130-
override: true
131-
- name: Rust Cache
132-
uses: Swatinem/rust-cache@v2.7.3
133-
- name: Find docs.rs features
134-
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
135-
id: features
136-
- uses: actions-rs/cargo@v1
137-
with:
138-
command: doc
139-
args: --workspace --features=${{ steps.features.outputs.DOCS_FEATURES }} --profile=ephemeral-build
59+
# docs:
60+
# name: Docs
61+
# runs-on: ubuntu-latest
62+
# steps:
63+
# - name: Install alsa and udev
64+
# run: sudo apt-get update; sudo apt-get install --no-install-recommends libasound2-dev libudev-dev
65+
# - uses: actions/checkout@v2
66+
# - uses: actions-rs/toolchain@v1
67+
# with:
68+
# toolchain: stable
69+
# override: true
70+
# - name: Rust Cache
71+
# uses: Swatinem/rust-cache@v2.7.3
72+
# - name: Find docs.rs features
73+
# 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
74+
# id: features
75+
# - uses: actions-rs/cargo@v1
76+
# with:
77+
# command: doc
78+
# args: --workspace --features=${{ steps.features.outputs.DOCS_FEATURES }} --profile=ephemeral-build

architecture.md

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

crates/bevy_mod_scripting_core/src/bindings/function/script_function.rs

Lines changed: 0 additions & 51 deletions
Original file line numberDiff line numberDiff line change
@@ -476,57 +476,6 @@ macro_rules! impl_script_function_type_dependencies{
476476
bevy::utils::all_tuples!(impl_script_function, 0, 13, T);
477477
bevy::utils::all_tuples!(impl_script_function_type_dependencies, 0, 13, T);
478478

479-
/// Utility for quickly checking your type can be used as an argument in a script function
480-
///
481-
/// Usage:
482-
/// ```
483-
/// assert_impls_into_script!(i32);
484-
/// ```
485-
#[macro_export]
486-
macro_rules! assert_impls_into_script {
487-
($ty:ty) => {
488-
trait Check: $crate::bindings::function::into::IntoScript {}
489-
impl Check for $ty {}
490-
};
491-
}
492-
493-
/// Utility for quickly checking your type can be used as a return value in a script function
494-
///
495-
/// Usage:
496-
/// ```
497-
/// assert_impls_from_script!(i32);
498-
/// ```
499-
#[macro_export]
500-
macro_rules! assert_impls_from_script {
501-
($ty:ty) => {
502-
trait Check: $crate::bindings::function::from::FromScript {}
503-
impl Check for $ty {}
504-
};
505-
($l:lifetime $ty:ty) => {
506-
trait Check: $crate::bindings::function::from::FromScript {}
507-
impl<$l> Check for $ty {}
508-
};
509-
}
510-
511-
/// Utility for quickly checking your function can be used as a script function
512-
///
513-
/// Usage:
514-
/// ```
515-
/// assert_is_script_function!(|a: i32, b: i32| a + b);
516-
/// ```
517-
#[macro_export]
518-
macro_rules! assert_is_script_function {
519-
($($tt:tt)*) => {
520-
fn _check<'env,M,F: ScriptFunction<'env, M>>(f: F) {
521-
522-
}
523-
524-
fn test() {
525-
_check($($tt)*);
526-
}
527-
}
528-
}
529-
530479
#[cfg(test)]
531480
mod test {
532481
use super::*;

0 commit comments

Comments
 (0)