traceviewer 0.1.3

Run a command and inspect its logs in a scrollable terminal viewer
name: CI

on:
  push:
    branches:
      - main
  pull_request:
    branches:
      - main
  workflow_call:

permissions:
  contents: read

env:
  CARGO_TERM_COLOR: always

jobs:
  test:
    name: Test (${{ matrix.os }})
    runs-on: ${{ matrix.os }}

    strategy:
      fail-fast: false
      matrix:
        os:
          - ubuntu-24.04
          - macos-15
          - windows-2025

    steps:
      - name: Checkout
        uses: actions/checkout@v4

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

      - name: Install Rust
        run: rustup toolchain install stable --profile minimal --component clippy --component rustfmt

      - name: Select Rust
        run: rustup default stable

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

      - name: Run Clippy
        run: cargo clippy --locked --all-targets --tests --bins --all -- -D warnings

      - name: Run tests
        run: cargo test --locked --all-targets

  ci:
    runs-on: ubuntu-slim
    needs:
      - test
    if: always()
    steps:
      - name: Success
        if: ${{ !(contains(needs.*.result, 'failure')) }}
        run: exit 0

      - name: Failure
        if: ${{ contains(needs.*.result, 'failure') }}
        run: exit 1