Skip to content

Commit

Permalink
Initial commit
Browse files Browse the repository at this point in the history
  • Loading branch information
Shatur committed Oct 6, 2024
0 parents commit 0bc5af3
Show file tree
Hide file tree
Showing 20 changed files with 2,763 additions and 0 deletions.
14 changes: 14 additions & 0 deletions .github/dependabot.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,14 @@
version: 2
updates:
- package-ecosystem: cargo
directory: /
schedule:
interval: weekly
labels:
- "dependencies"
- package-ecosystem: github-actions
directory: /
schedule:
interval: weekly
labels:
- "github actions"
30 changes: 30 additions & 0 deletions .github/workflows/dependencies.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,30 @@
name: Dependencies
on:
push:
branches:
- master
paths:
- "Cargo.toml"
- "Cargo.lock"
- "deny.toml"
pull_request:
paths:
- "Cargo.toml"
- "Cargo.lock"
- "deny.toml"
schedule:
- cron: "0 0 * * 0"
env:
CARGO_TERM_COLOR: always
jobs:
dependencies:
name: Check dependencies
runs-on: ubuntu-latest
steps:
- name: Clone repo
uses: actions/checkout@v4

- name: Check dependencies
uses: EmbarkStudios/cargo-deny-action@v2
with:
command-arguments: -D warnings
132 changes: 132 additions & 0 deletions .github/workflows/main.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,132 @@
name: Main
on:
push:
branches:
- master
paths-ignore:
- ".gitignore"
- ".github/dependabot.yml"
- "deny.toml"
pull_request:
paths-ignore:
- ".gitignore"
- ".github/dependabot.yml"
- "deny.toml"
env:
CARGO_TERM_COLOR: always
jobs:
format:
name: Format
runs-on: ubuntu-latest
steps:
- name: Clone repo
uses: actions/checkout@v4

- name: Cache crates
uses: Swatinem/rust-cache@v2

- name: Install Taplo
run: cargo install --locked taplo-cli

- name: Format
run: |
cargo fmt --all --check
taplo fmt --check
lint:
name: Lint
runs-on: ubuntu-latest
steps:
- name: Clone repo
uses: actions/checkout@v4

- name: Install dependencies
run: |
sudo apt-get update
sudo apt-get install --no-install-recommends libudev-dev libwayland-dev libxkbcommon-dev
- name: Instal stable toolchain
uses: dtolnay/rust-toolchain@stable

- name: Cache crates
uses: Swatinem/rust-cache@v2

- name: Clippy
run: cargo clippy --tests -- -D warnings

- name: Rustdoc
run: cargo rustdoc --all-features -- -D warnings

doctest:
name: Doctest
runs-on: ubuntu-latest
steps:
- name: Clone repo
uses: actions/checkout@v4

- name: Install dependencies
run: |
sudo apt-get update
sudo apt-get install --no-install-recommends libudev-dev libwayland-dev libxkbcommon-dev
- name: Instal stable toolchain
uses: dtolnay/rust-toolchain@stable

- name: Cache crates
uses: Swatinem/rust-cache@v2

- name: Test doc
run: cargo test --all-features --doc

test:
name: Test
runs-on: ubuntu-latest
steps:
- name: Clone repo
uses: actions/checkout@v4

- name: Install dependencies
run: |
sudo apt-get update
sudo apt-get install --no-install-recommends libudev-dev libwayland-dev libxkbcommon-dev
- name: Instal stable toolchain
uses: dtolnay/rust-toolchain@stable

- name: Cache crates
uses: Swatinem/rust-cache@v2

- name: Install LLVM tools
run: rustup component add llvm-tools-preview

- name: Install Tarpaulin
run: cargo install cargo-tarpaulin

- name: Test
run: cargo tarpaulin --all-features --engine llvm --out lcov

- name: Upload code coverage results
if: github.actor != 'dependabot[bot]'
uses: actions/upload-artifact@v4
with:
name: code-coverage-report
path: lcov.info

codecov:
name: Upload to Codecov
if: github.actor != 'dependabot[bot]'
needs: [format, lint, doctest, test]
runs-on: ubuntu-latest
steps:
- name: Clone repo
uses: actions/checkout@v4

- name: Download code coverage results
uses: actions/download-artifact@v4
with:
name: code-coverage-report

- name: Upload to Codecov
uses: codecov/codecov-action@v4
with:
token: ${{ secrets.CODECOV_TOKEN }}
8 changes: 8 additions & 0 deletions .gitignore
Original file line number Diff line number Diff line change
@@ -0,0 +1,8 @@
# Binaries
target

# Code coverage
html

# For library
Cargo.lock
39 changes: 39 additions & 0 deletions Cargo.toml
Original file line number Diff line number Diff line change
@@ -0,0 +1,39 @@
[package]
name = "bevy_enhanced_input"
version = "0.1.0"
authors = [
"Hennadii Chernyshchyk <[email protected]>",
]
edition = "2021"
description = "Dynamic and contextual input mappings for Bevy "
readme = "README.md"
repository = "https://github.com/projectharmonia/bevy_enhanced_input"
keywords = [
"bevy",
"input",
]
categories = ["game-development"]
license = "MIT OR Apache-2.0"
include = ["/src", "/tests", "/LICENSE*"]

[dependencies]
bevy = { version = "0.14", default-features = false, features = ["serialize"] }
bevy_egui = { version = "0.30", default-features = false, features = ["immutable_ctx"], optional = true }
serde = "1.0"
bitflags = { version = "2.6", features = ["serde"] }
interpolation = "0.3"

[dev-dependencies]
bevy = { version = "0.14", default-features = false, features = [
"bevy_gilrs",
"x11",
] }

[features]
default = ["ui_priority", "egui_priority"]

# Prioritizes 'bevy_ui' actions when processing inputs.
ui_priority = ['bevy/bevy_ui']

# Prioritizes 'egui' over actions when processing inputs.
egui_priority = ['dep:bevy_egui']
Loading

0 comments on commit 0bc5af3

Please sign in to comment.