Files
OpenShell/.github/actions/setup-rust/action.yml
Simon ScattonandEvan Lezar 24706c175b ci(rust): parallelize branch checks (#3462)
* ci(rust): parallelize branch checks

Signed-off-by: Simon Scatton <sscatton@nvidia.com>

* ci(rust): acknowledge trusted sccache environment

Signed-off-by: Simon Scatton <sscatton@nvidia.com>

* ci(rust): remove ineffective sccache backend

Signed-off-by: Simon Scatton <sscatton@nvidia.com>

* ci(rust): retain dependency boundary checks

Signed-off-by: Evan Lezar <elezar@nvidia.com>

---------

Signed-off-by: Simon Scatton <sscatton@nvidia.com>
Signed-off-by: Evan Lezar <elezar@nvidia.com>
Co-authored-by: Evan Lezar <elezar@nvidia.com>
2026-09-22 08:35:42 +00:00

38 lines
1.2 KiB
YAML

# SPDX-FileCopyrightText: Copyright (c) 2025-2026 NVIDIA CORPORATION & AFFILIATES. All rights reserved.
# SPDX-License-Identifier: Apache-2.0
name: Setup Rust
description: Configure the Nix development shell and Rust caches
inputs:
cache-key:
description: Rust target cache namespace
required: true
save-cache:
description: Whether this job writes the Rust target cache
required: false
default: "false"
runs:
using: composite
steps:
- name: Hash Nix development shell
id: dev-shell
shell: bash
run: |
shell_drv=$(nix eval --raw --impure .#devShells --apply 'shells: shells.${builtins.currentSystem}.default.drvPath')
echo "hash=$(nix hash file --type sha256 --base16 "$shell_drv")" >> "$GITHUB_OUTPUT"
- name: Realize Nix development shell
shell: bash
run: nix develop -c true
- name: Cache Rust target and registry
uses: Swatinem/rust-cache@6323deb102c322ba6fcbdcafc7e3dddab59af2b6 # v2.9.2
with:
shared-key: ${{ inputs.cache-key }}-${{ steps.dev-shell.outputs.hash }}
save-if: ${{ inputs.save-cache }}
cache-on-failure: ${{ inputs.save-cache }}
cache-bin: "false"
cmd-format: nix develop -c {0}