name: Raspberry Pi

on:
  push:
    branches: [ master ]
  pull_request:
    branches: [ master ]

jobs:
  test-on-pi:
    runs-on: ${{ matrix.os }}
    strategy:
      matrix:
        os: [[self-hosted, linux, ARM, pi-3], [self-hosted, linux, ARM64, pi-4]]
    env:
      GIT_COMMIT: ${{ github.sha }}

    steps:
    - uses: actions/checkout@v2

    - name: Build
      run: |
        mkdir -p build; cd build
        cmake -DCMAKE_BUILD_TYPE=Release ..
        make

    - name: Run unit test
      run: ./build/bin/unittests
