name: Setup Rust description: Install Rust version and setup caching inputs: targets: description: Rust targets to install required: false default: wasm32-unknown-unknown components: description: Rust components to install required: false default: "" runs: using: composite steps: - name: Install Rust toolchain uses: dtolnay/rust-toolchain@1.86.0 with: targets: ${{ inputs.targets }} components: ${{ inputs.components }} - uses: Swatinem/rust-cache@v2 with: save-if: ${{ github.ref == 'refs/heads/main' || github.ref == 'refs/heads/dev' }} # Cache target directory but with smart cleanup cache-on-failure: false # Add shared key to deduplicate cache across jobs shared-key: "rust-cache" # Only save cache from main/dev branches to reduce storage workspaces: ". -> target"