name: symfc test using conda-forge environment

on:
  pull_request:
    branches: [ develop ]

jobs:
  build-linux:
    runs-on: ubuntu-latest
    defaults:
      run:
        shell: bash -l {0}
    strategy:
      matrix:
        python-version: ["3.9", "3.10", "3.11", "3.12", "3.13"]

    steps:
    - uses: actions/checkout@v4
    - uses: conda-incubator/setup-miniconda@v3
      with:
        auto-update-conda: true
        channels: conda-forge
        channel-priority: strict
        python-version: ${{ matrix.python-version }}
    - name: Install dependencies
      run: |
        conda activate test
        conda install --yes -c conda-forge python=${{ matrix.python-version }}
        conda install --yes -c conda-forge spglib scipy numpy pytest codecov pytest-cov
    - name: Setup symfc
      run: |
        conda activate test
        pip install -e . -vvv
    - name: Test with pytest
      run: |
        conda activate test
        pytest -v --cov=./ --cov-report=xml
    - name: Upload coverage reports to Codecov
      uses: codecov/codecov-action@v3
      with:
        verbose: true
