defmt-serial 0.12.0

Log defmt-messages over serial
Documentation
name: Rust tests

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

env:
  CARGO_TERM_COLOR: always
  DEFMT_LOG: debug

jobs:
  build:

    runs-on: ubuntu-latest
    container:
      image: ubuntu:20.04

    steps:
      - uses: actions/checkout@v2

      - name: Install deps
        run: |
          apt-get -y update
          apt-get -y install build-essential libssl-dev gcc-arm-none-eabi binutils-arm-none-eabi libclang-dev clang curl git

      - name: Install latest nightly
        uses: actions-rs/toolchain@v1
        with:
            toolchain: nightly
            override: true

      - name: Install rust deps
        run: |
          cargo install defmt-print

      - name: Add rust target for thumbv6m, thumbv7em and musl
        run: |
          rustup target add thumbv7em-none-eabihf
          rustup target add thumbv6m-none-eabi
          rustup target add x86_64-unknown-linux-musl

      - name: Build
        run: cargo build --verbose

      - name: Doc tests
        run: cargo test --doc --target thumbv7em-none-eabihf

      # Disabled until ambiq-hal supports eh-1
      # - name: Build artemis example
      #   working-directory: example-artemis
      #   run: cargo build --verbose

      # Disable until example can be updated for eh-1
      # - name: Build pi-pico example
      #   working-directory: example-pi-pico
      #   run: cargo build --verbose

      - name: Build std example
        working-directory: example-std
        run: cargo build --verbose

      - name: Run std example
        working-directory: example-std
        run: cargo run --verbose