Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
1 change: 1 addition & 0 deletions .gitattributes
Original file line number Diff line number Diff line change
@@ -1,2 +1,3 @@
*.png filter=lfs diff=lfs merge=lfs -text
*.ttf filter=lfs diff=lfs merge=lfs -text
*.xcf filter=lfs diff=lfs merge=lfs -text
105 changes: 25 additions & 80 deletions .github/workflows/ci.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -2,99 +2,44 @@ name: CI

on:
push:
branches: [main]
branches: [ main ]
pull_request:
branches: [main]
branches: [ main ]

env:
CARGO_TERM_COLOR: always

concurrency:
group: ${{ github.workflow }}-${{ github.ref }}
cancel-in-progress: true

permissions:
contents: read

jobs:

# Run cargo test
test:
name: Test Suite
name: CI
runs-on: ubuntu-latest
steps:
- name: Checkout sources
uses: actions/checkout@v2
- uses: actions/checkout@v7
with:
lfs: 'true'
- name: Cache
uses: actions/cache@v2
with:
path: |
~/.cargo/bin/
~/.cargo/registry/index/
~/.cargo/registry/cache/
~/.cargo/git/db/
target/
key: ${{ runner.os }}-cargo-test-${{ hashFiles('**/Cargo.toml') }}
- name: Install stable toolchain
uses: actions-rs/toolchain@v1
with:
profile: minimal
toolchain: stable
override: true
- name: Install Dependencies
run: sudo apt-get update; sudo apt-get install pkg-config libx11-dev libasound2-dev libudev-dev libxcb-render0-dev libxcb-shape0-dev libxcb-xfixes0-dev
- name: Run cargo test
uses: actions-rs/cargo@v1
with:
command: test

# Run cargo clippy -- -D warnings
clippy_check:
name: Clippy
runs-on: ubuntu-latest
steps:
- name: Checkout sources
uses: actions/checkout@v2
with:
lfs: 'true'
- name: Cache
uses: actions/cache@v2
- uses: dtolnay/rust-toolchain@stable
with:
path: |
~/.cargo/bin/
~/.cargo/registry/index/
~/.cargo/registry/cache/
~/.cargo/git/db/
target/
key: ${{ runner.os }}-cargo-clippy-${{ hashFiles('**/Cargo.toml') }}
- name: Install stable toolchain
uses: actions-rs/toolchain@v1
with:
toolchain: stable
profile: minimal
components: clippy
override: true
components: clippy, rustfmt
targets: wasm32-unknown-unknown
- uses: Swatinem/rust-cache@v2

- name: Install Dependencies
run: sudo apt-get update; sudo apt-get install pkg-config libx11-dev libasound2-dev libudev-dev
- name: Run clippy
uses: actions-rs/clippy-check@v1
with:
token: ${{ secrets.GITHUB_TOKEN }}
args: -- -D warnings
run: sudo apt-get update && sudo apt-get install -y g++ pkg-config libx11-dev libasound2-dev libudev-dev libwayland-dev libxkbcommon-dev

# Run cargo fmt --all -- --check
format:
name: Format
runs-on: ubuntu-latest
steps:
- name: Checkout sources
uses: actions/checkout@v2
with:
lfs: 'true'
- name: Install stable toolchain
uses: actions-rs/toolchain@v1
with:
toolchain: stable
profile: minimal
components: rustfmt
override: true
- name: Run cargo fmt
uses: actions-rs/cargo@v1
with:
command: fmt
args: --all -- --check
- name: Fmt
run: cargo fmt --all --check
- name: Clippy
run: cargo clippy --all-targets -- -D warnings
- name: Test
run: cargo test
- name: Wasm Test
run: cargo check --target wasm32-unknown-unknown
150 changes: 15 additions & 135 deletions .github/workflows/release.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -4,166 +4,46 @@ on:
push:
tags:
- '*'
workflow_dispatch:

env:
# update with the name of the main binary
binary: nothing-moves

permissions:
contents: write

