1
1
mirror of https://github.com/wez/wezterm.git synced 2024-12-27 15:37:29 +03:00

Ci toolchain: Do not use actions-rs/toolchain (#3327)

* fix(generate-workflows): Do not use actions-rs

[actions-rs/toolchain](https://github.com/actions-rs/toolchain) is unsupported:

- Has not recieved updates since November 2020 (~2.5 years)
- It uses Node.js 12 and GitHub will stop supporting it Summer this year(?) see
  this [article](https://github.blog/changelog/2022-09-22-github-actions-all-actions-will-begin-running-on-node16-instead-of-node12/).

[dtolnay/rust-toolchain](https://github.com/dtolnay/rust-toolchain) is
actively supported and its mostly a 1-1 replacement, the differences are:

- Uses the minimal profile always, so no need to specify it.
- There is no need to override the toolchain.

I also removed some things:

- None of the generated actions use `rustfmt` so I removed the component
- The toolchain is always stable, so I specified it in the action itself
  instead of in the action parameters.

* ci: Regenerate workflows

* fix: Remove ALLOW_UNSECURE_COMMANDS from action

* fix(CentOS7): Manually install rustup as CentOS7 uses a very old curl

* fix: Restart shell so that the rustup command is available

* feat: Add exeption to the CentOS workflow to download rustup

* fix: Remove actions-rs/toolchain from remaining workflows

* fix: Address review comment
This commit is contained in:
Jalil Salamé 2023-03-24 14:16:09 -03:00 committed by GitHub
parent 2e488d57c7
commit 1535d88290
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23
51 changed files with 122 additions and 425 deletions

View File

@ -21,14 +21,9 @@ jobs:
- name: Checkout
uses: actions/checkout@v3
- name: "Install Rust"
uses: actions-rs/toolchain@v1
uses: dtolnay/rust-toolchain@nightly
with:
profile: "minimal"
toolchain: "nightly"
override: true
components: rustfmt
env:
ACTIONS_ALLOW_UNSECURE_COMMANDS: "true"
- name: Build
run: |
source $HOME/.cargo/env

View File

@ -56,14 +56,7 @@ jobs:
with:
submodules: "recursive"
- name: "Install Rust"
uses: actions-rs/toolchain@v1
with:
profile: "minimal"
toolchain: "stable"
override: true
components: "rustfmt"
env:
ACTIONS_ALLOW_UNSECURE_COMMANDS: "true"
uses: dtolnay/rust-toolchain@stable
- name: "Cache cargo"
uses: actions/cache@v3
with:

View File

@ -59,14 +59,7 @@ jobs:
with:
submodules: "recursive"
- name: "Install Rust"
uses: actions-rs/toolchain@v1
with:
profile: "minimal"
toolchain: "stable"
override: true
components: "rustfmt"
env:
ACTIONS_ALLOW_UNSECURE_COMMANDS: "true"
uses: dtolnay/rust-toolchain@stable
- name: "Cache cargo"
uses: actions/cache@v3
with:

View File

@ -39,14 +39,7 @@ jobs:
with:
submodules: "recursive"
- name: "Install Rust"
uses: actions-rs/toolchain@v1
with:
profile: "minimal"
toolchain: "stable"
override: true
components: "rustfmt"
env:
ACTIONS_ALLOW_UNSECURE_COMMANDS: "true"
uses: dtolnay/rust-toolchain@stable
- name: "Cache cargo"
uses: actions/cache@v3
with:

View File

@ -67,15 +67,20 @@ jobs:
uses: actions/checkout@v3
with:
submodules: "recursive"
- name: "Install Rust"
uses: actions-rs/toolchain@v1
with:
profile: "minimal"
toolchain: "stable"
override: true
components: "rustfmt"
env:
ACTIONS_ALLOW_UNSECURE_COMMANDS: "true"
- name: "Install Rustup"
shell: bash
run: |
if ! command -v rustup &>/dev/null; then
curl --proto '=https' --tlsv1.2 --retry 10 -fsSL "https://sh.rustup.rs" | sh -s -- --default-toolchain none -y
echo "${CARGO_HOME:-$HOME/.cargo}/bin" >> $GITHUB_PATH
fi
- name: "Setup Toolchain"
shell: bash
run: |
rustup toolchain install stable --profile minimal --no-self-update
rustup default stable
- name: "Cache cargo"
uses: actions/cache@v3
with:

View File

@ -71,15 +71,20 @@ jobs:
uses: actions/checkout@v3
with:
submodules: "recursive"
- name: "Install Rust"
uses: actions-rs/toolchain@v1
with:
profile: "minimal"
toolchain: "stable"
override: true
components: "rustfmt"
env:
ACTIONS_ALLOW_UNSECURE_COMMANDS: "true"
- name: "Install Rustup"
shell: bash
run: |
if ! command -v rustup &>/dev/null; then
curl --proto '=https' --tlsv1.2 --retry 10 -fsSL "https://sh.rustup.rs" | sh -s -- --default-toolchain none -y
echo "${CARGO_HOME:-$HOME/.cargo}/bin" >> $GITHUB_PATH
fi
- name: "Setup Toolchain"
shell: bash
run: |
rustup toolchain install stable --profile minimal --no-self-update
rustup default stable
- name: "Cache cargo"
uses: actions/cache@v3
with:

View File

@ -50,15 +50,20 @@ jobs:
uses: actions/checkout@v3
with:
submodules: "recursive"
- name: "Install Rust"
uses: actions-rs/toolchain@v1
with:
profile: "minimal"
toolchain: "stable"
override: true
components: "rustfmt"
env:
ACTIONS_ALLOW_UNSECURE_COMMANDS: "true"
- name: "Install Rustup"
shell: bash
run: |
if ! command -v rustup &>/dev/null; then
curl --proto '=https' --tlsv1.2 --retry 10 -fsSL "https://sh.rustup.rs" | sh -s -- --default-toolchain none -y
echo "${CARGO_HOME:-$HOME/.cargo}/bin" >> $GITHUB_PATH
fi
- name: "Setup Toolchain"
shell: bash
run: |
rustup toolchain install stable --profile minimal --no-self-update
rustup default stable
- name: "Cache cargo"
uses: actions/cache@v3
with:

View File

@ -54,14 +54,7 @@ jobs:
with:
submodules: "recursive"
- name: "Install Rust"
uses: actions-rs/toolchain@v1
with:
profile: "minimal"
toolchain: "stable"
override: true
components: "rustfmt"
env:
ACTIONS_ALLOW_UNSECURE_COMMANDS: "true"
uses: dtolnay/rust-toolchain@stable
- name: "Cache cargo"
uses: actions/cache@v3
with:

View File

@ -58,14 +58,7 @@ jobs:
with:
submodules: "recursive"
- name: "Install Rust"
uses: actions-rs/toolchain@v1
with:
profile: "minimal"
toolchain: "stable"
override: true
components: "rustfmt"
env:
ACTIONS_ALLOW_UNSECURE_COMMANDS: "true"
uses: dtolnay/rust-toolchain@stable
- name: "Cache cargo"
uses: actions/cache@v3
with:

View File

@ -37,14 +37,7 @@ jobs:
with:
submodules: "recursive"
- name: "Install Rust"
uses: actions-rs/toolchain@v1
with:
profile: "minimal"
toolchain: "stable"
override: true
components: "rustfmt"
env:
ACTIONS_ALLOW_UNSECURE_COMMANDS: "true"
uses: dtolnay/rust-toolchain@stable
- name: "Cache cargo"
uses: actions/cache@v3
with:

View File

@ -54,14 +54,7 @@ jobs:
with:
submodules: "recursive"
- name: "Install Rust"
uses: actions-rs/toolchain@v1
with:
profile: "minimal"
toolchain: "stable"
override: true
components: "rustfmt"
env:
ACTIONS_ALLOW_UNSECURE_COMMANDS: "true"
uses: dtolnay/rust-toolchain@stable
- name: "Cache cargo"
uses: actions/cache@v3
with:

View File

@ -58,14 +58,7 @@ jobs:
with:
submodules: "recursive"
- name: "Install Rust"
uses: actions-rs/toolchain@v1
with:
profile: "minimal"
toolchain: "stable"
override: true
components: "rustfmt"
env:
ACTIONS_ALLOW_UNSECURE_COMMANDS: "true"
uses: dtolnay/rust-toolchain@stable
- name: "Cache cargo"
uses: actions/cache@v3
with:

View File

@ -37,14 +37,7 @@ jobs:
with:
submodules: "recursive"
- name: "Install Rust"
uses: actions-rs/toolchain@v1
with:
profile: "minimal"
toolchain: "stable"
override: true
components: "rustfmt"
env:
ACTIONS_ALLOW_UNSECURE_COMMANDS: "true"
uses: dtolnay/rust-toolchain@stable
- name: "Cache cargo"
uses: actions/cache@v3
with:

View File

@ -57,14 +57,7 @@ jobs:
with:
submodules: "recursive"
- name: "Install Rust"
uses: actions-rs/toolchain@v1
with:
profile: "minimal"
toolchain: "stable"
override: true
components: "rustfmt"
env:
ACTIONS_ALLOW_UNSECURE_COMMANDS: "true"
uses: dtolnay/rust-toolchain@stable
- name: "Cache cargo"
uses: actions/cache@v3
with:

View File

@ -61,14 +61,7 @@ jobs:
with:
submodules: "recursive"
- name: "Install Rust"
uses: actions-rs/toolchain@v1
with:
profile: "minimal"
toolchain: "stable"
override: true
components: "rustfmt"
env:
ACTIONS_ALLOW_UNSECURE_COMMANDS: "true"
uses: dtolnay/rust-toolchain@stable
- name: "Cache cargo"
uses: actions/cache@v3
with:

View File

@ -40,14 +40,7 @@ jobs:
with:
submodules: "recursive"
- name: "Install Rust"
uses: actions-rs/toolchain@v1
with:
profile: "minimal"
toolchain: "stable"
override: true
components: "rustfmt"
env:
ACTIONS_ALLOW_UNSECURE_COMMANDS: "true"
uses: dtolnay/rust-toolchain@stable
- name: "Cache cargo"
uses: actions/cache@v3
with:

View File

@ -57,14 +57,7 @@ jobs:
with:
submodules: "recursive"
- name: "Install Rust"
uses: actions-rs/toolchain@v1
with:
profile: "minimal"
toolchain: "stable"
override: true
components: "rustfmt"
env:
ACTIONS_ALLOW_UNSECURE_COMMANDS: "true"
uses: dtolnay/rust-toolchain@stable
- name: "Cache cargo"
uses: actions/cache@v3
with:

View File

@ -61,14 +61,7 @@ jobs:
with:
submodules: "recursive"
- name: "Install Rust"
uses: actions-rs/toolchain@v1
with:
profile: "minimal"
toolchain: "stable"
override: true
components: "rustfmt"
env:
ACTIONS_ALLOW_UNSECURE_COMMANDS: "true"
uses: dtolnay/rust-toolchain@stable
- name: "Cache cargo"
uses: actions/cache@v3
with:

View File

@ -40,14 +40,7 @@ jobs:
with:
submodules: "recursive"
- name: "Install Rust"
uses: actions-rs/toolchain@v1
with:
profile: "minimal"
toolchain: "stable"
override: true
components: "rustfmt"
env:
ACTIONS_ALLOW_UNSECURE_COMMANDS: "true"
uses: dtolnay/rust-toolchain@stable
- name: "Cache cargo"
uses: actions/cache@v3
with:

View File

@ -51,14 +51,7 @@ jobs:
with:
submodules: "recursive"
- name: "Install Rust"
uses: actions-rs/toolchain@v1
with:
profile: "minimal"
toolchain: "stable"
override: true
components: "rustfmt"
env:
ACTIONS_ALLOW_UNSECURE_COMMANDS: "true"
uses: dtolnay/rust-toolchain@stable
- name: "Cache cargo"
uses: actions/cache@v3
with:

View File

@ -55,14 +55,7 @@ jobs:
with:
submodules: "recursive"
- name: "Install Rust"
uses: actions-rs/toolchain@v1
with:
profile: "minimal"
toolchain: "stable"
override: true
components: "rustfmt"
env:
ACTIONS_ALLOW_UNSECURE_COMMANDS: "true"
uses: dtolnay/rust-toolchain@stable
- name: "Cache cargo"
uses: actions/cache@v3
with:

View File

@ -34,14 +34,7 @@ jobs:
with:
submodules: "recursive"
- name: "Install Rust"
uses: actions-rs/toolchain@v1
with:
profile: "minimal"
toolchain: "stable"
override: true
components: "rustfmt"
env:
ACTIONS_ALLOW_UNSECURE_COMMANDS: "true"
uses: dtolnay/rust-toolchain@stable
- name: "Cache cargo"
uses: actions/cache@v3
with:

View File

@ -51,14 +51,7 @@ jobs:
with:
submodules: "recursive"
- name: "Install Rust"
uses: actions-rs/toolchain@v1
with:
profile: "minimal"
toolchain: "stable"
override: true
components: "rustfmt"
env:
ACTIONS_ALLOW_UNSECURE_COMMANDS: "true"
uses: dtolnay/rust-toolchain@stable
- name: "Cache cargo"
uses: actions/cache@v3
with:

View File

@ -55,14 +55,7 @@ jobs:
with:
submodules: "recursive"
- name: "Install Rust"
uses: actions-rs/toolchain@v1
with:
profile: "minimal"
toolchain: "stable"
override: true
components: "rustfmt"
env:
ACTIONS_ALLOW_UNSECURE_COMMANDS: "true"
uses: dtolnay/rust-toolchain@stable
- name: "Cache cargo"
uses: actions/cache@v3
with:

View File

@ -34,14 +34,7 @@ jobs:
with:
submodules: "recursive"
- name: "Install Rust"
uses: actions-rs/toolchain@v1
with:
profile: "minimal"
toolchain: "stable"
override: true
components: "rustfmt"
env:
ACTIONS_ALLOW_UNSECURE_COMMANDS: "true"
uses: dtolnay/rust-toolchain@stable
- name: "Cache cargo"
uses: actions/cache@v3
with:

View File

@ -51,14 +51,7 @@ jobs:
with:
submodules: "recursive"
- name: "Install Rust"
uses: actions-rs/toolchain@v1
with:
profile: "minimal"
toolchain: "stable"
override: true
components: "rustfmt"
env:
ACTIONS_ALLOW_UNSECURE_COMMANDS: "true"
uses: dtolnay/rust-toolchain@stable
- name: "Cache cargo"
uses: actions/cache@v3
with:

View File

@ -55,14 +55,7 @@ jobs:
with:
submodules: "recursive"
- name: "Install Rust"
uses: actions-rs/toolchain@v1
with:
profile: "minimal"
toolchain: "stable"
override: true
components: "rustfmt"
env:
ACTIONS_ALLOW_UNSECURE_COMMANDS: "true"
uses: dtolnay/rust-toolchain@stable
- name: "Cache cargo"
uses: actions/cache@v3
with:

View File

@ -34,14 +34,7 @@ jobs:
with:
submodules: "recursive"
- name: "Install Rust"
uses: actions-rs/toolchain@v1
with:
profile: "minimal"
toolchain: "stable"
override: true
components: "rustfmt"
env:
ACTIONS_ALLOW_UNSECURE_COMMANDS: "true"
uses: dtolnay/rust-toolchain@stable
- name: "Cache cargo"
uses: actions/cache@v3
with:

View File

@ -30,14 +30,7 @@ jobs:
with:
submodules: "recursive"
- name: "Install Rust"
uses: actions-rs/toolchain@v1
with:
profile: "minimal"
toolchain: "stable"
override: true
components: "rustfmt"
env:
ACTIONS_ALLOW_UNSECURE_COMMANDS: "true"
uses: dtolnay/rust-toolchain@stable
- name: "Install Rust (ARM)"
shell: bash
run: "rustup target add aarch64-apple-darwin"

View File

@ -33,14 +33,7 @@ jobs:
with:
submodules: "recursive"
- name: "Install Rust"
uses: actions-rs/toolchain@v1
with:
profile: "minimal"
toolchain: "stable"
override: true
components: "rustfmt"
env:
ACTIONS_ALLOW_UNSECURE_COMMANDS: "true"
uses: dtolnay/rust-toolchain@stable
- name: "Install Rust (ARM)"
shell: bash
run: "rustup target add aarch64-apple-darwin"

View File

@ -18,14 +18,7 @@ jobs:
with:
submodules: "recursive"
- name: "Install Rust"
uses: actions-rs/toolchain@v1
with:
profile: "minimal"
toolchain: "stable"
override: true
components: "rustfmt"
env:
ACTIONS_ALLOW_UNSECURE_COMMANDS: "true"
uses: dtolnay/rust-toolchain@stable
- name: "Install Rust (ARM)"
shell: bash
run: "rustup target add aarch64-apple-darwin"

View File

@ -54,14 +54,7 @@ jobs:
with:
submodules: "recursive"
- name: "Install Rust"
uses: actions-rs/toolchain@v1
with:
profile: "minimal"
toolchain: "stable"
override: true
components: "rustfmt"
env:
ACTIONS_ALLOW_UNSECURE_COMMANDS: "true"
uses: dtolnay/rust-toolchain@stable
- name: "Cache cargo"
uses: actions/cache@v3
with:

View File

@ -58,14 +58,7 @@ jobs:
with:
submodules: "recursive"
- name: "Install Rust"
uses: actions-rs/toolchain@v1
with:
profile: "minimal"
toolchain: "stable"
override: true
components: "rustfmt"
env:
ACTIONS_ALLOW_UNSECURE_COMMANDS: "true"
uses: dtolnay/rust-toolchain@stable
- name: "Cache cargo"
uses: actions/cache@v3
with:

View File

@ -37,14 +37,7 @@ jobs:
with:
submodules: "recursive"
- name: "Install Rust"
uses: actions-rs/toolchain@v1
with:
profile: "minimal"
toolchain: "stable"
override: true
components: "rustfmt"
env:
ACTIONS_ALLOW_UNSECURE_COMMANDS: "true"
uses: dtolnay/rust-toolchain@stable
- name: "Cache cargo"
uses: actions/cache@v3
with:

View File

@ -57,14 +57,7 @@ jobs:
with:
submodules: "recursive"
- name: "Install Rust"
uses: actions-rs/toolchain@v1
with:
profile: "minimal"
toolchain: "stable"
override: true
components: "rustfmt"
env:
ACTIONS_ALLOW_UNSECURE_COMMANDS: "true"
uses: dtolnay/rust-toolchain@stable
- name: "Cache cargo"
uses: actions/cache@v3
with:

View File

@ -61,14 +61,7 @@ jobs:
with:
submodules: "recursive"
- name: "Install Rust"
uses: actions-rs/toolchain@v1
with:
profile: "minimal"
toolchain: "stable"
override: true
components: "rustfmt"
env:
ACTIONS_ALLOW_UNSECURE_COMMANDS: "true"
uses: dtolnay/rust-toolchain@stable
- name: "Cache cargo"
uses: actions/cache@v3
with:

View File

@ -40,14 +40,7 @@ jobs:
with:
submodules: "recursive"
- name: "Install Rust"
uses: actions-rs/toolchain@v1
with:
profile: "minimal"
toolchain: "stable"
override: true
components: "rustfmt"
env:
ACTIONS_ALLOW_UNSECURE_COMMANDS: "true"
uses: dtolnay/rust-toolchain@stable
- name: "Cache cargo"
uses: actions/cache@v3
with:

View File

@ -62,14 +62,7 @@ jobs:
with:
submodules: "recursive"
- name: "Install Rust"
uses: actions-rs/toolchain@v1
with:
profile: "minimal"
toolchain: "stable"
override: true
components: "rustfmt"
env:
ACTIONS_ALLOW_UNSECURE_COMMANDS: "true"
uses: dtolnay/rust-toolchain@stable
- name: "Cache cargo"
uses: actions/cache@v3
with:

View File

@ -66,14 +66,7 @@ jobs:
with:
submodules: "recursive"
- name: "Install Rust"
uses: actions-rs/toolchain@v1
with:
profile: "minimal"
toolchain: "stable"
override: true
components: "rustfmt"
env:
ACTIONS_ALLOW_UNSECURE_COMMANDS: "true"
uses: dtolnay/rust-toolchain@stable
- name: "Cache cargo"
uses: actions/cache@v3
with:

View File

@ -42,14 +42,7 @@ jobs:
with:
submodules: "recursive"
- name: "Install Rust"
uses: actions-rs/toolchain@v1
with:
profile: "minimal"
toolchain: "stable"
override: true
components: "rustfmt"
env:
ACTIONS_ALLOW_UNSECURE_COMMANDS: "true"
uses: dtolnay/rust-toolchain@stable
- name: "Cache cargo"
uses: actions/cache@v3
with:

View File

@ -57,14 +57,7 @@ jobs:
with:
submodules: "recursive"
- name: "Install Rust"
uses: actions-rs/toolchain@v1
with:
profile: "minimal"
toolchain: "stable"
override: true
components: "rustfmt"
env:
ACTIONS_ALLOW_UNSECURE_COMMANDS: "true"
uses: dtolnay/rust-toolchain@stable
- name: "Cache cargo"
uses: actions/cache@v3
with:

View File

@ -61,14 +61,7 @@ jobs:
with:
submodules: "recursive"
- name: "Install Rust"
uses: actions-rs/toolchain@v1
with:
profile: "minimal"
toolchain: "stable"
override: true
components: "rustfmt"
env:
ACTIONS_ALLOW_UNSECURE_COMMANDS: "true"
uses: dtolnay/rust-toolchain@stable
- name: "Cache cargo"
uses: actions/cache@v3
with:

View File

@ -40,14 +40,7 @@ jobs:
with:
submodules: "recursive"
- name: "Install Rust"
uses: actions-rs/toolchain@v1
with:
profile: "minimal"
toolchain: "stable"
override: true
components: "rustfmt"
env:
ACTIONS_ALLOW_UNSECURE_COMMANDS: "true"
uses: dtolnay/rust-toolchain@stable
- name: "Cache cargo"
uses: actions/cache@v3
with:

View File

@ -26,15 +26,9 @@ jobs:
with:
submodules: "recursive"
- name: "Install Rust"
uses: actions-rs/toolchain@v1
uses: dtolnay/rust-toolchain@stable
with:
profile: "minimal"
toolchain: "stable"
override: true
components: "rustfmt"
target: "x86_64-pc-windows-msvc"
env:
ACTIONS_ALLOW_UNSECURE_COMMANDS: "true"
- name: "Cache cargo"
uses: actions/cache@v3
with:

View File

@ -30,15 +30,9 @@ jobs:
with:
submodules: "recursive"
- name: "Install Rust"
uses: actions-rs/toolchain@v1
uses: dtolnay/rust-toolchain@stable
with:
profile: "minimal"
toolchain: "stable"
override: true
components: "rustfmt"
target: "x86_64-pc-windows-msvc"
env:
ACTIONS_ALLOW_UNSECURE_COMMANDS: "true"
- name: "Cache cargo"
uses: actions/cache@v3
with:

View File

@ -16,15 +16,9 @@ jobs:
with:
submodules: "recursive"
- name: "Install Rust"
uses: actions-rs/toolchain@v1
uses: dtolnay/rust-toolchain@stable
with:
profile: "minimal"
toolchain: "stable"
override: true
components: "rustfmt"
target: "x86_64-pc-windows-msvc"
env:
ACTIONS_ALLOW_UNSECURE_COMMANDS: "true"
- name: "Cache cargo"
uses: actions/cache@v3
with:

View File

@ -32,15 +32,7 @@ jobs:
- name: Checkout
uses: actions/checkout@v3
- name: "Install Rust"
uses: actions-rs/toolchain@v1
with:
profile: "minimal"
toolchain: "stable"
default: true
override: true
components: "rustfmt"
env:
ACTIONS_ALLOW_UNSECURE_COMMANDS: "true"
uses: dtolnay/rust-toolchain@stable
- name: Install gelatyx
uses: baptiste0928/cargo-install@v1
with:

View File

@ -31,13 +31,7 @@ jobs:
- name: Checkout
uses: actions/checkout@v3
- name: "Install Rust"
uses: actions-rs/toolchain@v1
with:
profile: "minimal"
toolchain: "stable"
override: true
env:
ACTIONS_ALLOW_UNSECURE_COMMANDS: "true"
uses: dtolnay/rust-toolchain@stable
- name: Build
run: |
source $HOME/.cargo/env
@ -50,13 +44,7 @@ jobs:
- name: Checkout
uses: actions/checkout@v3
- name: "Install Rust"
uses: actions-rs/toolchain@v1
with:
profile: "minimal"
toolchain: "nightly"
override: true
env:
ACTIONS_ALLOW_UNSECURE_COMMANDS: "true"
uses: dtolnay/rust-toolchain@nightly
- name: "Cache cargo"
uses: actions/cache@v3
with:

View File

@ -20,13 +20,7 @@ jobs:
- name: Checkout
uses: actions/checkout@v3
- name: "Install Rust"
uses: actions-rs/toolchain@v1
with:
profile: "minimal"
toolchain: "stable"
override: true
env:
ACTIONS_ALLOW_UNSECURE_COMMANDS: "true"
uses: dtolnay/rust-toolchain@stable
- name: Install gelatyx
uses: baptiste0928/cargo-install@v1
with:

View File

@ -29,13 +29,7 @@ jobs:
- name: Checkout
uses: actions/checkout@v3
- name: "Install Rust"
uses: actions-rs/toolchain@v1
with:
profile: "minimal"
toolchain: "stable"
override: true
env:
ACTIONS_ALLOW_UNSECURE_COMMANDS: "true"
uses: dtolnay/rust-toolchain@stable
- name: Build
run: |
source $HOME/.cargo/env
@ -47,13 +41,7 @@ jobs:
- name: Checkout
uses: actions/checkout@v3
- name: "Install Rust"
uses: actions-rs/toolchain@v1
with:
profile: "minimal"
toolchain: "stable"
override: true
env:
ACTIONS_ALLOW_UNSECURE_COMMANDS: "true"
uses: dtolnay/rust-toolchain@stable
- name: Build
run: |
source $HOME/.cargo/env

View File

@ -325,25 +325,41 @@ ln -s /usr/local/git/bin/git /usr/local/bin/git""",
return steps
def install_rust(self, cache=True):
def install_rust(self, cache=True, toolchain="stable"):
salt = "2"
key_prefix = f"{self.name}-{self.rust_target}-{salt}-${{{{ runner.os }}}}-${{{{ hashFiles('**/Cargo.lock') }}}}"
params = {
"profile": "minimal",
"toolchain": "stable",
"override": True,
"components": "rustfmt",
}
params = dict()
if self.rust_target:
params["target"] = self.rust_target
steps = [
ActionStep(
name="Install Rust",
action="actions-rs/toolchain@v1",
params=params,
env={"ACTIONS_ALLOW_UNSECURE_COMMANDS": "true"},
),
]
steps = []
# Manually setup rust toolchain in CentOS7 curl is too old for the action
if "centos7" in self.name:
steps += [
RunStep(
name="Install Rustup",
run = """
if ! command -v rustup &>/dev/null; then
curl --proto '=https' --tlsv1.2 --retry 10 -fsSL "https://sh.rustup.rs" | sh -s -- --default-toolchain none -y
echo "${CARGO_HOME:-$HOME/.cargo}/bin" >> $GITHUB_PATH
fi
"""
),
RunStep(
name="Setup Toolchain",
run =f"""
rustup toolchain install {toolchain} --profile minimal --no-self-update
rustup default {toolchain}
"""
),
]
else:
steps += [
ActionStep(
name="Install Rust",
action=f"dtolnay/rust-toolchain@{toolchain}",
params=params,
),
]
if "macos" in self.name:
steps += [
RunStep(