fixup! wip2
Cargo manifest lints / Lint Cargo manifests on ${{ matrix.build }} (linux-amd64, ubuntu-latest, stable, x86_64-unknown-linux-gnu) (pull_request) Failing after 17s Details
Run Tests / Test on ${{ matrix.build }} (linux-amd64, ubuntu-latest, x86_64-unknown-linux-gnu) (pull_request) Failing after 20s Details
Run cargo lints / Lint on ${{ matrix.build }} (linux-amd64, ubuntu-latest, stable, x86_64-unknown-linux-gnu) (pull_request) Has been cancelled Details

Manos Pitsidianakis 2024-05-08 20:57:40 +03:00
parent 034e4ac403
commit 7e06800387
Signed by: Manos Pitsidianakis
GPG Key ID: 7729C7707F7E09D0
5 changed files with 9 additions and 20 deletions

View File

@ -43,7 +43,6 @@ jobs:
run: |
if ! command -v rustup &>/dev/null; then
curl --proto '=https' --tlsv1.2 --retry 10 --retry-connrefused --location --silent --show-error --fail "https://sh.rustup.rs" | sh -s -- --default-toolchain none -y
source "${HOME}/.cargo/env"
echo "${CARGO_HOME:-$HOME/.cargo}/bin" >> $GITHUB_PATH
echo "CARGO_HOME=${CARGO_HOME:-$HOME/.cargo}" >> $GITHUB_ENV
rustup toolchain install --profile minimal ${{ matrix.rust }} --target ${{ matrix.target }}

View File

@ -49,7 +49,6 @@ jobs:
run: |
if ! command -v rustup &>/dev/null; then
curl --proto '=https' --tlsv1.2 --retry 10 --retry-connrefused --location --silent --show-error --fail "https://sh.rustup.rs" | sh -s -- --default-toolchain none -y
source "${HOME}/.cargo/env"
echo "${CARGO_HOME:-$HOME/.cargo}/bin" >> $GITHUB_PATH
rustup toolchain install --profile minimal ${{ matrix.rust }} --target ${{ matrix.target }}
fi

View File

@ -54,7 +54,6 @@ jobs:
run: |
if ! command -v rustup &>/dev/null; then
curl --proto '=https' --tlsv1.2 --retry 10 --retry-connrefused --location --silent --show-error --fail "https://sh.rustup.rs" | sh -s -- --default-toolchain none -y
source "${HOME}/.cargo/env"
echo "${CARGO_HOME:-$HOME/.cargo}/bin" >> $GITHUB_PATH
rustup toolchain install --profile minimal --component clippy,rustfmt --target ${{ matrix.target }} -- "${{ matrix.rust }}"
rustup default ${{ matrix.rust }}

View File

@ -50,7 +50,6 @@ jobs:
run: |
if ! command -v rustup &>/dev/null; then
curl --proto '=https' --tlsv1.2 --retry 10 --retry-connrefused --location --silent --show-error --fail "https://sh.rustup.rs" | sh -s -- --default-toolchain none -y
source "${HOME}/.cargo/env"
echo "${CARGO_HOME:-$HOME/.cargo}/bin" >> $GITHUB_PATH
echo "CARGO_HOME=${CARGO_HOME:-$HOME/.cargo}" >> $GITHUB_ENV
rustup toolchain install --profile minimal --component "rustfmt" --target "${{ matrix.target }}" -- "${{ env.MELI_MSRV }}"
@ -69,19 +68,16 @@ jobs:
- if: ${{ steps.cache-cargo.outputs.cache-hit != 'true' }} && matrix.target
name: Add manifest lint dependencies
run: |
source "${HOME}/.cargo/env"
cargo install --quiet --version 1.0.9 --target "${{ matrix.target }}" cargo-sort
cargo install --quiet --version 0.15.1 --target "${{ matrix.target }}" cargo-msrv
- name: cargo-msrv verify melib MSRV
if: success() || failure()
run: |
source "${HOME}/.cargo/env"
cargo-msrv --output-format json --log-level trace --log-target stdout --path meli verify
cargo-msrv --output-format json --log-level trace --log-target stdout --path melib verify
- name: cargo-sort
if: success() || failure()
run: |
source "${HOME}/.cargo/env"
cargo-sort --check --check-format --grouped --order package,bin,lib,dependencies,features,build-dependencies,dev-dependencies,workspace fuzz
cargo-sort --check --check-format --grouped --order package,bin,lib,dependencies,features,build-dependencies,dev-dependencies,workspace tools
cargo-sort --check --check-format --grouped --order package,bin,lib,dependencies,features,build-dependencies,dev-dependencies,workspace --workspace

View File

@ -32,7 +32,6 @@ jobs:
include:
- build: linux-amd64
os: ubuntu-latest
rust: stable
target: x86_64-unknown-linux-gnu
steps:
- uses: actions/checkout@v3
@ -41,12 +40,16 @@ jobs:
run: |
apt-get update
apt-get install -y libdbus-1-dev pkg-config mandoc libssl-dev make
- name: Find meli MSRV from meli/Cargo.toml.
run: echo MELI_MSRV=$(grep -m1 rust-version meli/Cargo.toml | head -n1 | cut -d'"' -f 2 | head -n1) >> $GITHUB_ENV
- name: Configure cargo data directory
run: echo "CARGO_HOME=$(pwd)/.cargo" >> $GITHUB_ENV
- id: cache-rustup
name: Cache Rust toolchain
uses: https://github.com/Swatinem/rust-cache@v2
uses: https://code.forgejo.org/actions/cache@v4
with:
path: ~/.rustup
key: toolchain-${{ matrix.os }}-${{ matrix.rust }}
key: toolchain-${{ matrix.os }}-${{ env.MELI_MSRV }}
- if: ${{ steps.cache-rustup.outputs.cache-hit != 'true' }}
id: rustup-setup
name: Install rustup and toolchains
@ -54,23 +57,16 @@ jobs:
run: |
if ! command -v rustup &>/dev/null; then
curl --proto '=https' --tlsv1.2 --retry 10 --retry-connrefused --location --silent --show-error --fail "https://sh.rustup.rs" | sh -s -- --default-toolchain none -y
source "${HOME}/.cargo/env"
echo "${CARGO_HOME:-$HOME/.cargo}/bin" >> $GITHUB_PATH
rustup toolchain install --profile minimal ${{ matrix.rust }} --target ${{ matrix.target }}
rustup toolchain install --profile minimal --target "${{ matrix.target }}" -- "${{ env.MELI_MSRV }}"
rustup default ${{ env.MELI_MSRV }}
fi
- name: Configure cargo data directory
# After this point, all cargo registry and crate data is stored in
# $GITHUB_WORKSPACE/.cargo_home. This allows us to cache only the files
# that are needed during the build process. Additionally, this works
# around a bug in the 'cache' action that causes directories outside of
# the workspace dir to be saved/restored incorrectly.
run: echo "CARGO_HOME=$(pwd)/.cargo_home" >> $GITHUB_ENV
- id: cache-cargo
name: Cache cargo configuration and installations
uses: https://github.com/Swatinem/rust-cache@v2
with:
path: ${{ env.CARGO_HOME }}
key: cargo-${{ matrix.os }}-${{ matrix.rust }}
key: cargo-${{ matrix.os }}-${{ env.MELI_MSRV }}
- if: ${{ steps.cache-cargo.outputs.cache-hit != 'true' }} && matrix.target
name: Setup Rust target
run: |