name: "Setup Anchor"
description: "Setup Anchor"
runs:
  using: "composite"
  steps:
    - uses: actions/checkout@v2
    - uses: ./.github/actions/setup/
    - uses: ./.github/actions/setup-solana/
    - uses: actions/cache@v2
      name: Cache Anchor Cli
      id: cache-anchor-cli
      with:
          path: |
            ~/.cargo/bin/
            ~/.cargo/registry/index/
            ~/.cargo/registry/cache/
            ~/.cargo/git/db/
            ./target/
          key: anchor-cli-${{ runner.os }}-v0000-${{ env.ANCHOR_VERSION }}
    - run: cargo install --git https://github.com/project-serum/anchor --tag "v$ANCHOR_VERSION" anchor-cli --locked
      shell: bash
      if: steps.cache-anchor-cli.outputs.cache-hit != 'true'

