mirror of
https://github.com/openharmony/third_party_rust_rustix.git
synced 2026-07-19 14:53:33 -04:00
Update to actions/checkout@v2 and the latest install-rust files.
This commit is contained in:
@@ -1,7 +1,5 @@
|
||||
# install-rust
|
||||
|
||||
Author: Alex Crichton <alex@alexcrichton.com>
|
||||
|
||||
A small github action to install `rustup` and a Rust toolchain. This is
|
||||
generally expressed inline, but it was repeated enough in this repository it
|
||||
seemed worthwhile to extract.
|
||||
@@ -17,4 +15,4 @@ When the above are fixed we should delete this action and just use this inline:
|
||||
```yml
|
||||
- run: rustup update $toolchain && rustup default $toolchain
|
||||
shell: bash
|
||||
```
|
||||
```
|
||||
|
||||
@@ -1,4 +1,3 @@
|
||||
# Author: Alex Crichton <alex@alexcrichton.com>
|
||||
name: 'Install Rust toolchain'
|
||||
description: 'Install both `rustup` and a Rust toolchain'
|
||||
|
||||
@@ -10,4 +9,4 @@ inputs:
|
||||
|
||||
runs:
|
||||
using: node12
|
||||
main: 'main.js'
|
||||
main: 'main.js'
|
||||
|
||||
@@ -1,11 +1,15 @@
|
||||
// Author: Alex Crichton <alex@alexcrichton.com>
|
||||
const child_process = require('child_process');
|
||||
const toolchain = process.env.INPUT_TOOLCHAIN;
|
||||
const fs = require('fs');
|
||||
|
||||
function set_env(name, val) {
|
||||
fs.appendFileSync(process.env['GITHUB_ENV'], `${name}=${val}\n`)
|
||||
}
|
||||
|
||||
if (process.platform === 'darwin') {
|
||||
child_process.execSync(`curl https://sh.rustup.rs | sh -s -- -y --default-toolchain=none --profile=minimal`);
|
||||
const bindir = `${process.env.HOME}/.cargo/bin`;
|
||||
console.log(`::add-path::${bindir}`);
|
||||
fs.appendFileSync(process.env['GITHUB_PATH'], `${bindir}\n`);
|
||||
process.env.PATH = `${process.env.PATH}:${bindir}`;
|
||||
}
|
||||
|
||||
@@ -16,13 +20,13 @@ child_process.execFileSync('rustup', ['default', toolchain]);
|
||||
// Deny warnings on CI to keep our code warning-free as it lands in-tree. Don't
|
||||
// do this on nightly though since there's a fair amount of warning churn there.
|
||||
if (!toolchain.startsWith('nightly')) {
|
||||
console.log(`::set-env name=RUSTFLAGS::-D warnings`);
|
||||
set_env("RUSTFLAGS", "-D warnings");
|
||||
}
|
||||
|
||||
// Save disk space by avoiding incremental compilation, and also we don't use
|
||||
// any caching so incremental wouldn't help anyway.
|
||||
console.log(`::set-env name=CARGO_INCREMENTAL::0`);
|
||||
set_env("CARGO_INCREMENTAL", "0");
|
||||
|
||||
// Turn down debuginfo from 2 to 1 to help save disk space
|
||||
console.log(`::set-env name=CARGO_PROFILE_DEV_DEBUG::1`);
|
||||
console.log(`::set-env name=CARGO_PROFILE_TEST_DEBUG::1`);
|
||||
set_env("CARGO_PROFILE_DEV_DEBUG", "1");
|
||||
set_env("CARGO_PROFILE_TEST_DEBUG", "1");
|
||||
|
||||
@@ -11,7 +11,7 @@ jobs:
|
||||
name: Rustfmt
|
||||
runs-on: ubuntu-latest
|
||||
steps:
|
||||
- uses: actions/checkout@v1
|
||||
- uses: actions/checkout@v2
|
||||
with:
|
||||
submodules: true
|
||||
- uses: ./.github/actions/install-rust
|
||||
@@ -37,7 +37,7 @@ jobs:
|
||||
rust: nightly
|
||||
|
||||
steps:
|
||||
- uses: actions/checkout@v1
|
||||
- uses: actions/checkout@v2
|
||||
with:
|
||||
submodules: true
|
||||
- uses: ./.github/actions/install-rust
|
||||
@@ -81,7 +81,7 @@ jobs:
|
||||
rust: nightly
|
||||
|
||||
steps:
|
||||
- uses: actions/checkout@v1
|
||||
- uses: actions/checkout@v2
|
||||
with:
|
||||
submodules: true
|
||||
- uses: ./.github/actions/install-rust
|
||||
|
||||
Reference in New Issue
Block a user