name: Cargo Build & Test

on:
  push:
  pull_request:

env: 
  CARGO_TERM_COLOR: always

jobs:
  build_and_test:
    name: Rust project
    runs-on: ubuntu-latest
    steps:
      - uses: actions/checkout@v4
      - run: rustup toolchain install stable --profile minimal
      - uses: Swatinem/rust-cache@v2
      - name: setup toolchain
        uses: hecrj/setup-rust-action@v2
        with:
          rust-version: stable
      - run: cargo build --verbose
      - run: cargo test --verbose
  
