name: Set up Conda environment
inputs:
  environment-file:
    description: Conda environment file to use.
    default: environment.yml
runs:
  using: composite
  steps:
    - name: Install ${{ inputs.environment-file }}
      uses: mamba-org/setup-micromamba@add3a49764cedee8ee24e82dfde87f5bc2914462 # v2
      with:
        environment-file: ${{ inputs.environment-file }}
        create-args: pytest<9.1
        environment-name: test
        condarc-file: ci/.condarc
        cache-environment: true
        cache-downloads: true

    - name: Uninstall pyarrow
      if: ${{ env.REMOVE_PYARROW == '1' }}
      run: |
        micromamba remove -y pyarrow
      shell: bash -el {0}
