Forgejo drop-in for dtolnay/rust-toolchain: install a Rust toolchain via rustup (components, targets, profile). No github.com.
  • Shell 84.6%
  • Makefile 15.4%
Find a file
Stephen Way 9b46df9a85
All checks were successful
test / unit (push) Successful in 4s
test / e2e (push) Successful in 13s
Guard optional-array loops for macOS bash 3.2 (#1)
2026-06-02 03:15:13 +00:00
.forgejo/workflows Initial release: setup-rust-action 2026-05-31 19:44:17 -07:00
scripts Guard optional-array loops for macOS bash 3.2 (#1) 2026-06-02 03:15:13 +00:00
tests Guard optional-array loops for macOS bash 3.2 (#1) 2026-06-02 03:15:13 +00:00
.gitignore Initial release: setup-rust-action 2026-05-31 19:44:17 -07:00
action.yml Initial release: setup-rust-action 2026-05-31 19:44:17 -07:00
CHANGELOG.md Initial release: setup-rust-action 2026-05-31 19:44:17 -07:00
LICENSE Initial release: setup-rust-action 2026-05-31 19:44:17 -07:00
Makefile Initial release: setup-rust-action 2026-05-31 19:44:17 -07:00
MIGRATION.md Initial release: setup-rust-action 2026-05-31 19:44:17 -07:00
README.md Initial release: setup-rust-action 2026-05-31 19:44:17 -07:00

Setup Rust (Forgejo)

Forgejo's dtolnay/rust-toolchain. Install a Rust toolchain with rustup on a self-hosted Forgejo runner: channel or pinned version, components, targets, profile. rustup comes from sh.rustup.rs and toolchains from static.rust-lang.org, so nothing here depends on github.com or a PAT.

Part of the Fjord Actions bundle. Pairs with rust-cache-action for the cargo cache.

Usage

jobs:
  build:
    runs-on: [self-hosted, Linux]
    steps:
      - uses: actions/checkout@v6

      - uses: https://rasterhub.com/rasterstate/setup-rust-action@v1
        with:
          toolchain: stable
          components: rustfmt, clippy

      - uses: https://rasterhub.com/rasterstate/rust-cache-action@v1
      - run: cargo test --all --locked

Inputs

Input Default Description
toolchain stable Channel (stable/beta/nightly), version (1.79.0), or dated nightly (nightly-2026-01-01).
targets Cross-compile targets to add, comma or space separated.
components Extra components (e.g. rustfmt, clippy), comma or space separated.
profile minimal rustup profile: minimal / default / complete.
override true Set the installed toolchain as the default (rustup default).

Outputs

Output Description
version The installed rustc version string.
cachekey Short hash of rustc -vV, handy as a cache-key segment.

Notes

  • If rustup is already on the runner it's used as-is; otherwise it's installed non-interactively with the chosen profile. ~/.cargo/bin is added to GITHUB_PATH for later steps.
  • This action does not cache anything. Use rust-cache-action for the cargo registry/target cache; pass cachekey into your own cache key if you cache manually.

See MIGRATION.md for differences from dtolnay/rust-toolchain.

License

MIT, see LICENSE.