name: Rust
on:
  push:
    branches: [ "main" ]
  pull_request:
    branches: [ "main" ]

env:
  CARGO_TERM_COLOR: always

jobs:
  build:
    runs-on: ubuntu-latest
    steps:
    - uses: actions/checkout@v4
    
    # Install dependencies required for egui/eframe on Linux
    - name: Install dependencies
      run: sudo apt-get update && sudo apt-get install -y libxkbcommon-dev libvulkan-dev
      
    - name: Cache cargo registry
      uses: Swatinem/rust-cache@v2.7.7

    - name: Run clippy
      run: cargo clippy --all-targets --all-features -- -D warnings

    - name: Build
      run: cargo build --release
