From 1535d882905a6bac900b8e1eb6cde12373918506 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Jalil=20Salam=C3=A9?= <60845989+jalil-salame@users.noreply.github.com> Date: Fri, 24 Mar 2023 14:16:09 -0300 Subject: [PATCH] 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 --- .github/workflows/fmt.yml | 7 +-- .github/workflows/gen_alpine3.15.yml | 9 +--- .../workflows/gen_alpine3.15_continuous.yml | 9 +--- .github/workflows/gen_alpine3.15_tag.yml | 9 +--- .github/workflows/gen_centos7.yml | 23 ++++++---- .github/workflows/gen_centos7_continuous.yml | 23 ++++++---- .github/workflows/gen_centos7_tag.yml | 23 ++++++---- .github/workflows/gen_centos8.yml | 9 +--- .github/workflows/gen_centos8_continuous.yml | 9 +--- .github/workflows/gen_centos8_tag.yml | 9 +--- .github/workflows/gen_centos9.yml | 9 +--- .github/workflows/gen_centos9_continuous.yml | 9 +--- .github/workflows/gen_centos9_tag.yml | 9 +--- .github/workflows/gen_debian10.3.yml | 9 +--- .../workflows/gen_debian10.3_continuous.yml | 9 +--- .github/workflows/gen_debian10.3_tag.yml | 9 +--- .github/workflows/gen_debian11.yml | 9 +--- .github/workflows/gen_debian11_continuous.yml | 9 +--- .github/workflows/gen_debian11_tag.yml | 9 +--- .github/workflows/gen_fedora35.yml | 9 +--- .github/workflows/gen_fedora35_continuous.yml | 9 +--- .github/workflows/gen_fedora35_tag.yml | 9 +--- .github/workflows/gen_fedora36.yml | 9 +--- .github/workflows/gen_fedora36_continuous.yml | 9 +--- .github/workflows/gen_fedora36_tag.yml | 9 +--- .github/workflows/gen_fedora37.yml | 9 +--- .github/workflows/gen_fedora37_continuous.yml | 9 +--- .github/workflows/gen_fedora37_tag.yml | 9 +--- .github/workflows/gen_macos.yml | 9 +--- .github/workflows/gen_macos_continuous.yml | 9 +--- .github/workflows/gen_macos_tag.yml | 9 +--- .github/workflows/gen_opensuse_leap.yml | 9 +--- .../gen_opensuse_leap_continuous.yml | 9 +--- .github/workflows/gen_opensuse_leap_tag.yml | 9 +--- .github/workflows/gen_opensuse_tumbleweed.yml | 9 +--- .../gen_opensuse_tumbleweed_continuous.yml | 9 +--- .../workflows/gen_opensuse_tumbleweed_tag.yml | 9 +--- .github/workflows/gen_ubuntu20.04.yml | 9 +--- .../workflows/gen_ubuntu20.04_continuous.yml | 9 +--- .github/workflows/gen_ubuntu20.04_tag.yml | 9 +--- .github/workflows/gen_ubuntu22.04.yml | 9 +--- .../workflows/gen_ubuntu22.04_continuous.yml | 9 +--- .github/workflows/gen_ubuntu22.04_tag.yml | 9 +--- .github/workflows/gen_windows.yml | 8 +--- .github/workflows/gen_windows_continuous.yml | 8 +--- .github/workflows/gen_windows_tag.yml | 8 +--- .github/workflows/pages.yml | 10 +--- .github/workflows/termwiz.yml | 16 +------ .github/workflows/verify-pages.yml | 8 +--- .github/workflows/wezterm_ssh.yml | 16 +------ ci/generate-workflows.py | 46 +++++++++++++------ 51 files changed, 122 insertions(+), 425 deletions(-) diff --git a/.github/workflows/fmt.yml b/.github/workflows/fmt.yml index 80eddebff..5260925af 100644 --- a/.github/workflows/fmt.yml +++ b/.github/workflows/fmt.yml @@ -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 diff --git a/.github/workflows/gen_alpine3.15.yml b/.github/workflows/gen_alpine3.15.yml index 9569c4619..7efd3f6fe 100644 --- a/.github/workflows/gen_alpine3.15.yml +++ b/.github/workflows/gen_alpine3.15.yml @@ -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: diff --git a/.github/workflows/gen_alpine3.15_continuous.yml b/.github/workflows/gen_alpine3.15_continuous.yml index b2f77132b..a00572e2a 100644 --- a/.github/workflows/gen_alpine3.15_continuous.yml +++ b/.github/workflows/gen_alpine3.15_continuous.yml @@ -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: diff --git a/.github/workflows/gen_alpine3.15_tag.yml b/.github/workflows/gen_alpine3.15_tag.yml index f593508f5..56712f183 100644 --- a/.github/workflows/gen_alpine3.15_tag.yml +++ b/.github/workflows/gen_alpine3.15_tag.yml @@ -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: diff --git a/.github/workflows/gen_centos7.yml b/.github/workflows/gen_centos7.yml index 9501b537b..67ea56927 100644 --- a/.github/workflows/gen_centos7.yml +++ b/.github/workflows/gen_centos7.yml @@ -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: diff --git a/.github/workflows/gen_centos7_continuous.yml b/.github/workflows/gen_centos7_continuous.yml index 8496d0a7c..104e21181 100644 --- a/.github/workflows/gen_centos7_continuous.yml +++ b/.github/workflows/gen_centos7_continuous.yml @@ -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: diff --git a/.github/workflows/gen_centos7_tag.yml b/.github/workflows/gen_centos7_tag.yml index 359b4de79..965251734 100644 --- a/.github/workflows/gen_centos7_tag.yml +++ b/.github/workflows/gen_centos7_tag.yml @@ -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: diff --git a/.github/workflows/gen_centos8.yml b/.github/workflows/gen_centos8.yml index b875e271d..ae8fdb17b 100644 --- a/.github/workflows/gen_centos8.yml +++ b/.github/workflows/gen_centos8.yml @@ -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: diff --git a/.github/workflows/gen_centos8_continuous.yml b/.github/workflows/gen_centos8_continuous.yml index 770f115fd..d7b491535 100644 --- a/.github/workflows/gen_centos8_continuous.yml +++ b/.github/workflows/gen_centos8_continuous.yml @@ -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: diff --git a/.github/workflows/gen_centos8_tag.yml b/.github/workflows/gen_centos8_tag.yml index 879a79328..3511b9a3b 100644 --- a/.github/workflows/gen_centos8_tag.yml +++ b/.github/workflows/gen_centos8_tag.yml @@ -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: diff --git a/.github/workflows/gen_centos9.yml b/.github/workflows/gen_centos9.yml index 94957c22e..7963f1627 100644 --- a/.github/workflows/gen_centos9.yml +++ b/.github/workflows/gen_centos9.yml @@ -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: diff --git a/.github/workflows/gen_centos9_continuous.yml b/.github/workflows/gen_centos9_continuous.yml index 874ec90f8..bf9fd3e64 100644 --- a/.github/workflows/gen_centos9_continuous.yml +++ b/.github/workflows/gen_centos9_continuous.yml @@ -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: diff --git a/.github/workflows/gen_centos9_tag.yml b/.github/workflows/gen_centos9_tag.yml index bf8dfdc23..791f2b565 100644 --- a/.github/workflows/gen_centos9_tag.yml +++ b/.github/workflows/gen_centos9_tag.yml @@ -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: diff --git a/.github/workflows/gen_debian10.3.yml b/.github/workflows/gen_debian10.3.yml index b3e7e8d8c..a7bd2012e 100644 --- a/.github/workflows/gen_debian10.3.yml +++ b/.github/workflows/gen_debian10.3.yml @@ -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: diff --git a/.github/workflows/gen_debian10.3_continuous.yml b/.github/workflows/gen_debian10.3_continuous.yml index 83eb456ef..8e192fc32 100644 --- a/.github/workflows/gen_debian10.3_continuous.yml +++ b/.github/workflows/gen_debian10.3_continuous.yml @@ -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: diff --git a/.github/workflows/gen_debian10.3_tag.yml b/.github/workflows/gen_debian10.3_tag.yml index 7420cf7fa..9925312a5 100644 --- a/.github/workflows/gen_debian10.3_tag.yml +++ b/.github/workflows/gen_debian10.3_tag.yml @@ -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: diff --git a/.github/workflows/gen_debian11.yml b/.github/workflows/gen_debian11.yml index f236c4ae2..5cb56b834 100644 --- a/.github/workflows/gen_debian11.yml +++ b/.github/workflows/gen_debian11.yml @@ -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: diff --git a/.github/workflows/gen_debian11_continuous.yml b/.github/workflows/gen_debian11_continuous.yml index b5ed60ce2..8743be94e 100644 --- a/.github/workflows/gen_debian11_continuous.yml +++ b/.github/workflows/gen_debian11_continuous.yml @@ -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: diff --git a/.github/workflows/gen_debian11_tag.yml b/.github/workflows/gen_debian11_tag.yml index 22da28f85..78eb7dfd0 100644 --- a/.github/workflows/gen_debian11_tag.yml +++ b/.github/workflows/gen_debian11_tag.yml @@ -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: diff --git a/.github/workflows/gen_fedora35.yml b/.github/workflows/gen_fedora35.yml index 6c9e8b01d..540fef447 100644 --- a/.github/workflows/gen_fedora35.yml +++ b/.github/workflows/gen_fedora35.yml @@ -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: diff --git a/.github/workflows/gen_fedora35_continuous.yml b/.github/workflows/gen_fedora35_continuous.yml index 803f74354..2109e8173 100644 --- a/.github/workflows/gen_fedora35_continuous.yml +++ b/.github/workflows/gen_fedora35_continuous.yml @@ -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: diff --git a/.github/workflows/gen_fedora35_tag.yml b/.github/workflows/gen_fedora35_tag.yml index 25cd3d0e1..7f0446ed0 100644 --- a/.github/workflows/gen_fedora35_tag.yml +++ b/.github/workflows/gen_fedora35_tag.yml @@ -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: diff --git a/.github/workflows/gen_fedora36.yml b/.github/workflows/gen_fedora36.yml index 9c8e969ff..3f198afc3 100644 --- a/.github/workflows/gen_fedora36.yml +++ b/.github/workflows/gen_fedora36.yml @@ -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: diff --git a/.github/workflows/gen_fedora36_continuous.yml b/.github/workflows/gen_fedora36_continuous.yml index 2e1bd8837..ea1ceca59 100644 --- a/.github/workflows/gen_fedora36_continuous.yml +++ b/.github/workflows/gen_fedora36_continuous.yml @@ -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: diff --git a/.github/workflows/gen_fedora36_tag.yml b/.github/workflows/gen_fedora36_tag.yml index dc9a70186..c2a48d687 100644 --- a/.github/workflows/gen_fedora36_tag.yml +++ b/.github/workflows/gen_fedora36_tag.yml @@ -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: diff --git a/.github/workflows/gen_fedora37.yml b/.github/workflows/gen_fedora37.yml index 41fdab173..f12782207 100644 --- a/.github/workflows/gen_fedora37.yml +++ b/.github/workflows/gen_fedora37.yml @@ -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: diff --git a/.github/workflows/gen_fedora37_continuous.yml b/.github/workflows/gen_fedora37_continuous.yml index 6ecc49f1a..afe4957cf 100644 --- a/.github/workflows/gen_fedora37_continuous.yml +++ b/.github/workflows/gen_fedora37_continuous.yml @@ -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: diff --git a/.github/workflows/gen_fedora37_tag.yml b/.github/workflows/gen_fedora37_tag.yml index 406956a19..6fa5483c7 100644 --- a/.github/workflows/gen_fedora37_tag.yml +++ b/.github/workflows/gen_fedora37_tag.yml @@ -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: diff --git a/.github/workflows/gen_macos.yml b/.github/workflows/gen_macos.yml index aa4d0199a..d02452b19 100644 --- a/.github/workflows/gen_macos.yml +++ b/.github/workflows/gen_macos.yml @@ -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" diff --git a/.github/workflows/gen_macos_continuous.yml b/.github/workflows/gen_macos_continuous.yml index a59c53892..1d9235def 100644 --- a/.github/workflows/gen_macos_continuous.yml +++ b/.github/workflows/gen_macos_continuous.yml @@ -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" diff --git a/.github/workflows/gen_macos_tag.yml b/.github/workflows/gen_macos_tag.yml index 477e52320..6a30db7c9 100644 --- a/.github/workflows/gen_macos_tag.yml +++ b/.github/workflows/gen_macos_tag.yml @@ -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" diff --git a/.github/workflows/gen_opensuse_leap.yml b/.github/workflows/gen_opensuse_leap.yml index 9d4aedf84..63ab98a2c 100644 --- a/.github/workflows/gen_opensuse_leap.yml +++ b/.github/workflows/gen_opensuse_leap.yml @@ -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: diff --git a/.github/workflows/gen_opensuse_leap_continuous.yml b/.github/workflows/gen_opensuse_leap_continuous.yml index 5c3b540a6..e0e81cf20 100644 --- a/.github/workflows/gen_opensuse_leap_continuous.yml +++ b/.github/workflows/gen_opensuse_leap_continuous.yml @@ -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: diff --git a/.github/workflows/gen_opensuse_leap_tag.yml b/.github/workflows/gen_opensuse_leap_tag.yml index 009fa1e64..48b1d77f6 100644 --- a/.github/workflows/gen_opensuse_leap_tag.yml +++ b/.github/workflows/gen_opensuse_leap_tag.yml @@ -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: diff --git a/.github/workflows/gen_opensuse_tumbleweed.yml b/.github/workflows/gen_opensuse_tumbleweed.yml index 932118e9a..7dc0ea83f 100644 --- a/.github/workflows/gen_opensuse_tumbleweed.yml +++ b/.github/workflows/gen_opensuse_tumbleweed.yml @@ -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: diff --git a/.github/workflows/gen_opensuse_tumbleweed_continuous.yml b/.github/workflows/gen_opensuse_tumbleweed_continuous.yml index 3ebf54072..ea4f6496a 100644 --- a/.github/workflows/gen_opensuse_tumbleweed_continuous.yml +++ b/.github/workflows/gen_opensuse_tumbleweed_continuous.yml @@ -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: diff --git a/.github/workflows/gen_opensuse_tumbleweed_tag.yml b/.github/workflows/gen_opensuse_tumbleweed_tag.yml index 4655aa26f..1be99c997 100644 --- a/.github/workflows/gen_opensuse_tumbleweed_tag.yml +++ b/.github/workflows/gen_opensuse_tumbleweed_tag.yml @@ -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: diff --git a/.github/workflows/gen_ubuntu20.04.yml b/.github/workflows/gen_ubuntu20.04.yml index c311ab3f7..80b51ade1 100644 --- a/.github/workflows/gen_ubuntu20.04.yml +++ b/.github/workflows/gen_ubuntu20.04.yml @@ -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: diff --git a/.github/workflows/gen_ubuntu20.04_continuous.yml b/.github/workflows/gen_ubuntu20.04_continuous.yml index e363936a9..1f5c32146 100644 --- a/.github/workflows/gen_ubuntu20.04_continuous.yml +++ b/.github/workflows/gen_ubuntu20.04_continuous.yml @@ -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: diff --git a/.github/workflows/gen_ubuntu20.04_tag.yml b/.github/workflows/gen_ubuntu20.04_tag.yml index 1d891cef9..6482a09d9 100644 --- a/.github/workflows/gen_ubuntu20.04_tag.yml +++ b/.github/workflows/gen_ubuntu20.04_tag.yml @@ -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: diff --git a/.github/workflows/gen_ubuntu22.04.yml b/.github/workflows/gen_ubuntu22.04.yml index f98c7eb0b..11afef779 100644 --- a/.github/workflows/gen_ubuntu22.04.yml +++ b/.github/workflows/gen_ubuntu22.04.yml @@ -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: diff --git a/.github/workflows/gen_ubuntu22.04_continuous.yml b/.github/workflows/gen_ubuntu22.04_continuous.yml index 1b93b47ec..16e14ba23 100644 --- a/.github/workflows/gen_ubuntu22.04_continuous.yml +++ b/.github/workflows/gen_ubuntu22.04_continuous.yml @@ -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: diff --git a/.github/workflows/gen_ubuntu22.04_tag.yml b/.github/workflows/gen_ubuntu22.04_tag.yml index fdb94ff9c..f8bb7fec9 100644 --- a/.github/workflows/gen_ubuntu22.04_tag.yml +++ b/.github/workflows/gen_ubuntu22.04_tag.yml @@ -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: diff --git a/.github/workflows/gen_windows.yml b/.github/workflows/gen_windows.yml index 80652dc04..718392dc2 100644 --- a/.github/workflows/gen_windows.yml +++ b/.github/workflows/gen_windows.yml @@ -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: diff --git a/.github/workflows/gen_windows_continuous.yml b/.github/workflows/gen_windows_continuous.yml index 83bebc1a3..012fe6a15 100644 --- a/.github/workflows/gen_windows_continuous.yml +++ b/.github/workflows/gen_windows_continuous.yml @@ -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: diff --git a/.github/workflows/gen_windows_tag.yml b/.github/workflows/gen_windows_tag.yml index 072fcd1d2..df9dd72cc 100644 --- a/.github/workflows/gen_windows_tag.yml +++ b/.github/workflows/gen_windows_tag.yml @@ -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: diff --git a/.github/workflows/pages.yml b/.github/workflows/pages.yml index ccebc8237..7f8650688 100644 --- a/.github/workflows/pages.yml +++ b/.github/workflows/pages.yml @@ -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: diff --git a/.github/workflows/termwiz.yml b/.github/workflows/termwiz.yml index cc70f3e09..2d79d9067 100644 --- a/.github/workflows/termwiz.yml +++ b/.github/workflows/termwiz.yml @@ -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: diff --git a/.github/workflows/verify-pages.yml b/.github/workflows/verify-pages.yml index b58cb1b67..0aa9d60bc 100644 --- a/.github/workflows/verify-pages.yml +++ b/.github/workflows/verify-pages.yml @@ -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: diff --git a/.github/workflows/wezterm_ssh.yml b/.github/workflows/wezterm_ssh.yml index cc38fc035..78069c25a 100644 --- a/.github/workflows/wezterm_ssh.yml +++ b/.github/workflows/wezterm_ssh.yml @@ -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 diff --git a/ci/generate-workflows.py b/ci/generate-workflows.py index dba466dde..df9ff1a9f 100755 --- a/ci/generate-workflows.py +++ b/ci/generate-workflows.py @@ -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(