name: Rust

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

env:
  CARGO_TERM_COLOR: always

jobs:
  build:
    env:
      RUSTFLAGS: -D warnings
    strategy:
      matrix:
        ruby-version: ["3.4.4"]
        sys:
          - os: ubuntu-latest
    runs-on: ${{ matrix.sys.os }}
    steps:
      - uses: actions/checkout@v3
      - uses: ./.github/actions/ruby_install
        with:
          ruby-version: ${{ matrix.ruby-version }}
      - name: Clippy
        run: cargo clippy --all-features --verbose -- -D warnings
      - name: Build
        run: cargo build --all-features --verbose
      - name: Run tests
        run: cargo test --all-features --verbose
