name: MesonBuildTest
description: "checkout repo, build, and test numpy"
runs:
  using: composite
  steps:
  - name: Build
    shell: 'script -q -e -c "bash --noprofile --norc -eo pipefail {0}"'
    env:
      TERM: xterm-256color
      PKG_CONFIG_PATH: ./.openblas
    run: |
      echo "::group::Installing Build Dependencies"
      pip install -r requirements/build_requirements.txt
      echo "::endgroup::"
      echo "::group::Building NumPy"
      spin build --clean -- ${MESON_ARGS[@]}
      echo "::endgroup::"

  - name: Meson Log
    shell: bash
    if: always()
    run: |
      echo "::group::Meson Log"
      cat build/meson-logs/meson-log.txt
      echo "::endgroup::"

  - name: Test
    shell: 'script -q -e -c "bash --noprofile --norc -eo pipefail {0}"'
    env:
      TERM: xterm-256color
    run: |
      echo "::group::Installing Test Dependencies"
      python -m pip install -r requirements/test_requirements.txt
      echo "::endgroup::"
      echo "::group::Test NumPy"
      spin test -- --durations=10 --timeout=600
      echo "::endgroup::"
