xod 1.0.1

A tiny REPL for bitwise arithmetic and expression evaluation.
Documentation
name: Test, Format, and Lint

on:
  push:
    branches:
      - main
  pull_request:
  workflow_dispatch:

env:
  CARGO_TERM_COLOR: always

jobs:
  sonarqube:
    name: SonarQube
    runs-on: ubuntu-latest
    steps:
      - name: Checkout
        uses: actions/checkout@v4
        with:
          fetch-depth: 0

      - name: Setup Rust
        uses: actions-rust-lang/setup-rust-toolchain@v1
        with:
          toolchain: stable
          cache-key: ${{ runner.os }}-stable

      - name: SonarQube Scan
        uses: SonarSource/sonarqube-scan-action@v5
        env:
          SONAR_TOKEN: ${{ secrets.SONAR_TOKEN }}

  test:
    name: Test
    runs-on: ubuntu-latest
    strategy:
      matrix:
        toolchain:
          - stable
          - beta
          - nightly
    steps:
      - name: Checkout
        uses: actions/checkout@v4
        with:
          fetch-depth: 0

      - name: Setup Rust
        uses: actions-rust-lang/setup-rust-toolchain@v1
        with:
          toolchain: ${{ matrix.toolchain }}
          cache-key: ${{ runner.os }}-${{ matrix.toolchain }}

      - name: Build
        run: cargo build

      - name: Test
        run: cargo test --verbose

  lint:
    name: Lint
    runs-on: ubuntu-latest
    strategy:
      matrix:
        toolchain:
          - stable
          - beta
          - nightly
    steps:
      - name: Checkout
        uses: actions/checkout@v4
        with:
          fetch-depth: 0

      - name: Setup Rust
        uses: actions-rust-lang/setup-rust-toolchain@v1
        with:
          toolchain: ${{ matrix.toolchain }}
          components: clippy,rustfmt
          cache-key: ${{ runner.os }}-${{ matrix.toolchain }}

      - name: Run cargo checks
        run: cargo check --verbose

      - name: Run clippy
        run: cargo clippy --verbose -- -D warnings

      - name: Run rustfmt
        uses: actions-rust-lang/rustfmt@v1

      - name: Run cargo-deny
        uses: EmbarkStudios/cargo-deny-action@v2