ci: add build and lint workflows
Some checks are pending
Build / errornowatcher (push) Waiting to run
Lint / Cargo.toml (push) Waiting to run
Lint / Rust (push) Waiting to run

This commit is contained in:
Ryan 2025-03-11 18:05:17 -04:00
parent f77aea28d1
commit 7b6041989e
Signed by: ErrorNoInternet
GPG Key ID: 2486BFB7B1E6A4A3
2 changed files with 105 additions and 0 deletions

37
.github/workflows/build.yaml vendored Normal file
View File

@ -0,0 +1,37 @@
name: Build
on:
push:
paths:
- "**.rs"
- "Cargo.*"
pull_request:
workflow_dispatch:
jobs:
errornowatcher:
name: errornowatcher
runs-on: ubuntu-24.04
steps:
- name: Clone repository
uses: actions/checkout@v4
- name: Install build dependencies
run: sudo apt install -y libluajit-5.1-dev mold
- name: Set up build cache
uses: actions/cache@v4
with:
path: |
~/.cargo/bin/
~/.cargo/registry/index/
~/.cargo/registry/cache/
~/.cargo/git/db/
target/
key: build-${{ runner.os }}-${{ hashFiles('Cargo.*') }}
- name: Switch to nightly toolchain
run: rustup default nightly
- name: Build in release mode
run: cargo build --release

68
.github/workflows/lint.yaml vendored Normal file
View File

@ -0,0 +1,68 @@
name: Lint
on:
push:
paths:
- "**.rs"
- "Cargo.*"
pull_request:
workflow_dispatch:
jobs:
cargo-toml:
name: Cargo.toml
runs-on: ubuntu-24.04
steps:
- name: Clone repository
uses: actions/checkout@v4
- name: Install taplo
uses: uncenter/setup-taplo@v1
- name: Run taplo lint
run: taplo lint Cargo.toml
- name: Run taplo fmt
if: always()
run: taplo fmt --check Cargo.toml
rust:
name: Rust
runs-on: ubuntu-24.04
steps:
- name: Clone repository
uses: actions/checkout@v4
- name: Install build dependencies
run: sudo apt install -y libluajit-5.1-dev mold
- name: Set up build cache
uses: actions/cache@v4
with:
path: |
~/.cargo/bin/
~/.cargo/registry/index/
~/.cargo/registry/cache/
~/.cargo/git/db/
target/
key: build-${{ runner.os }}-${{ hashFiles('Cargo.*') }}
- name: Switch to nightly toolchain
run: rustup default nightly
- name: Install components
run: rustup component add clippy rustfmt
- name: cargo clippy
run: >-
cargo clippy -- -D clippy::pedantic
-A clippy::missing_errors_doc
-A clippy::missing_panics_doc
-A clippy::must_use_candidate
-A clippy::needless-pass-by-value
-A clippy::unnecessary-wraps
- name: cargo fmt
if: always()
run: cargo fmt --check