Skip to content

Commit

Permalink
feat: add just and ci (#2)
Browse files Browse the repository at this point in the history
* feat: add just and ci

* fix: lint

* fix(alsa-error): install libasound2-dev

---------

Co-authored-by: tomyrd <[email protected]>
Co-authored-by: Tomas Rodriguez Dala <[email protected]>
  • Loading branch information
3 people authored Jul 16, 2024
1 parent 1e15d5d commit 9d638a0
Show file tree
Hide file tree
Showing 4 changed files with 102 additions and 0 deletions.
38 changes: 38 additions & 0 deletions .github/workflows/build.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,38 @@
name: Build Rust Project

on:
push:
tags:
- "v*.*.*"

env:
CARGO_TERM_COLOR: always

jobs:
build-and-upload:
name: Build and upload
strategy:
matrix:
os: [ubuntu-latest, macos-latest]
runs-on: ${{ matrix.os }}
steps:
- name: Checkout
uses: actions/[email protected]
- name: Use the rust-toolchain
uses: actions-rust-lang/setup-rust-toolchain@v1
- name: Install just
uses: extractions/setup-just@v1
- run: echo "WORKING_DIR=$(basename $(pwd))" >> $GITHUB_ENV
- name: Install Dependencies
if: ${{ matrix.os }} == 'ubuntu-latest'
run: sudo apt-get install g++ pkg-config libx11-dev libasound2-dev libudev-dev libxkbcommon-x11-0
- name: Build
shell: bash
run: |
just build-release
echo "${{ env.WORKING_DIR }}"
mv "target/release/${{ env.WORKING_DIR }}" "${{ matrix.os }}.bin"
- name: Release
uses: softprops/action-gh-release@v2
with:
files: ${{ matrix.os }}.bin
27 changes: 27 additions & 0 deletions .github/workflows/pr_action.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,27 @@
name: cargo fmt, clippy and test on PR

on:
pull_request:

env:
CARGO_TERM_COLOR: always

jobs:
check:
name: check fmt and clippy
runs-on: ubuntu-latest
steps:
- name: Checkout
uses: actions/[email protected]
- name: Use the rust-toolchain
uses: actions-rust-lang/setup-rust-toolchain@v1
- name: Install dependencies
shell: bash
run: |
sudo apt-get install g++ pkg-config libx11-dev libasound2-dev libudev-dev libxkbcommon-x11-0
- name: Check fmt
uses: actions-rust-lang/rustfmt@v1
- name: Check clippy
run: cargo clippy
- name: Check test
run: cargo test --all-features
15 changes: 15 additions & 0 deletions README.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,15 @@
# Bevy HandsOn

> [!NOTE]
> WIP
## Justfile

Using `just` instead of `make`.

After installation, the project can be built just by running `just`.

- [Packages](https://github.com/casey/just?tab=readme-ov-file#packages)
- Ubuntu &rarr; `apt install just`
- MacOs &rarr; `brew install just`
- [Editor Support](https://github.com/casey/just?tab=readme-ov-file#editor-support)
22 changes: 22 additions & 0 deletions justfile
Original file line number Diff line number Diff line change
@@ -0,0 +1,22 @@
default: lint build-debug test

build-release:
cargo build --release
alias br := build-release

build-debug:
cargo build
alias bd := build-debug

test:
cargo test
alias t := test

lint:
cargo clippy
alias l := lint

[positional-arguments]
@git_tag *args='':
git tag $1 -f
git push --tags -f

0 comments on commit 9d638a0

Please sign in to comment.