name: 'Setup Rust' inputs: rust-version: required: true type: string targets: required: true type: string components: required: false default: cache-context: required: true type: string runs: using: "composite" steps: - uses: dtolnay/rust-toolchain@3c5f7ea28cd621ae0bf5283f0e981fb97b8a7af9 # master id: toolchain with: toolchain: ${{ inputs.rust-version }} targets: ${{ inputs.targets }} components: ${{ inputs.components }} - name: Install i686 dependencies if: "contains(inputs.targets,'i686')" shell: bash run: | sudo dpkg --add-architecture i386 sudo apt-get update sudo apt-get install libssl-dev:i386 gcc-multilib clang -y echo "CC=clang" >> $GITHUB_ENV echo "PKG_CONFIG_SYSROOT_DIR=/" >> $GITHUB_ENV - uses: actions/cache@668228422ae6a00e4ad889ee87cd7109ec5666a7 # v5.0.4 with: path: | ~/.cargo/bin/ ~/.cargo/registry/index/ ~/.cargo/registry/cache/ ~/.cargo/git/db/ target/ key: ${{ inputs.cache-context }}_${{ inputs.targets }}_rustc-${{ steps.toolchain.outputs.cachekey }}_cargo-${{ hashFiles('**/Cargo.lock') }} # Remove build artifacts for the current crate, since it will be rebuilt every # run anyway, but keep dependency artifacts to cache them. # Must be placed after actions/cache so its post step runs first. - uses: pyTooling/Actions/with-post-step@41aed3e559cbf69bfdb46abb25d7c535900ed5b6 # v7.7.0 with: main: bash ./.github/actions/setup-rust/cleanup.sh post: bash ./.github/actions/setup-rust/cleanup.sh