name: CI

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

jobs:
  ci:
    runs-on: ubuntu-latest
    steps:
      - uses: actions/checkout@v4

      - uses: dtolnay/rust-toolchain@stable
        with:
          targets: thumbv7m-none-eabi
      - uses: dtolnay/rust-toolchain@nightly
        with:
          components: clippy, rustfmt

      - uses: Swatinem/rust-cache@v2

      - name: Install just
        uses: extractions/setup-just@v2

      - name: Validate (Nightly)
        run: just validate

      - name: Build std
        run: just build std

      - name: Build no-std
        run: just build no-std

      - name: Test std
        run: just test std

      - name: Test no-std
        run: just test no-std
