ci: Install pre-built binaries instead of using cargo install

This commit is contained in:
Joining7943 2023-04-22 16:25:37 +02:00 committed by Sylvestre Ledru
parent 49c16a2f11
commit e6f999a32f
2 changed files with 11 additions and 14 deletions

View file

@ -52,6 +52,9 @@ jobs:
run: | run: |
rustup toolchain install nightly --no-self-update --profile minimal rustup toolchain install nightly --no-self-update --profile minimal
rustup default nightly rustup default nightly
## note: requires 'nightly' toolchain b/c `cargo-udeps` uses the `rustc` '-Z save-analysis' option
## * ... ref: <https://github.com/est31/cargo-udeps/issues/73>
- uses: taiki-e/install-action@cargo-udeps
- uses: Swatinem/rust-cache@v2 - uses: Swatinem/rust-cache@v2
- name: Initialize workflow variables - name: Initialize workflow variables
id: vars id: vars
@ -70,12 +73,6 @@ jobs:
CARGO_FEATURES_OPTION='' ; CARGO_FEATURES_OPTION='' ;
if [ -n "${{ matrix.job.features }}" ]; then CARGO_FEATURES_OPTION='--features "${{ matrix.job.features }}"' ; fi if [ -n "${{ matrix.job.features }}" ]; then CARGO_FEATURES_OPTION='--features "${{ matrix.job.features }}"' ; fi
outputs CARGO_FEATURES_OPTION outputs CARGO_FEATURES_OPTION
## note: requires 'nightly' toolchain b/c `cargo-udeps` uses the `rustc` '-Z save-analysis' option
## * ... ref: <https://github.com/est31/cargo-udeps/issues/73>
- name: Install `cargo-udeps`
run: cargo install cargo-udeps
env:
RUSTUP_TOOLCHAIN: stable
- name: Detect unused dependencies - name: Detect unused dependencies
shell: bash shell: bash
run: | run: |
@ -356,8 +353,8 @@ jobs:
## Install `rust` toolchain (v${{ env.RUST_MIN_SRV }}) ## Install `rust` toolchain (v${{ env.RUST_MIN_SRV }})
rustup toolchain install --no-self-update ${{ env.RUST_MIN_SRV }} --profile minimal rustup toolchain install --no-self-update ${{ env.RUST_MIN_SRV }} --profile minimal
rustup default ${{ env.RUST_MIN_SRV }} rustup default ${{ env.RUST_MIN_SRV }}
- uses: Swatinem/rust-cache@v2
- uses: taiki-e/install-action@nextest - uses: taiki-e/install-action@nextest
- uses: Swatinem/rust-cache@v2
- name: Run sccache-cache - name: Run sccache-cache
uses: mozilla-actions/sccache-action@v0.0.3 uses: mozilla-actions/sccache-action@v0.0.3
- name: Initialize workflow variables - name: Initialize workflow variables
@ -765,7 +762,6 @@ jobs:
outputs CARGO_CMD outputs CARGO_CMD
# ** pass needed environment into `cross` container (iff `cross` not already configured via "Cross.toml") # ** pass needed environment into `cross` container (iff `cross` not already configured via "Cross.toml")
if [ "${CARGO_CMD}" = 'cross' ] && [ ! -e "Cross.toml" ] ; then if [ "${CARGO_CMD}" = 'cross' ] && [ ! -e "Cross.toml" ] ; then
cargo install --version 0.2.1 cross
printf "[build.env]\npassthrough = [\"CI\", \"RUST_BACKTRACE\"]\n" > Cross.toml printf "[build.env]\npassthrough = [\"CI\", \"RUST_BACKTRACE\"]\n" > Cross.toml
fi fi
# * test only library and/or binaries for arm-type targets # * test only library and/or binaries for arm-type targets
@ -779,6 +775,10 @@ jobs:
*-pc-windows-msvc) STRIP="" ;; *-pc-windows-msvc) STRIP="" ;;
esac; esac;
outputs STRIP outputs STRIP
- uses: taiki-e/install-action@v2
if: steps.vars.outputs.CARGO_CMD == 'cross'
with:
tool: cross@v0.2.1
- name: Create all needed build/work directories - name: Create all needed build/work directories
shell: bash shell: bash
run: | run: |
@ -1106,6 +1106,7 @@ jobs:
rustup toolchain install ${{ matrix.job.toolchain }} --no-self-update --profile minimal rustup toolchain install ${{ matrix.job.toolchain }} --no-self-update --profile minimal
rustup default ${{ matrix.job.toolchain }} rustup default ${{ matrix.job.toolchain }}
- uses: taiki-e/install-action@nextest - uses: taiki-e/install-action@nextest
- uses: taiki-e/install-action@grcov
- uses: Swatinem/rust-cache@v2 - uses: Swatinem/rust-cache@v2
- name: Run sccache-cache - name: Run sccache-cache
uses: mozilla-actions/sccache-action@v0.0.3 uses: mozilla-actions/sccache-action@v0.0.3
@ -1194,9 +1195,6 @@ jobs:
RUSTDOCFLAGS: "-Cpanic=abort" RUSTDOCFLAGS: "-Cpanic=abort"
RUST_BACKTRACE: "1" RUST_BACKTRACE: "1"
# RUSTUP_TOOLCHAIN: ${{ steps.vars.outputs.TOOLCHAIN }} # RUSTUP_TOOLCHAIN: ${{ steps.vars.outputs.TOOLCHAIN }}
- name: "`grcov` ~ install"
id: build_grcov
run: cargo install grcov
- name: Generate coverage data (via `grcov`) - name: Generate coverage data (via `grcov`)
id: coverage id: coverage
shell: bash shell: bash

