name: "Setup Rust"
description: "Setup rust environment and dependencies"
runs:
  using: "composite"

  steps:
    - name: setup rust
      shell: bash
      run: |
        # Specify an exact Rust version.
        #
        # Newer versions will enable newer features, but at the same time, you may get newer warnings which you have
        # to fix. This should be a manual step.
        rustup install 1.84.0
        rustup default 1.84.0
        rustup component add rustfmt clippy
    - name: Versions
      shell: bash
      run: |
        rustup --version
        cargo --version
        rustc --version
    - name: Add rust targets
      if: env.rust-targets != ''
      shell: bash
      run: rustup target add ${{ env.rust-targets }}
