name: Boot-and-Unit-Tests

on:
  push:
    branches:
      - master
    paths-ignore:
      - "utils/**"
      - "doc/**"
      - "docker/**"
  pull_request:
    branches:
      - master
    paths-ignore:
      - "utils/**"
      - "doc/**"
      - "docker/**"
  schedule:
    - cron: "0 5 * * *"

jobs:
  build:
    name: Run boot and unit tests
    runs-on: ubuntu-22.04

    steps:
      - uses: actions/checkout@v3
      - name: Set up Ruby
        uses: ruby/setup-ruby@v1
      - name: Set up Rust nightly
        run: |
          cargo install cargo-binutils rustfilt
      - name: Set up Ruby
        run: |
          gem install bundler
          bundle config set without 'uart'
          bundle install --retry 3
      - name: Make all
        run: |
          bundle exec ruby utils/devtool.rb test_boot
          bundle exec ruby utils/devtool.rb test_unit
