name: Setup
description: Set up Baby Buddy environment and dependencies.
inputs:
  python-version:
    description: 'What Python version to use.'
    required: false
    default: '3.x'
runs:
  using: 'composite'
  steps:
    - uses: actions/setup-python@v3
      id: setup-python
      with:
        python-version: ${{ inputs.python-version }}
    - uses: actions/cache@v3
      with:
        path: |
          ~/.local/share/virtualenvs
          Pipfile.lock
        key: ${{ runner.os }}-python-${{ inputs.python-version }}-pipenv-${{ hashFiles('**/requirements.txt') }}
    - name: Install Python dependencies
      shell: bash
      run: |
        python -m pip install --upgrade pipenv wheel
        pipenv install --dev
    - uses: actions/setup-node@v3
      with:
        node-version: 16
