flip-link 0.1.1

Flips the memory layout of embedded programs to protect against stack overflows
name: CI

on:
  push:
    branches: [ main]
  pull_request:
    branches: [ main ]
  schedule:
    # runs 1 min after 2 or 1 AM (summer/winter) berlin time
    - cron: '1 0 * * *'
env:
  CARGO_TERM_COLOR: always
  APP_NAME : test-flip-link-app
  CORE_TARGET: thumbv7m-none-eabi # needed by `core`

jobs:
  test:
    strategy:
      matrix:
        rust:
          - stable
          - nightly
        os:
          - ubuntu-latest
          - macOS-latest
          - windows-latest
    runs-on: ${{ matrix.os }}
    timeout-minutes: 10
    steps:
    - uses: actions/checkout@v2
    - uses: actions-rs/toolchain@v1
      with:
        profile: minimal
        toolchain: ${{ matrix.rust }}
        override: true
    - name: Build
      run: RUSTFLAGS='--deny warnings' cargo build
      shell: bash
    - name: Check fmt
      # we only need to check fmt on one OS and
      # fmt should only be checked on stable
      if: matrix.os == 'ubuntu-latest' && matrix.rust == 'stable'
      run: |
        rustup component add rustfmt
        cargo fmt --all -- --check

  build_app:
    strategy:
      matrix:
        rust:
          - stable
          - nightly
        os:
          - ubuntu-latest
          - macOS-latest
          - windows-latest
    runs-on: ${{ matrix.os }}
    timeout-minutes: 20
    steps:
      - name: Check out flip-link repo
        uses: actions/checkout@v2
      - uses: actions-rs/toolchain@v1
        with:
          profile: minimal
          toolchain: ${{ matrix.rust }}
          override: true
          target: ${{ env.CORE_TARGET }}
      - name: Install dependencies
        run: |
          cargo install --debug --path .
      - name: Build App
        run: |
          cd ${{ env.APP_NAME }}
          cargo build --examples