Skip to content

Commit

Permalink
Pull from bevy_jam_template
Browse files Browse the repository at this point in the history
  • Loading branch information
benfrankel committed Dec 1, 2023
1 parent 38f03dc commit 6395a34
Show file tree
Hide file tree
Showing 34 changed files with 6,650 additions and 6 deletions.
68 changes: 68 additions & 0 deletions .cargo/config.toml
Original file line number Diff line number Diff line change
@@ -0,0 +1,68 @@
# Add the contents of this file to `config.toml` to enable "fast build" configuration. Please read the notes below.

# NOTE: For maximum performance, build using a nightly compiler
# If you are using rust stable, remove the "-Zshare-generics=y" below.

[target.x86_64-unknown-linux-gnu]
linker = "clang"
rustflags = ["-Clink-arg=-fuse-ld=mold", "-Zshare-generics=y"]

# NOTE: you must manually install https://github.com/michaeleisel/zld on mac. you can easily do this with the "brew" package manager:
# `brew install michaeleisel/zld/zld`
[target.x86_64-apple-darwin]
rustflags = [
#"-C",
#"link-arg=-fuse-ld=/usr/local/bin/zld",
"-Zshare-generics=y",
]

[target.aarch64-apple-darwin]
rustflags = [
#"-C",
#"link-arg=-fuse-ld=/opt/homebrew/bin/zld",
"-Zshare-generics=y",
]

[target.x86_64-pc-windows-msvc]
linker = "rust-lld.exe"
rustflags = ["-Zshare-generics=n"]

# Optional: Uncommenting the following improves compile times, but reduces the amount of debug info to 'line number tables only'
# In most cases the gains are negligible, but if you are on macos and have slow compile times you should see significant gains.
#[profile.dev]
#debug = 1

[registries.crates-io]
protocol = "sparse"

[profile.dev]
opt-level = 1
#debug = true
#split-debuginfo = '...' # Platform-specific.
#debug-assertions = true
#overflow-checks = true
#lto = false
#panic = 'unwind'
#incremental = true
#codegen-units = 256
#rpath = false

[profile.dev.package."*"]
opt-level = 3

[profile.release]
#opt-level = 3
#debug = false
#split-debuginfo = '...' # Platform-specific.
#debug-assertions = false
#overflow-checks = false
lto = "thin"
#panic = 'unwind'
#incremental = false
codegen-units = 1
#rpath = false

[profile.wasm-release]
inherits = "release"
opt-level = "z"
strip = "debuginfo"
103 changes: 103 additions & 0 deletions .github/workflows/ci.yaml
Original file line number Diff line number Diff line change
@@ -0,0 +1,103 @@
name: CI

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

env:
CARGO_TERM_COLOR: always

jobs:
test:
name: Unit Tests
strategy:
matrix:
os: [windows-latest, ubuntu-latest, macos-latest]
runs-on: ${{ matrix.os }}
timeout-minutes: 30
steps:
- name: Checkout sources
uses: actions/checkout@v3
- name: Cache
uses: actions/cache@v3
with:
path: |
~/.cargo/bin/
~/.cargo/registry/index/
~/.cargo/registry/cache/
~/.cargo/git/db/
target/
key: ${{ runner.os }}-cargo-test-${{ hashFiles('**/Cargo.toml') }}
- name: Install Rust toolchain
uses: dtolnay/rust-toolchain@nightly
- name: Install Linux dependencies
if: runner.os == 'Linux'
run: sudo apt-get update; sudo apt-get install --no-install-recommends libasound2-dev libudev-dev mold
- name: Run tests
run: cargo test

doc-test:
name: Doc Tests
runs-on: ubuntu-latest
timeout-minutes: 30
steps:
- name: Checkout sources
uses: actions/checkout@v3
- name: Cache
uses: actions/cache@v3
with:
path: |
~/.cargo/bin/
~/.cargo/registry/index/
~/.cargo/registry/cache/
~/.cargo/git/db/
target/
key: ${{ runner.os }}-cargo-doc-test-${{ hashFiles('**/Cargo.toml') }}
- name: Install Rust toolchain
uses: dtolnay/rust-toolchain@nightly
- name: Install dependencies
run: sudo apt-get update; sudo apt-get install --no-install-recommends libasound2-dev libudev-dev mold
- name: Run doc tests with all features (this also compiles README examples)
run: cargo test --doc --all-features

clippy:
name: Clippy
runs-on: ubuntu-latest
timeout-minutes: 30
steps:
- name: Checkout sources
uses: actions/checkout@v3
- name: Cache
uses: actions/cache@v3
with:
path: |
~/.cargo/bin/
~/.cargo/registry/index/
~/.cargo/registry/cache/
~/.cargo/git/db/
target/
key: ${{ runner.os }}-cargo-clippy-${{ hashFiles('**/Cargo.toml') }}
- name: Install Rust toolchain
uses: dtolnay/rust-toolchain@nightly
with:
components: clippy
- name: Install dependencies
run: sudo apt-get update; sudo apt-get install --no-install-recommends libasound2-dev libudev-dev mold
- name: Run clippy
run: cargo clippy --workspace --all-targets --all-features -- --deny warnings

format:
name: Format
runs-on: ubuntu-latest
timeout-minutes: 30
steps:
- name: Checkout sources
uses: actions/checkout@v4
- name: Install Rust toolchain
uses: dtolnay/rust-toolchain@nightly
with:
components: rustfmt
- name: Run cargo fmt
run: cargo fmt --all -- --check
3 changes: 2 additions & 1 deletion .gitignore
Original file line number Diff line number Diff line change
@@ -1 +1,2 @@
/target
/target/
/build/
Loading

0 comments on commit 6395a34

Please sign in to comment.