name: CentOS

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

jobs:
  build-arch64:
    runs-on: ubuntu-latest
    container: symless/synergy-core:${{ matrix.distro }}
    env:
      GIT_COMMIT: ${{ github.sha }}
    strategy:
      matrix:
        include:
          - distro: centos7.6
          - distro: centos8

    name: ${{ matrix.distro }}

    steps:
    - uses: actions/checkout@v2

    - name: Build
      run: |
        mkdir build
        cd build
        cmake3 -DCMAKE_BUILD_TYPE=Release -DCMAKE_INSTALL_PREFIX:PATH=$(pwd)/rpm/BUILDROOT/usr ..
        . ./version
        make -j

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