Compare commits
17 Commits
| Author | SHA1 | Date | |
|---|---|---|---|
|
|
941154aed5 | ||
|
|
a919188b61 | ||
|
|
beaa269702 | ||
|
|
ad3964bd05 | ||
|
|
46a11bddfe | ||
|
|
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
|
||||
23
CHANGELOG.md
Normal file
23
CHANGELOG.md
Normal file
@@ -0,0 +1,23 @@
|
||||
# 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.2] - 2019-10-14
|
||||
|
||||
### Changed
|
||||
|
||||
- Missing `rustup` executable will not raise an annotating warning before the installation anymore (#13)
|
||||
|
||||
## [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)
|
||||
@@ -25,15 +25,26 @@ jobs:
|
||||
with:
|
||||
toolchain: nightly
|
||||
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
|
||||
|
||||
* `toolchain` (*required*): Toolchain name, see [rustup page](https://github.com/rust-lang/rustup.rs#toolchain-specification) for details.\
|
||||
Examples: `stable`, `nightly`, `nightly-2019-04-20`
|
||||
* `target`: Additionally install specific target for this toolchain (ex. `x86_64-apple-darwin`)
|
||||
* `default`: Set installed toolchain as default (executes `rustup toolchain default {TOOLCHAIN}`)
|
||||
* `override`: Set installed toolchain as an override for current directory
|
||||
| Name | Required | Description | Type | Default |
|
||||
| ------------| :------: | ---------------------------------------------------------------------------------------------------------------------------------------| ------ | --------|
|
||||
| `toolchain` | ✓ | [Toolchain](https://github.com/rust-lang/rustup.rs#toolchain-specification) name to use, ex. `stable`, `nightly`, `nightly-2019-04-20` | string | |
|
||||
| `target` | | Additionally install specified target for this toolchain, ex. `x86_64-apple-darwin` | string | |
|
||||
| `default` | | Set installed toolchain as a default toolchain | bool | false |
|
||||
| `override` | | Set installed toolchain as an override for the current directory | bool | false |
|
||||
|
||||
## 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
10
package.json
10
package.json
@@ -1,6 +1,6 @@
|
||||
{
|
||||
"name": "rust-toolchain",
|
||||
"version": "1.0.0",
|
||||
"version": "1.0.2",
|
||||
"private": false,
|
||||
"description": "Install the Rust toolchain",
|
||||
"main": "lib/main.js",
|
||||
@@ -29,18 +29,18 @@
|
||||
"url": "https://github.com/actions-rs/toolchain/issues"
|
||||
},
|
||||
"dependencies": {
|
||||
"@actions/core": "^1.0.0",
|
||||
"@actions/core": "^1.1.1",
|
||||
"@actions/exec": "^1.0.0",
|
||||
"@actions/io": "^1.0.0",
|
||||
"download": "^7.1.0"
|
||||
},
|
||||
"devDependencies": {
|
||||
"@types/jest": "^24.0.13",
|
||||
"@types/node": "^12.7.5",
|
||||
"@types/node": "^12.7.12",
|
||||
"@zeit/ncc": "^0.20.5",
|
||||
"jest": "^24.9.0",
|
||||
"jest-circus": "^24.9.0",
|
||||
"ts-jest": "^24.0.2",
|
||||
"typescript": "^3.5.1"
|
||||
"ts-jest": "^24.1.0",
|
||||
"typescript": "^3.6.4"
|
||||
}
|
||||
}
|
||||
|
||||
12
src/main.ts
12
src/main.ts
@@ -32,13 +32,13 @@ 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 {
|
||||
const foundPath = await io.which('rustup', true);
|
||||
core.debug(`Found rustup at ${foundPath}`);
|
||||
return foundPath;
|
||||
} catch (error) {
|
||||
core.warning('Unable to find rustup, installing it now');
|
||||
core.info('Unable to find rustup, installing it now');
|
||||
}
|
||||
|
||||
let args = [
|
||||
@@ -46,10 +46,8 @@ async function get_rustup(toolchain: string, target?: string): Promise<string> {
|
||||
'--default-toolchain',
|
||||
toolchain,
|
||||
];
|
||||
if (target) {
|
||||
args.push('--default-host');
|
||||
args.push(target);
|
||||
}
|
||||
|
||||
// Note: `target` input can't be used here for `--default-host` argument, see #8
|
||||
|
||||
switch (process.platform) {
|
||||
case 'darwin':
|
||||
@@ -74,7 +72,7 @@ async function get_rustup(toolchain: string, target?: string): Promise<string> {
|
||||
|
||||
async function run() {
|
||||
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]);
|
||||
|
||||
|
||||
Reference in New Issue
Block a user