mirror of
https://github.com/danbulant/oxc
synced 2026-05-24 12:21:58 +00:00
88 lines
2.1 KiB
YAML
88 lines
2.1 KiB
YAML
name: Rustup
|
|
|
|
description: Install Rust with minimal profile and additional components
|
|
|
|
inputs:
|
|
# See https://rust-lang.github.io/rustup/concepts/components.html
|
|
clippy:
|
|
default: false
|
|
required: false
|
|
type: boolean
|
|
fmt:
|
|
default: false
|
|
required: false
|
|
type: boolean
|
|
docs:
|
|
default: false
|
|
required: false
|
|
type: boolean
|
|
restore-cache:
|
|
default: true
|
|
required: false
|
|
type: boolean
|
|
save-cache:
|
|
default: false
|
|
required: false
|
|
type: boolean
|
|
shared-key:
|
|
default: 'warm'
|
|
required: false
|
|
type: string
|
|
|
|
runs:
|
|
using: composite
|
|
steps:
|
|
- name: Print Inputs
|
|
shell: bash
|
|
run: |
|
|
echo 'clippy: ${{ inputs.clippy }}'
|
|
echo 'fmt: ${{ inputs.fmt }}'
|
|
echo 'docs: ${{ inputs.docs }}'
|
|
echo 'restore-cache: ${{ inputs.restore-cache }}'
|
|
echo 'save-cache: ${{ inputs.save-cache }}'
|
|
|
|
- name: Change to minimal profile on MacOS
|
|
shell: bash
|
|
if: runner.os == 'macOS'
|
|
run: |
|
|
sed -i '' -e 's/profile = "default"/profile = "minimal"/g' rust-toolchain.toml
|
|
cat rust-toolchain.toml
|
|
|
|
- name: Change to minimal profile on non-MacOS
|
|
shell: bash
|
|
if: runner.os != 'macOS'
|
|
run: |
|
|
sed -i -e 's/profile = "default"/profile = "minimal"/g' rust-toolchain.toml
|
|
cat rust-toolchain.toml
|
|
|
|
- name: Set minimal
|
|
shell: bash
|
|
run: rustup set profile minimal
|
|
|
|
- name: Add Clippy
|
|
shell: bash
|
|
if: ${{ inputs.clippy == 'true' }}
|
|
run: rustup component add clippy
|
|
|
|
- name: Add Rustfmt
|
|
shell: bash
|
|
if: ${{ inputs.fmt == 'true' }}
|
|
run: rustup component add rustfmt
|
|
|
|
- name: Add docs
|
|
shell: bash
|
|
if: ${{ inputs.docs == 'true' }}
|
|
run: rustup component add rust-docs
|
|
|
|
- name: Install
|
|
shell: bash
|
|
run: |
|
|
rustup show
|
|
git restore .
|
|
|
|
- name: Cache on ${{ github.ref_name }}
|
|
uses: Swatinem/rust-cache@v2
|
|
if: ${{ inputs.restore-cache == 'true' }}
|
|
with:
|
|
shared-key: ${{ inputs.shared-key }}
|
|
save-if: ${{ inputs.save-cache == 'true' }}
|