name: Rust

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

env:
  CARGO_TERM_COLOR: always

jobs:
  build:
    strategy:
      matrix:
        os: [ubuntu-latest, macos-latest, windows-latest]
        rustup: [stable]

    runs-on: ${{ matrix.os }}

    steps:
      - uses: actions/checkout@v4

      - name: script/linux
        run: chmod +x ./script/linux && ./script/linux
        if: matrix.os == 'ubuntu-latest'

      - name: Build
        run: cargo build --verbose

      - name: Run tests
        run: cargo test --verbose
