name: beep build CI

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

jobs:
  build:

    runs-on: ubuntu-latest

    steps:
    - uses: actions/checkout@v2
      with:
        fetch-depth: 0
    - name: create local.mk
      run: |
        echo "prefix = ${PWD}/_root" > local.mk
    - name: make
      run: make
    - name: 'beep --help'
      run: |
        ./beep --help > beep-usage.from--help
        diff -u beep-usage.txt beep-usage.from--help
    - name: 'make check'
      run: make check
    - name: 'make install'
      run: make install CC=false
    - name: 'list installed files'
      run: (cd "$PWD/_root" && ls -l $(find . -type f | env LC_ALL=C sort) | nl)
