name: test-dependencies
description: Installs test dependencies for Serai

inputs:
  monero-version:
    description: "Monero version to download and run as a regtest node"
    required: false
    default: v0.18.3.1

  bitcoin-version:
    description: "Bitcoin version to download and run as a regtest node"
    required: false
    default: "27.0"

runs:
  using: "composite"
  steps:
    - name: Install Build Dependencies
      uses: ./.github/actions/build-dependencies

    - name: Install Foundry
      uses: foundry-rs/foundry-toolchain@8f1998e9878d786675189ef566a2e4bf24869773
      with:
        version: nightly-f625d0fa7c51e65b4bf1e8f7931cd1c6e2e285e9
        cache: false

    - name: Run a Monero Regtest Node
      uses: ./.github/actions/monero
      with:
        version: ${{ inputs.monero-version }}

    - name: Run a Bitcoin Regtest Node
      uses: ./.github/actions/bitcoin
      with:
        version: ${{ inputs.bitcoin-version }}

    - name: Run a Monero Wallet-RPC
      uses: ./.github/actions/monero-wallet-rpc