Made it possible to add component
This commit is contained in:
parent
8e306a9c7f
commit
9aeef8beba
|
@ -25,6 +25,7 @@ jobs:
|
||||||
with:
|
with:
|
||||||
toolchain: nightly
|
toolchain: nightly
|
||||||
override: true
|
override: true
|
||||||
|
component: clippy
|
||||||
|
|
||||||
# `cargo check` command here will use installed `nightly`
|
# `cargo check` command here will use installed `nightly`
|
||||||
# as it set as an "override" for current directory
|
# as it set as an "override" for current directory
|
||||||
|
@ -44,6 +45,7 @@ See [additional recipes here](https://github.com/actions-rs/meta).
|
||||||
* `target`: Additionally install specific target for this toolchain (ex. `x86_64-apple-darwin`)
|
* `target`: Additionally install specific target for this toolchain (ex. `x86_64-apple-darwin`)
|
||||||
* `default`: Set installed toolchain as default (executes `rustup toolchain default {toolchain}`)
|
* `default`: Set installed toolchain as default (executes `rustup toolchain default {toolchain}`)
|
||||||
* `override`: Set installed toolchain as an override for current directory
|
* `override`: Set installed toolchain as an override for current directory
|
||||||
|
* `component`: Set additional component (see the below section) to add to the toolchain
|
||||||
|
|
||||||
## Components
|
## Components
|
||||||
|
|
||||||
|
|
|
@ -30,7 +30,8 @@ export interface ToolchainOptions {
|
||||||
name: string,
|
name: string,
|
||||||
target?: string,
|
target?: string,
|
||||||
default: boolean,
|
default: boolean,
|
||||||
override: boolean
|
override: boolean,
|
||||||
|
component?: string
|
||||||
}
|
}
|
||||||
|
|
||||||
export function toolchain_args(): ToolchainOptions {
|
export function toolchain_args(): ToolchainOptions {
|
||||||
|
@ -38,6 +39,7 @@ export function toolchain_args(): ToolchainOptions {
|
||||||
name: getInput('toolchain', {required: true}),
|
name: getInput('toolchain', {required: true}),
|
||||||
target: getInput('target') || undefined,
|
target: getInput('target') || undefined,
|
||||||
default: inputBoolean('default'),
|
default: inputBoolean('default'),
|
||||||
override: inputBoolean('override')
|
override: inputBoolean('override'),
|
||||||
|
component: getInput('component') || undefined
|
||||||
};
|
};
|
||||||
}
|
}
|
||||||
|
|
|
@ -89,6 +89,10 @@ async function run() {
|
||||||
if (opts.target) {
|
if (opts.target) {
|
||||||
await exec.exec(rustup, ['target', 'add', '--toolchain', opts.name, opts.target]);
|
await exec.exec(rustup, ['target', 'add', '--toolchain', opts.name, opts.target]);
|
||||||
}
|
}
|
||||||
|
|
||||||
|
if (opts.component) {
|
||||||
|
await exec.exec(rustup, ['component', 'add', opts.component, '--toolchain', opts.name]);
|
||||||
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
async function main() {
|
async function main() {
|
||||||
|
|
Loading…
Reference in New Issue