name: Test

on:
  push:
    branches: [ "*" ]
  pull_request:
    branches: [ master ]

env:
  CARGO_TERM_COLOR: always
  TARGET: thumbv6m-none-eabi

jobs:
  test:
    runs-on: ubuntu-latest
    strategy:
      matrix:
        include:
          - rust: stable
            features:
          - rust: stable
            features: std
          - rust: stable
            features: serde
          - rust: stable
            features: std,serde
          - rust: beta
            features:
          - rust: beta
            features: std
          - rust: beta
            features: serde
          - rust: beta
            features: std,serde
          - rust: nightly
            features:
          - rust: nightly
            features: std
          - rust: nightly
            features: serde
          - rust: nightly
            features: std,serde

    steps:
    - uses: actions/checkout@v4
    - uses: dtolnay/rust-toolchain@master
      with:
        toolchain: ${{ matrix.rust }}
    - name: Run tests
      run: cargo test --verbose --no-default-features --features "${{ matrix.features }}"
    - name: Run tests in release mode
      run: cargo test --release --verbose --no-default-features --features "${{ matrix.features }}"
    
