Skip to content

Commit

Permalink
ci: initial CI
Browse files Browse the repository at this point in the history
  • Loading branch information
simbleau committed Oct 20, 2023
1 parent a8ca523 commit a0b7410
Show file tree
Hide file tree
Showing 4 changed files with 104 additions and 0 deletions.
11 changes: 11 additions & 0 deletions .github/dependabot.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,11 @@
version: 2
updates:
- package-ecosystem: "github-actions"
directory: "/"
schedule:
interval: "weekly"

- package-ecosystem: "cargo"
directory: "/"
schedule:
interval: "weekly"
70 changes: 70 additions & 0 deletions .github/workflows/ci.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,70 @@
name: CI
on: [push, pull_request]

jobs:
lint:
runs-on: ubuntu-latest
steps:
- name: Setup | Checkout
uses: actions/checkout@v4

- name: Setup | Toolchain
uses: dtolnay/rust-toolchain@stable
with:
components: clippy,rustfmt

- name: Rust Cache
uses: Swatinem/rust-cache@v2.7.0

- name: Build | Clippy
uses: actions-rs/cargo@v1
with:
command: clippy
args: -- -D warnings

- name: Build | Rustfmt
run: cargo fmt --all -- --check

check:
runs-on: ubuntu-latest
steps:
- name: Setup | Checkout
uses: actions/checkout@v4

- name: Setup | Rust
uses: dtolnay/rust-toolchain@stable
with:
targets: wasm32-unknown-unknown

- name: Rust Cache
uses: Swatinem/rust-cache@v2.7.0

- name: Build | Check (native)
run: cargo check --all

- name: Build | Check (wasm)
run: cargo check --target wasm32-unknown-unknown

test:
needs: [check]
runs-on: ubuntu-latest
steps:
- name: Setup | Checkout
uses: actions/checkout@v4

- name: Setup | Rust
uses: dtolnay/rust-toolchain@stable
with:
targets: wasm32-unknown-unknown

- name: Setup | wasm-pack
uses: jetli/wasm-pack-action@v0.4.0

- name: Rust Cache
uses: Swatinem/rust-cache@v2.7.0

- name: Build | Test (native)
run: cargo test --all

- name: Build | Test (wasm)
run: wasm-pack test --node
20 changes: 20 additions & 0 deletions .github/workflows/release.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,20 @@
name: Release
on:
push:
tags:
- 'v*'
workflow_dispatch:

jobs:
publish:
runs-on: ubuntu-latest
steps:
- name: Setup | Checkout
uses: actions/checkout@v4

- name: Setup | Toolchain
uses: dtolnay/rust-toolchain@stable

- name: Cargo | Publish
run: |
cargo publish --token ${{ secrets.CARGO_REGISTRY_TOKEN }}
3 changes: 3 additions & 0 deletions Cargo.toml
Original file line number Diff line number Diff line change
Expand Up @@ -10,3 +10,6 @@ thiserror = "1.0"
bevy-async-task = "1.2"
async-trait = "0.1"
bevy = { version = "0.11", default-features = false }

[target.'cfg(target_arch = "wasm32")'.dev-dependencies]
wasm-bindgen-test = "0.3"

0 comments on commit a0b7410

Please sign in to comment.