Compare commits
12 Commits
| Author | SHA1 | Date | |
|---|---|---|---|
|
|
6715f9d030 | ||
|
|
15b1f315b5 | ||
|
|
c8dbab4109 | ||
|
|
003538387b | ||
|
|
d021bc1259 | ||
|
|
8e306a9c7f | ||
|
|
7ad8591ba0 | ||
|
|
fa175680a2 | ||
|
|
bd476ecc6b | ||
|
|
10382284bb | ||
|
|
cfc1332c14 | ||
|
|
6e4f2cb688 |
1
.github/FUNDING.yml
vendored
Normal file
1
.github/FUNDING.yml
vendored
Normal file
@@ -0,0 +1 @@
|
|||||||
|
custom: https://svartalf.info/donate/
|
||||||
18
.github/workflows/ci.yml
vendored
Normal file
18
.github/workflows/ci.yml
vendored
Normal file
@@ -0,0 +1,18 @@
|
|||||||
|
name: Continuous integration
|
||||||
|
|
||||||
|
on: [pull_request, push]
|
||||||
|
|
||||||
|
jobs:
|
||||||
|
check_pr:
|
||||||
|
runs-on: ubuntu-latest
|
||||||
|
steps:
|
||||||
|
- uses: actions/checkout@v1
|
||||||
|
|
||||||
|
- name: "npm ci"
|
||||||
|
run: npm ci
|
||||||
|
|
||||||
|
- name: "npm run build"
|
||||||
|
run: npm run build
|
||||||
|
|
||||||
|
- name: "npm run test"
|
||||||
|
run: npm run test
|
||||||
17
CHANGELOG.md
Normal file
17
CHANGELOG.md
Normal file
@@ -0,0 +1,17 @@
|
|||||||
|
# Changelog
|
||||||
|
All notable changes to this project will be documented in this file.
|
||||||
|
|
||||||
|
The format is based on [Keep a Changelog](https://keepachangelog.com/en/1.0.0/),
|
||||||
|
and this project adheres to [Semantic Versioning](https://semver.org/spec/v2.0.0.html).
|
||||||
|
|
||||||
|
## [1.0.1] - 2019-10-05
|
||||||
|
|
||||||
|
### Changed
|
||||||
|
|
||||||
|
- `target` input is not used as a `--default-target` argument for `rustup` anymore (#8)
|
||||||
|
|
||||||
|
## [1.0.0] - 2019-09-15
|
||||||
|
|
||||||
|
### Added
|
||||||
|
|
||||||
|
- First public version
|
||||||
23
README.md
23
README.md
@@ -1,4 +1,4 @@
|
|||||||
# `rustup toolchain` Action
|
# `rust-toolchain` Action
|
||||||
|
|
||||||

|

|
||||||
[](https://gitter.im/actions-rs/community)
|
[](https://gitter.im/actions-rs/community)
|
||||||
@@ -25,15 +25,26 @@ jobs:
|
|||||||
with:
|
with:
|
||||||
toolchain: nightly
|
toolchain: nightly
|
||||||
override: true
|
override: true
|
||||||
|
|
||||||
|
# `cargo check` command here will use installed `nightly`
|
||||||
|
# as it set as an "override" for current directory
|
||||||
|
|
||||||
|
- name: Run cargo check
|
||||||
|
uses: actions-rs/cargo@v1
|
||||||
|
with:
|
||||||
|
command: check
|
||||||
```
|
```
|
||||||
|
|
||||||
|
See [additional recipes here](https://github.com/actions-rs/meta).
|
||||||
|
|
||||||
## Inputs
|
## Inputs
|
||||||
|
|
||||||
* `toolchain` (*required*): Toolchain name, see [rustup page](https://github.com/rust-lang/rustup.rs#toolchain-specification) for details.\
|
| Name | Required | Description | Type | Default |
|
||||||
Examples: `stable`, `nightly`, `nightly-2019-04-20`
|
| ------------| :------: | ---------------------------------------------------------------------------------------------------------------------------------------| ------ | --------|
|
||||||
* `target`: Additionally install specific target for this toolchain (ex. `x86_64-apple-darwin`)
|
| `toolchain` | ✓ | [Toolchain](https://github.com/rust-lang/rustup.rs#toolchain-specification) name to use, ex. `stable`, `nightly`, `nightly-2019-04-20` | string | |
|
||||||
* `default`: Set installed toolchain as default (executes `rustup toolchain default {TOOLCHAIN}`)
|
| `target` | | Additionally install specified target for this toolchain, ex. `x86_64-apple-darwin` | string | |
|
||||||
* `override`: Set installed toolchain as an override for current directory
|
| `default` | | Set installed toolchain as a default toolchain | bool | false |
|
||||||
|
| `override` | | Set installed toolchain as an override for the current directory | bool | false |
|
||||||
|
|
||||||
## Components
|
## Components
|
||||||
|
|
||||||
|
|||||||
2
dist/index.js
vendored
2
dist/index.js
vendored
File diff suppressed because one or more lines are too long
11260
package-lock.json
generated
11260
package-lock.json
generated
File diff suppressed because it is too large
Load Diff
@@ -1,6 +1,6 @@
|
|||||||
{
|
{
|
||||||
"name": "rust-toolchain",
|
"name": "rust-toolchain",
|
||||||
"version": "1.0.0",
|
"version": "1.0.1",
|
||||||
"private": false,
|
"private": false,
|
||||||
"description": "Install the Rust toolchain",
|
"description": "Install the Rust toolchain",
|
||||||
"main": "lib/main.js",
|
"main": "lib/main.js",
|
||||||
@@ -29,18 +29,18 @@
|
|||||||
"url": "https://github.com/actions-rs/toolchain/issues"
|
"url": "https://github.com/actions-rs/toolchain/issues"
|
||||||
},
|
},
|
||||||
"dependencies": {
|
"dependencies": {
|
||||||
"@actions/core": "^1.0.0",
|
"@actions/core": "^1.1.1",
|
||||||
"@actions/exec": "^1.0.0",
|
"@actions/exec": "^1.0.0",
|
||||||
"@actions/io": "^1.0.0",
|
"@actions/io": "^1.0.0",
|
||||||
"download": "^7.1.0"
|
"download": "^7.1.0"
|
||||||
},
|
},
|
||||||
"devDependencies": {
|
"devDependencies": {
|
||||||
"@types/jest": "^24.0.13",
|
"@types/jest": "^24.0.13",
|
||||||
"@types/node": "^12.7.5",
|
"@types/node": "^12.7.11",
|
||||||
"@zeit/ncc": "^0.20.5",
|
"@zeit/ncc": "^0.20.5",
|
||||||
"jest": "^24.9.0",
|
"jest": "^24.9.0",
|
||||||
"jest-circus": "^24.9.0",
|
"jest-circus": "^24.9.0",
|
||||||
"ts-jest": "^24.0.2",
|
"ts-jest": "^24.1.0",
|
||||||
"typescript": "^3.5.1"
|
"typescript": "^3.5.1"
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|||||||
10
src/main.ts
10
src/main.ts
@@ -32,7 +32,7 @@ function downloadRustInit(url: string, name: string): Promise<string> {
|
|||||||
});
|
});
|
||||||
}
|
}
|
||||||
|
|
||||||
async function get_rustup(toolchain: string, target?: string): Promise<string> {
|
async function get_rustup(toolchain: string): Promise<string> {
|
||||||
try {
|
try {
|
||||||
const foundPath = await io.which('rustup', true);
|
const foundPath = await io.which('rustup', true);
|
||||||
core.debug(`Found rustup at ${foundPath}`);
|
core.debug(`Found rustup at ${foundPath}`);
|
||||||
@@ -46,10 +46,8 @@ async function get_rustup(toolchain: string, target?: string): Promise<string> {
|
|||||||
'--default-toolchain',
|
'--default-toolchain',
|
||||||
toolchain,
|
toolchain,
|
||||||
];
|
];
|
||||||
if (target) {
|
|
||||||
args.push('--default-host');
|
// Note: `target` input can't be used here for `--default-host` argument, see #8
|
||||||
args.push(target);
|
|
||||||
}
|
|
||||||
|
|
||||||
switch (process.platform) {
|
switch (process.platform) {
|
||||||
case 'darwin':
|
case 'darwin':
|
||||||
@@ -74,7 +72,7 @@ async function get_rustup(toolchain: string, target?: string): Promise<string> {
|
|||||||
|
|
||||||
async function run() {
|
async function run() {
|
||||||
const opts = args.toolchain_args();
|
const opts = args.toolchain_args();
|
||||||
const rustup = await get_rustup(opts.name, opts.target);
|
const rustup = await get_rustup(opts.name);
|
||||||
|
|
||||||
await exec.exec(rustup, ['toolchain', 'install', opts.name]);
|
await exec.exec(rustup, ['toolchain', 'install', opts.name]);
|
||||||
|
|
||||||
|
|||||||
Reference in New Issue
Block a user