name: Rust

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

env:
  CARGO_TERM_COLOR: always

jobs:
  build:

    runs-on: ${{ matrix.os }}
    strategy:
      matrix:
        toolchain:
          - stable
          - beta
          - nightly
        os: [ubuntu-latest, windows-latest]

    steps:
    - uses: actions/checkout@v6
    - name: SetupToolchain
      run: rustup update ${{ matrix.toolchain }} && rustup default ${{ matrix.toolchain }}
    - name: BuildDefault
      run: cargo build --verbose
    - name: BuildLog
      run: cargo build --no-default-features -F log --verbose
    - name: BuildCompress
      run: cargo build --no-default-features -F compression --verbose
    - name: BuildConsole
      run: cargo build --no-default-features -F console --verbose
    - name: Run tests
      run: cargo test --all-features --verbose
