unwind-context 0.2.2

Macro to add colored panic context to your functions
Documentation
name: build

on:
  pull_request:
  push:
    branches:
      - master

defaults:
  run:
    shell: bash

env:
  CARGO_TERM_COLOR: always

jobs:
  cargo-fmt:
    name: Check formatting
    runs-on: ubuntu-latest
    steps:
      - uses: actions/checkout@v4
      - run: rustup toolchain install nightly --profile minimal --component rustfmt
      - run: cargo +nightly fmt --all -- --check

  cargo-clippy:
    name: Run linter
    runs-on: ubuntu-latest
    strategy:
      matrix:
        rust-toolchain:
          - stable
          - beta
          - nightly
          - 1.70.0
    steps:
      - uses: actions/checkout@v4
      - run: rustup toolchain install ${{ matrix.rust-toolchain }} --profile minimal --component clippy
      - run: rustup default ${{ matrix.rust-toolchain }}
      - run: cargo clippy --all-targets --no-default-features -- -D warnings
      - run: cargo clippy --all-targets -- -D warnings
      - run: cargo clippy --all-targets --no-default-features --features "std" -- -D warnings
      - run: cargo clippy --all-targets --no-default-features --features "detect-color-support" -- -D warnings
      - run: cargo clippy --all-targets --no-default-features --features "custom-default-colors" -- -D warnings
      - run: cargo clippy --all-targets --all-features -- -D warnings

  cargo-test:
    name: Test sources
    runs-on: ubuntu-latest
    strategy:
      matrix:
        rust-toolchain:
          - stable
          - beta
          - nightly
          - 1.70.0
        cargo-flags:
          - ""
          - "--release"
    steps:
      - uses: actions/checkout@v4
      - run: rustup toolchain install ${{ matrix.rust-toolchain }} --profile minimal
      - run: rustup default ${{ matrix.rust-toolchain }}
      - run: cargo test --all-targets ${{ matrix.cargo-flags }} --no-default-features
      - run: cargo test --all-targets ${{ matrix.cargo-flags }}
      - run: cargo test --all-targets ${{ matrix.cargo-flags }} --no-default-features --features "std"
      - run: cargo test --all-targets ${{ matrix.cargo-flags }} --no-default-features --features "detect-color-support"
      - run: cargo test --all-targets ${{ matrix.cargo-flags }} --no-default-features --features "custom-default-colors"
      - run: cargo test --all-targets ${{ matrix.cargo-flags }} --all-features

  cargo-check-no-alloc:
    name: Check no-alloc compatibility
    runs-on: ubuntu-latest
    defaults:
      run:
        working-directory: ./tests/no-alloc
    steps:
      - uses: actions/checkout@v4
      - run: rustup toolchain install stable --profile minimal
      - run: cargo clippy -- -D warnings
      - run: cargo build

  cargo-check-no-std:
    name: Check no-std compatibility
    runs-on: ubuntu-latest
    defaults:
      run:
        working-directory: ./tests/no-std
    steps:
      - uses: actions/checkout@v4
      - run: rustup toolchain install stable --profile minimal
      - run: cargo clippy -- -D warnings
      - run: cargo build

  cargo-deny:
    name: Check licenses/bans/advisories/sources
    runs-on: ubuntu-latest
    steps:
      - uses: actions/checkout@v4
      - run: rustup toolchain install stable --profile minimal
      - run: cargo install cargo-deny
      - run: cargo deny --workspace --all-features check