Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
32 changes: 32 additions & 0 deletions .github/workflows/ci.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,32 @@
name: CI

on:
pull_request:
types: [opened, ready_for_review, synchronize, reopened]
workflow_dispatch:

env:
CARGO_TERM_COLOR: always

jobs:
test:
if: github.event.pull_request.draft == false
runs-on: ubuntu-latest

steps:
- uses: actions/checkout@v6

- name: Setup Rust
uses: dtolnay/rust-toolchain@stable

- name: Cache cargo build
uses: Swatinem/rust-cache@v2

- name: Check code formatting
run: cargo fmt --all -- --check

- name: Run clippy Check
run: cargo clippy -- -D clippy::correctness

- name: Run tests
run: cargo test --all --verbose
18 changes: 18 additions & 0 deletions Cargo.toml
Original file line number Diff line number Diff line change
Expand Up @@ -30,3 +30,21 @@ lto = true
codegen-units = 1
panic = "abort"
strip = true

[lints.rust]
unsafe_code = "forbid"
missing_debug_implementations = "warn"

[lints.clippy]
# Enable for educational purposes, but don't block CI
pedantic = "warn"
nursery = "warn"

# To avoid .unwrap() usage
unwrap_used = "warn"

# Float comparisons can be problematic
float_cmp = "warn"

# Allow many arguments in functions for GUI code
#too_many_arguments = "allow"
15 changes: 15 additions & 0 deletions rust-toolchain.toml
Original file line number Diff line number Diff line change
@@ -0,0 +1,15 @@
[toolchain]
channel = "stable"

components = [
"rustfmt",
"clippy",
"rust-analysis",
"rust-docs",
"rust-src"
]

targets = [
"x86_64-unknown-linux-gnu",
"aarch64-unknown-linux-gnu"
]