ling-lang 2030.1.47

Ling - The Omniglot Systems Language
Documentation
name: CI

on:
  push:
    branches: [master, main, develop]
  pull_request:
    branches: [master, main]

env:
  CARGO_TERM_COLOR: always

jobs:
  test:
    name: Build & Test
    runs-on: ubuntu-latest
    steps:
      - uses: actions/checkout@v4

      - name: Install Rust (stable)
        uses: dtolnay/rust-toolchain@stable

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

      # minifb (graphics) needs X11/Wayland headers; cpal (audio) needs ALSA.
      - name: Install system dependencies
        run: |
          sudo apt-get update
          sudo apt-get install -y --no-install-recommends \
            libasound2-dev libudev-dev libxkbcommon-dev libwayland-dev xorg-dev

      # ling-kernel is excluded from both steps below: it's no_std/bare-metal
      # and requires the nightly toolchain (`#![feature(abi_x86_interrupt)]`,
      # plus `-Z build-std` for a real build — see `ling build --platform
      # kernel` / gen_kernel_cargo_toml in src/main.rs), which this job never
      # installs (stable only, line 20). `cargo build --workspace` without
      # the exclude fails immediately with E0554 ("#![feature] may not be
      # used on the stable release channel") — confirmed against the exact
      # CI failure. Its own boot assembly (boot32.rs) also calls
      # `kernel_entry`, which it never defines itself (only a generated
      # kernel project's main.rs does), so even on nightly `cargo test`
      # would fail to link a standalone test binary for it regardless.
      #
      # ling-user is excluded from the test step only: it's the no_std
      # userland runtime ring-3 LingOS processes link against, with its own
      # `#[panic_handler]` (see crates/ling-user/src/entry.rs) — its own
      # Cargo.toml already sets `test = false` to stop `cargo test -p
      # ling-user` from linking std alongside that handler (E0152 duplicate
      # `panic_impl`), but a workspace-wide `cargo test` still pulls it into
      # the shared test-profile dependency graph unless excluded here too.
      # It builds fine as an ordinary rlib dependency, so `cargo build`
      # doesn't need the same exclude.
      - name: Build
        run: cargo build --workspace --exclude ling-kernel --verbose

      - name: Run tests
        run: cargo test --workspace --exclude ling-kernel --exclude ling-user --verbose

  lint:
    name: Format & Clippy (non-blocking)
    runs-on: ubuntu-latest
    # Advisory only — does not gate the CI status / test badge.
    continue-on-error: true
    steps:
      - uses: actions/checkout@v4
      - uses: dtolnay/rust-toolchain@stable
        with:
          components: rustfmt, clippy
      - name: Format check
        run: cargo fmt --all -- --check
      - name: Clippy
        run: cargo clippy --workspace