95 lines
2.8 KiB
YAML
95 lines
2.8 KiB
YAML
name: CI
|
|
|
|
on:
|
|
push:
|
|
branches: [ "dev" ]
|
|
pull_request:
|
|
branches: [ "dev", "main" ]
|
|
|
|
env:
|
|
CARGO_TERM_COLOR: always
|
|
CARGO_BUILD_JOBS: 1
|
|
CMAKE_BUILD_PARALLEL_LEVEL: 1
|
|
|
|
jobs:
|
|
rust-lint:
|
|
name: Rust Check & Lint
|
|
runs-on: ubuntu-latest
|
|
steps:
|
|
- name: Install git-lfs
|
|
run: apt-get update && apt-get install -y git-lfs
|
|
- uses: https://github.com/actions/checkout@v4
|
|
with:
|
|
lfs: true
|
|
|
|
- name: Install Rust toolchain
|
|
uses: https://github.com/dtolnay/rust-toolchain@stable
|
|
with:
|
|
components: clippy, rustfmt
|
|
|
|
- name: Cache cargo artifacts
|
|
uses: https://github.com/Swatinem/rust-cache@v2
|
|
|
|
- name: Install shader dependencies
|
|
run: apt-get update && apt-get install -y build-essential cmake python3 ninja-build
|
|
|
|
- name: Check Rust Formatting
|
|
run: cargo fmt --all -- --check
|
|
|
|
- name: Run Clippy
|
|
run: cargo clippy --all-targets --all-features -- -D warnings
|
|
|
|
rust-test:
|
|
name: Rust Tests
|
|
runs-on: ubuntu-latest
|
|
steps:
|
|
- name: Install git-lfs
|
|
run: apt-get update && apt-get install -y git-lfs
|
|
- uses: https://github.com/actions/checkout@v4
|
|
with:
|
|
lfs: true
|
|
|
|
- name: Install Rust toolchain
|
|
uses: https://github.com/dtolnay/rust-toolchain@stable
|
|
|
|
- name: Cache cargo artifacts
|
|
uses: https://github.com/Swatinem/rust-cache@v2
|
|
|
|
- name: Install shader dependencies
|
|
run: apt-get update && apt-get install -y build-essential cmake python3 ninja-build
|
|
|
|
- name: Run Tests
|
|
run: cargo test --workspace --all-features
|
|
|
|
lua-lint:
|
|
name: Lua Lint & Format
|
|
runs-on: ubuntu-latest
|
|
steps:
|
|
- name: Install git-lfs
|
|
run: apt-get update && apt-get install -y git-lfs
|
|
- uses: https://github.com/actions/checkout@v4
|
|
|
|
- name: Check Lua Formatting
|
|
run: |
|
|
curl -L -o stylua.zip https://github.com/JohnnyMorganz/StyLua/releases/latest/download/stylua-linux-x86_64.zip
|
|
unzip stylua.zip
|
|
chmod +x stylua
|
|
./stylua --check assets/scripts/ mods/
|
|
|
|
- name: Run Selene
|
|
run: ./.forgejo/scripts/run-selene.sh
|
|
|
|
lfs-guard:
|
|
name: LFS Pointer Guard
|
|
runs-on: ubuntu-latest
|
|
steps:
|
|
# Checkout without smudging LFS content so the committed git objects can be inspected directly; a raw-committed binary is only distinguishable from a proper pointer at the object level, not in a smudged working tree.
|
|
- name: Install git-lfs
|
|
run: apt-get update && apt-get install -y git-lfs
|
|
- uses: https://github.com/actions/checkout@v4
|
|
with:
|
|
lfs: false
|
|
|
|
- name: Verify LFS-tracked files are stored as pointers
|
|
run: ./.forgejo/scripts/check-lfs-pointers.sh
|