name: Raspbian-armhf

on: [push, pull_request]

jobs:
  build:

    runs-on: self-hosted-rpi3

    steps:
    - name: clean-up
      run: rm -rf /home/pi/actions-runner/_work/snapcast/snap*_armhf.deb
    - uses: actions/checkout@v2
    - name: cmake build
      run: mkdir build && cd build && cmake -DBOOST_ROOT=/home/pi/Develop/boost_1_75_0 -DCMAKE_BUILD_TYPE=Release -DWERROR=ON -DCMAKE_CXX_FLAGS="$CXXFLAGS -Wno-psabi" -DCMAKE_CXX_COMPILER_LAUNCHER=ccache .. && cd ..
    - name: cmake make
      run: cmake --build build -- -j 2
    - name: debian package
      run: fakeroot make -f debian/rules CMAKEFLAGS="-DBOOST_ROOT=/home/pi/Develop/boost_1_75_0 -DCMAKE_CXX_COMPILER_LAUNCHER=ccache" binary
    - name: Archive artifacts
      uses: actions/upload-artifact@v2
      with:
        name: develop_snapshot_armhf-${{github.sha}}
        path: /home/pi/actions-runner/_work/snapcast/snap??????_*_armhf.deb
