name: Rust

on:
  push:
    branches: [ "main", "development" ]
  pull_request:
    branches: [ "main", "development" ]
  workflow_dispatch:

env:
  CARGO_TERM_COLOR: always

jobs:
  build:

    runs-on: ubuntu-latest

    steps:
    - uses: actions/checkout@v4
    - name: Build
      run: cargo build --verbose
    - name: Build embassy examples
      working-directory: ./examples/embassy
      run: cargo build --verbose
    - name: Build embassy defmt example
      working-directory: ./examples/embassy/hello_world_defmt
      run: cargo build --verbose
    - name: Run tests
      run: cargo test --verbose
