name: mdspan version check

on:
  pull_request:
    paths:
      - '.github/workflows/mdspan-version-check.yml'
      - 'tpls/mdspan-hash.txt'
      - 'tpls/mdspan/**'

permissions: read-all

jobs:
  mdspan-version-check:
    runs-on: ubuntu-latest
    steps:
    - uses: actions/checkout@8e8c483db84b4bee98b60c0593521ed34d9990e8 # v6.0.1
    - run: echo "ref=$(cat tpls/mdspan-hash.txt)" >> $GITHUB_ENV
    - uses: actions/checkout@8e8c483db84b4bee98b60c0593521ed34d9990e8 # v6.0.1
      with:
        repository: kokkos/mdspan
        ref: ${{ env.ref }}
        path: kokkos-mdspan
    - run: |
        rm kokkos-mdspan/include/experimental/mdarray
        rm kokkos-mdspan/include/experimental/mdspan
        diff --unified=3 --recursive tpls/mdspan/include kokkos-mdspan/include
