diff --git a/.github/workflows/ci-cron.yml b/.github/workflows/ci-cron.yml new file mode 100644 index 0000000..53b5ea4 --- /dev/null +++ b/.github/workflows/ci-cron.yml @@ -0,0 +1,45 @@ +name: CI-cron + +on: + schedule: + - cron: 0 9 * * * + +env: + CARGO_TERM_COLOR: always + +jobs: + + build: + strategy: + matrix: + toolchain: [stable, nightly] + os: [windows-latest, ubuntu-latest] + runs-on: ${{ matrix.os }} + steps: + - uses: actions/checkout@v3 + with: + ref: bevy-main + + - uses: dtolnay/rust-toolchain@master + with: + toolchain: ${{ matrix.toolchain }} + components: rustfmt, clippy + - name: fmt + if: ${{ matrix.toolchain == 'nightly' && runner.os == 'linux' }} + run: cargo fmt --all -- --check + + - name: Install alsa and udev + run: sudo apt-get update; sudo apt-get install --no-install-recommends libasound2-dev libudev-dev + if: runner.os == 'linux' + + - name: lint + uses: actions-rs/clippy-check@v1 + with: + token: ${{ secrets.GITHUB_TOKEN }} + args: --all-targets --all-features -- -D warnings -A unknown-lints + + - name: Build & run tests + run: cargo test --workspace + env: + CARGO_INCREMENTAL: 0 + RUSTFLAGS: "-C debuginfo=0 -D warnings" diff --git a/.github/workflows/ci.yml b/.github/workflows/ci.yml index f7693cf..c31168b 100644 --- a/.github/workflows/ci.yml +++ b/.github/workflows/ci.yml @@ -2,11 +2,9 @@ name: CI on: pull_request: - branches: [master] + branches: [master, bevy-main] push: - branches: [master] - schedule: - - cron: 0 9 * * * + branches: [master, bevy-main] env: CARGO_TERM_COLOR: always @@ -20,20 +18,16 @@ jobs: os: [windows-latest, ubuntu-latest] runs-on: ${{ matrix.os }} steps: - - uses: actions/checkout@v2 + - uses: actions/checkout@v3 - - uses: actions-rs/toolchain@v1 + - uses: dtolnay/rust-toolchain@master with: toolchain: ${{ matrix.toolchain }} components: rustfmt, clippy - override: true - name: fmt if: ${{ matrix.toolchain == 'nightly' && runner.os == 'linux' }} - uses: actions-rs/cargo@v1 - with: - command: fmt - args: --all -- --check - + run: cargo fmt --all -- --check + - name: Install alsa and udev run: sudo apt-get update; sudo apt-get install --no-install-recommends libasound2-dev libudev-dev if: runner.os == 'linux' diff --git a/.github/workflows/dependencies.yml b/.github/workflows/dependencies.yml index 95c1214..e144809 100644 --- a/.github/workflows/dependencies.yml +++ b/.github/workflows/dependencies.yml @@ -24,11 +24,12 @@ jobs: check-advisories: runs-on: ubuntu-latest steps: - - uses: actions/checkout@v2 - - uses: actions-rs/toolchain@v1 + - uses: actions/checkout@v3 + with: + ref: bevy-main + - uses: dtolnay/rust-toolchain@master with: toolchain: stable - override: true - name: Install cargo-deny run: cargo install cargo-deny - name: Check for security advisories and unmaintained crates @@ -37,11 +38,12 @@ jobs: check-bans: runs-on: ubuntu-latest steps: - - uses: actions/checkout@v2 - - uses: actions-rs/toolchain@v1 + - uses: actions/checkout@v3 + with: + ref: bevy-main + - uses: dtolnay/rust-toolchain@master with: toolchain: stable - override: true - name: Install cargo-deny run: cargo install cargo-deny - name: Check for banned and duplicated dependencies @@ -50,11 +52,12 @@ jobs: check-licenses: runs-on: ubuntu-latest steps: - - uses: actions/checkout@v2 - - uses: actions-rs/toolchain@v1 + - uses: actions/checkout@v3 + with: + ref: bevy-main + - uses: dtolnay/rust-toolchain@master with: toolchain: stable - override: true - name: Install cargo-deny run: cargo install cargo-deny - name: Check for unauthorized licenses @@ -63,11 +66,12 @@ jobs: check-sources: runs-on: ubuntu-latest steps: - - uses: actions/checkout@v2 - - uses: actions-rs/toolchain@v1 + - uses: actions/checkout@v3 + with: + ref: bevy-main + - uses: dtolnay/rust-toolchain@master with: toolchain: stable - override: true - name: Install cargo-deny run: cargo install cargo-deny - name: Checked for unauthorized crate sources diff --git a/README.md b/README.md index c1ee956..f3ee828 100644 --- a/README.md +++ b/README.md @@ -34,7 +34,7 @@ fn main() { App::new() .insert_resource(Msaa::Sample4) .add_plugins(DefaultPlugins) - .add_plugin(ShapePlugin) + .add_plugins(ShapePlugin) .add_systems(Startup, setup_system) .run(); } diff --git a/examples/dynamic_shape.rs b/examples/dynamic_shape.rs index 5e5a381..01813bd 100644 --- a/examples/dynamic_shape.rs +++ b/examples/dynamic_shape.rs @@ -7,7 +7,7 @@ fn main() { App::new() .insert_resource(Msaa::Sample4) .add_plugins(DefaultPlugins) - .add_plugin(ShapePlugin) + .add_plugins(ShapePlugin) .add_systems(Startup, setup_system) .add_systems(Update, change_draw_mode_system) .add_systems(Update, change_number_of_sides) diff --git a/examples/path.rs b/examples/path.rs index a512071..293497c 100644 --- a/examples/path.rs +++ b/examples/path.rs @@ -5,7 +5,7 @@ fn main() { App::new() .insert_resource(Msaa::Sample4) .add_plugins(DefaultPlugins) - .add_plugin(ShapePlugin) + .add_plugins(ShapePlugin) .add_systems(Startup, setup_system) .run(); } diff --git a/examples/readme.rs b/examples/readme.rs index 01d7430..dda0f71 100644 --- a/examples/readme.rs +++ b/examples/readme.rs @@ -8,7 +8,7 @@ fn main() { App::new() .insert_resource(Msaa::Sample4) .add_plugins(DefaultPlugins) - .add_plugin(ShapePlugin) + .add_plugins(ShapePlugin) .add_systems(Startup, setup_system) .run(); } diff --git a/examples/rounded_polygon.rs b/examples/rounded_polygon.rs index 88c7ae9..3fc9d2c 100644 --- a/examples/rounded_polygon.rs +++ b/examples/rounded_polygon.rs @@ -5,7 +5,7 @@ fn main() { App::new() .insert_resource(Msaa::Sample4) .add_plugins(DefaultPlugins) - .add_plugin(ShapePlugin) + .add_plugins(ShapePlugin) .add_systems(Startup, setup_system) .run(); } diff --git a/examples/svg.rs b/examples/svg.rs index f96dc60..27d77b8 100644 --- a/examples/svg.rs +++ b/examples/svg.rs @@ -6,7 +6,7 @@ fn main() { //Added msaa to reduce aliasing .insert_resource(Msaa::Sample4) .add_plugins(DefaultPlugins) - .add_plugin(ShapePlugin) + .add_plugins(ShapePlugin) .add_systems(Startup, setup_system) .run(); } diff --git a/src/plugin.rs b/src/plugin.rs index 2ca6bd8..8b3e3af 100644 --- a/src/plugin.rs +++ b/src/plugin.rs @@ -52,7 +52,7 @@ impl Plugin for ShapePlugin { BuildShapes.after(bevy::transform::TransformSystem::TransformPropagate), ) .add_systems(PostUpdate, mesh_shapes_system.in_set(BuildShapes)) - .add_plugin(ShapeMaterialPlugin); + .add_plugins(ShapeMaterialPlugin); } } diff --git a/src/render/mod.rs b/src/render/mod.rs index bca31a3..4adb59b 100644 --- a/src/render/mod.rs +++ b/src/render/mod.rs @@ -24,7 +24,7 @@ impl Plugin for ShapeMaterialPlugin { Shader::from_wgsl ); - app.add_plugin(Material2dPlugin::::default()) + app.add_plugins(Material2dPlugin::::default()) .register_asset_reflect::(); app.world diff --git a/src/shapes.rs b/src/shapes.rs index f7ade2a..69ee0b6 100644 --- a/src/shapes.rs +++ b/src/shapes.rs @@ -291,12 +291,12 @@ impl Geometry for Line { ///offset the coordinates of the paths /// ///In inkscape for example, to turn your units into pixels, you: -///1) Go to File>Document Properties>General>Display Units and set it to px +/// 1) Go to File>Document Properties>General>Display Units and set it to px /// -///2) In File>Document Properties>Custom Size>Units set it to px, also, this +/// 2) In File>Document Properties>Custom Size>Units set it to px, also, this /// size would be used for `svg_doc_size_in_px` /// -///3) In File>Document Properties>Scale>Scale x make sure it is set to 1 User +/// 3) In File>Document Properties>Scale>Scale x make sure it is set to 1 User /// unit per px /// ///Example exists in the examples folder