jobs:

# Build for wasm
release-wasm:
runs-on: ubuntu-latest

steps:
- uses: little-core-labs/get-git-tag@v3.0.1
id: get_version
- uses: actions/checkout@v2
- uses: actions/checkout@v7
with:
lfs: 'true'
- uses: actions-rs/toolchain@v1
- uses: dtolnay/rust-toolchain@stable
with:
toolchain: stable
target: wasm32-unknown-unknown
override: true
- name: install trunk
run: |
cargo install trunk
- name: Build
run: |
trunk build --release
- name: Prepare package
run: |
cp -r assets dist/
- name: Package as a zip
uses: vimtor/action-zip@v1
with:
files: dist
dest: ${{ env.binary }}.zip

- name: Upload binaries to release
uses: svenstaro/upload-release-action@v2
with:
repo_token: ${{ secrets.GITHUB_TOKEN }}
file: ${{ env.binary }}.zip
asset_name: ${{ env.binary }}-wasm-${{ steps.get_version.outputs.tag }}.zip
tag: ${{ github.ref }}
overwrite: true
- uses: Swatinem/rust-cache@v2
- uses: jetli/trunk-action@v0.5.1

# Build for Linux
release-linux:
runs-on: ubuntu-latest

steps:
- uses: little-core-labs/get-git-tag@v3.0.1
id: get_version
- uses: actions/checkout@v2
with:
lfs: 'true'
- uses: actions-rs/toolchain@v1
with:
toolchain: stable
target: x86_64-unknown-linux-gnu
override: true
- name: install dependencies
run: |
sudo apt-get update; sudo apt-get install pkg-config libx11-dev libasound2-dev libudev-dev libxcb-render0-dev libxcb-shape0-dev libxcb-xfixes0-dev
- name: Build
run: |
cargo build --release --target x86_64-unknown-linux-gnu
- name: Prepare package
run: |
mkdir linux
cp target/x86_64-unknown-linux-gnu/release/${{ env.binary }} linux/
cp -r assets linux/
run: trunk build --release
- name: Package as a zip
uses: vimtor/action-zip@v1
with:
files: linux
dest: ${{ env.binary }}.zip

- name: Upload binaries to release
uses: svenstaro/upload-release-action@v2
with:
repo_token: ${{ secrets.GITHUB_TOKEN }}
file: ${{ env.binary }}.zip
asset_name: ${{ env.binary }}-linux-${{ steps.get_version.outputs.tag }}.zip
tag: ${{ github.ref }}
overwrite: true

# Build for Windows
release-windows:
runs-on: windows-latest

steps:
- uses: little-core-labs/get-git-tag@v3.0.1
id: get_version
- uses: actions/checkout@v2
with:
lfs: 'true'
- uses: actions-rs/toolchain@v1
with:
toolchain: stable
target: x86_64-pc-windows-msvc
override: true
run: zip -r ${{ env.binary }}.zip dist

- name: Build
run: |
cargo build --release --target x86_64-pc-windows-msvc
- name: Prepare package
run: |
mkdir windows
cp target/x86_64-pc-windows-msvc/release/${{ env.binary }}.exe windows/
cp -r assets windows/
- name: Package as a zip
uses: vimtor/action-zip@v1
- name: Upload binaries to build
uses: actions/upload-artifact@v4
with:
files: windows
dest: ${{ env.binary }}.zip
name: ${{ env.binary }}-wasm
path: dist

- name: Upload binaries to release
if: startsWith(github.ref, 'refs/tags/')
uses: svenstaro/upload-release-action@v2
with:
repo_token: ${{ secrets.GITHUB_TOKEN }}
file: ${{ env.binary }}.zip
asset_name: ${{ env.binary }}-windows-${{ steps.get_version.outputs.tag }}.zip
asset_name: ${{ env.binary }}-wasm-${{ github.ref_name }}.zip
tag: ${{ github.ref }}
overwrite: true

# Build for macOS
release-macos:
runs-on: macOS-latest