View file

@ -2,7 +2,7 @@ name: GnuTests
# spell-checker:ignore (abbrev/names) CodeCov gnulib GnuTests Swatinem # spell-checker:ignore (abbrev/names) CodeCov gnulib GnuTests Swatinem
# spell-checker:ignore (jargon) submodules # spell-checker:ignore (jargon) submodules
# spell-checker:ignore (libs/utils) autopoint chksum gperf lcov libexpect pyinotify shopt texinfo valgrind libattr libcap # spell-checker:ignore (libs/utils) autopoint chksum gperf lcov libexpect pyinotify shopt texinfo valgrind libattr libcap taiki-e
# spell-checker:ignore (options) Ccodegen Coverflow Cpanic Zpanic # spell-checker:ignore (options) Ccodegen Coverflow Cpanic Zpanic
# spell-checker:ignore (people) Dawid Dziurla * dawidd # spell-checker:ignore (people) Dawid Dziurla * dawidd
# spell-checker:ignore (vars) FILESET SUBDIRS XPASS # spell-checker:ignore (vars) FILESET SUBDIRS XPASS
@ -323,6 +323,7 @@ jobs:
rm -f "${HOME}/.cargo/bin/"{rustfmt,cargo-fmt} rm -f "${HOME}/.cargo/bin/"{rustfmt,cargo-fmt}
rustup toolchain install nightly -c rustfmt --profile minimal rustup toolchain install nightly -c rustfmt --profile minimal
rustup default nightly rustup default nightly
- uses: taiki-e/install-action@grcov
- uses: Swatinem/rust-cache@v2 - uses: Swatinem/rust-cache@v2
- name: Install dependencies - name: Install dependencies
run: | run: |
@ -353,8 +354,6 @@ jobs:
UU_MAKE_PROFILE=debug bash util/build-gnu.sh UU_MAKE_PROFILE=debug bash util/build-gnu.sh
- name: Run GNU tests - name: Run GNU tests
run: bash uutils/util/run-gnu-test.sh run: bash uutils/util/run-gnu-test.sh
- name: "`grcov` ~ install"
run: cargo install grcov
- name: Generate coverage data (via `grcov`) - name: Generate coverage data (via `grcov`)
id: coverage id: coverage
run: | run: |