50 lines
1.3 KiB
YAML
50 lines
1.3 KiB
YAML
name: CI
|
|
|
|
on:
|
|
push:
|
|
branches: [ "dev" ]
|
|
pull_request:
|
|
branches: [ "dev", "main" ]
|
|
|
|
env:
|
|
CARGO_TERM_COLOR: always
|
|
|
|
jobs:
|
|
rust-lint:
|
|
name: Rust Check & Lint
|
|
runs-on: ubuntu-latest
|
|
steps:
|
|
- uses: actions/checkout@v4
|
|
|
|
- name: Install Rust toolchain
|
|
uses: dtolnay/rust-toolchain@stable
|
|
with:
|
|
components: clippy, rustfmt
|
|
|
|
- name: Check Rust Formatting
|
|
run: cargo fmt --all -- --check
|
|
|
|
- name: Run Clippy
|
|
# The `-D warnings` flag converts all clippy warnings into hard errors, causing the build to fail.
|
|
run: cargo clippy --all-targets --all-features -- -D warnings
|
|
|
|
lua-lint:
|
|
name: Lua Lint & Format
|
|
runs-on: ubuntu-latest
|
|
steps:
|
|
- uses: actions/checkout@v4
|
|
|
|
- name: Check Lua Formatting
|
|
uses: JohnnyMorganz/stylua-action@v4
|
|
with:
|
|
token: ${{ secrets.GITHUB_TOKEN }}
|
|
version: latest
|
|
args: --check assets/scripts/ mods/
|
|
|
|
- name: Run Selene
|
|
run: |
|
|
curl -sL https://github.com/Kampfkarren/selene/releases/download/0.30.1/selene-light-0.30.1-linux.zip -o selene.zip
|
|
unzip -q selene.zip
|
|
chmod +x selene
|
|
./selene assets/scripts/ mods/
|