name: Check Makefile

on:
  push:
    branches: [ master, release/v8.* ]
  pull_request:
    branches: [ master, release/v8.* ]

# https://docs.github.com/en/actions/writing-workflows/workflow-syntax-for-github-actions#concurrency
# Ensure that only one commit will be running tests at a time on each push
concurrency:
  group: ${{ github.ref }}-${{ github.workflow }} 
  cancel-in-progress: true

jobs:
  build:
    if: ${{ github.event_name != 'pull_request' || github.repository != github.event.pull_request.head.repo.full_name }}
    runs-on: ubuntu-24.04
    name: Build using Makefile
    steps:
    - uses: actions/checkout@v6
    - uses: ammaraskar/gcc-problem-matcher@master
    - name: Setup Python
      uses: actions/setup-python@v6
      with:
        python-version: '3.12'
    - name: Install prerequisites
      run: scripts/install-prerequisites.sh
    - name: Build
      working-directory: tests/makefiles
      run: make test_file