steps:
- uses: little-core-labs/get-git-tag@v3.0.1
id: get_version
- uses: actions/checkout@v2
with:
lfs: 'true'
- uses: actions-rs/toolchain@v1
with:
toolchain: stable
target: x86_64-apple-darwin
override: true
- name: Environment Setup
run: |
export CFLAGS="-fno-stack-check"
export MACOSX_DEPLOYMENT_TARGET="10.9"
- name: Build
run: |
cargo build --release --target x86_64-apple-darwin
- name: Prepare Package
run: |
mkdir -p ${{ env.binary }}.app/Contents/MacOS
cp target/x86_64-apple-darwin/release/${{ env.binary }} ${{ env.binary }}.app/Contents/MacOS/
cp -r assets ${{ env.binary }}.app/Contents/MacOS/
hdiutil create -fs HFS+ -volname "${{ env.binary }}" -srcfolder ${{ env.binary }}.app ${{ env.binary }}.dmg
- name: Upload binaries to release
uses: svenstaro/upload-release-action@v2
with:
repo_token: ${{ secrets.GITHUB_TOKEN }}
file: ${{ env.binary }}.dmg
asset_name: ${{ env.binary }}-macos-${{ steps.get_version.outputs.tag }}.dmg
tag: ${{ github.ref }}
overwrite: true
3 changes: 3 additions & 0 deletions .gitignore
Original file line number Diff line number Diff line change
Expand Up @@ -15,3 +15,6 @@ Cargo.lock
/target

/dist

# RustRover
.idea
21 changes: 19 additions & 2 deletions Cargo.toml
Original file line number Diff line number Diff line change
Expand Up @@ -5,8 +5,9 @@ name = "nothing-moves"
version = "0.1.0"

[dependencies]
bevy = "0.7"
rand = "0.8"
bevy = "*"
rand = "*"
bevy-inspector-egui = "*"

# Enable only a small amount of optimization in debug mode
[profile.dev]
Expand All @@ -15,3 +16,19 @@ opt-level = 1
# Enable high optimizations for dependencies (incl. Bevy), but not for our code:
[profile.dev.package."*"]
opt-level = 3

[profile.wasm-release]
# Use release profile as default values
inherits = "release"

# Optimize with size in mind, also try "s", sometimes it is better.
# This doesn't increase compilation times compared to -O3, great improvements
opt-level = "z"

# Do a second optimization pass removing duplicate or unused code from dependencies.
# Slows compile times, marginal improvements
lto = "fat"

# When building crates, optimize larger chunks at a time
# Slows compile times, marginal improvements
codegen-units = 1
5 changes: 5 additions & 0 deletions Trunk.toml
Original file line number Diff line number Diff line change
@@ -0,0 +1,5 @@
[build]
public_url = "./"

[serve]
port = 8080
3 changes: 3 additions & 0 deletions asset_bases/arrow.xcf
Git LFS file not shown
3 changes: 3 additions & 0 deletions asset_bases/circle_arrow.xcf
Git LFS file not shown
3 changes: 3 additions & 0 deletions asset_bases/circle_dash_arrow.xcf
Git LFS file not shown
3 changes: 3 additions & 0 deletions asset_bases/dash_arrow.xcf
Git LFS file not shown
12 changes: 12 additions & 0 deletions assets/scenes/ui/maze_controls.scn.ron
Original file line number Diff line number Diff line change
@@ -0,0 +1,12 @@
(
entities: {
0: (
components: {
"bevy_ui::ui_node::Style": (),
"bevy_ui::ui_node::Node": (),
"bevy_ui::ui_node::BackgroundColor": (WHITE),
"bevy_transform::components::transform::Transform": ()
}
)
}
)
3 changes: 3 additions & 0 deletions assets/textures/arrow.png
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
3 changes: 3 additions & 0 deletions assets/textures/circle_arrow.png
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
3 changes: 3 additions & 0 deletions assets/textures/circle_arrow_flip.png
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Loading