name: Install Solana

inputs:
  solana_version:
    description: Version of Solana to install
    required: true
    default: 1.10.40

runs:
  using: "composite"
  steps:
#    - name: Cache Solana Install
#      id: cache-solana-install
#      uses: actions/cache@v3
#      with:
#        path: |
#          ~/.cache/solana/
#          ~/.local/share/solana/
#        key: ${{ runner.os }}-Solana-v${{ inputs.solana_version  }}

    - run: sh -c "$(curl -sSfL https://release.solana.com/v${{ inputs.solana_version }}/install)"
      shell: bash

    - name: Add Solana bin to Path
      run: |
        echo "$HOME/.local/share/solana/install/active_release/bin" >> $GITHUB_PATH
      shell: bash

    - name: Verify Solana install
      run: |
        solana --version
      shell: bash
