continuwuity/.forgejo/actions/rust-toolchain/action.yml
Renovate Bot 0a634907f2
Some checks failed
Auto Labeler / Apply labels based on changed files (pull_request_target) Successful in 4s
Documentation / Build and Deploy Documentation (pull_request) Successful in 1m12s
Checks / Prek / Check changed files (pull_request) Successful in 7s
Checks / Changelog / Check changelog is added (pull_request_target) Successful in 7s
Checks / Prek / Pre-commit & Formatting (pull_request) Successful in 2m8s
Checks / Prek / Clippy and Cargo Tests (pull_request) Has been skipped
Documentation / Build and Deploy Documentation (push) Successful in 59s
Mirror Container Images / mirror-images (push) Successful in 1m4s
Checks / Prek / Pre-commit & Formatting (push) Successful in 2m7s
Checks / Prek / Check changed files (push) Successful in 5s
Maintenance / Renovate / Renovate (push) Successful in 2m32s
Checks / Prek / Clippy and Cargo Tests (push) Has been skipped
Release Docker Image / Build linux-amd64 (release) (push) Successful in 12m42s
Release Docker Image / Build linux-arm64 (release) (push) Successful in 9m49s
Release Docker Image / Create Multi-arch Release Manifest (push) Successful in 18s
Release Docker Image / Build linux-amd64 (max-perf) (push) Failing after 3m18s
Release Docker Image / Build linux-arm64 (max-perf) (push) Successful in 30m54s
Release Docker Image / Create Max-Perf Manifest (push) Has been skipped
Release Docker Image / Mirror Images (push) Has been skipped
Release Docker Image / Release Binaries (push) Has been skipped
chore(deps): update github-actions-digest
2026-06-30 05:03:24 +00:00

63 lines
2.3 KiB
YAML

name: rust-toolchain
description: |
Install a Rust toolchain using rustup.
See https://rust-lang.github.io/rustup/concepts/toolchains.html#toolchain-specification
for more information about toolchains.
inputs:
toolchain:
description: |
Rust toolchain name.
See https://rust-lang.github.io/rustup/concepts/toolchains.html#toolchain-specification
required: false
target:
description: Target triple to install for this toolchain
required: false
components:
description: Space-separated list of components to be additionally installed for a new toolchain
required: false
outputs:
rustc_version:
description: The rustc version installed
value: ${{ steps.rustc-version.outputs.version }}
rustup_version:
description: The rustup version installed
value: ${{ steps.rustup-version.outputs.version }}
runs:
using: composite
steps:
- name: Check if rustup is already installed
shell: bash
id: rustup-version
run: |
echo "version=$(rustup --version)" >> $GITHUB_OUTPUT
- name: Cache rustup toolchains
if: steps.rustup-version.outputs.version == ''
uses: actions/cache@caa296126883cff596d87d8935842f9db880ef25 # v5
with:
path: |
~/.rustup
!~/.rustup/tmp
!~/.rustup/downloads
# Requires repo to be cloned if toolchain is not specified
key: continuwuity-${{ runner.os }}-rustup-${{ inputs.toolchain || hashFiles('**/rust-toolchain.toml') }}
- name: Install Rust toolchain
if: steps.rustup-version.outputs.version == ''
shell: bash
run: |
if ! command -v rustup &> /dev/null ; then
curl --proto '=https' --tlsv1.2 --retry 10 --retry-connrefused -fsSL "https://sh.rustup.rs" | sh -s -- --default-toolchain none -y
echo "${CARGO_HOME:-$HOME/.cargo}/bin" >> $GITHUB_PATH
fi
- shell: bash
run: |
set -x
${{ inputs.toolchain && format('rustup override set {0}', inputs.toolchain) }}
${{ inputs.target && format('rustup target add {0}', inputs.target) }}
${{ inputs.components && format('rustup component add {0}', inputs.components) }}
cargo --version
rustc --version
- id: rustc-version
shell: bash
run: |
echo "version=$(rustc --version)" >> $GITHUB_OUTPUT