|
|
|
@ -41,48 +41,47 @@ jobs:
|
|
|
|
|
run: |
|
|
|
|
|
apt-get update
|
|
|
|
|
apt-get install -y libdbus-1-dev pkg-config mandoc libssl-dev make
|
|
|
|
|
#- id: cache-rustup
|
|
|
|
|
# name: Cache Rust toolchain
|
|
|
|
|
# uses: https://github.com/actions/cache@v3
|
|
|
|
|
# with:
|
|
|
|
|
# path: ~/.rustup
|
|
|
|
|
# key: toolchain-${{ matrix.os }}-${{ matrix.rust }}
|
|
|
|
|
#- if: ${{ steps.cache-rustup.outputs.cache-hit != 'true' }}
|
|
|
|
|
- id: rustup-setup
|
|
|
|
|
- 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=${HOME}/.cargo" >> $GITHUB_ENV
|
|
|
|
|
echo "${HOME}/.cargo/bin" >> $GITHUB_PATH
|
|
|
|
|
- id: cache-rustup
|
|
|
|
|
name: Cache Rust toolchain
|
|
|
|
|
uses: https://code.forgejo.org/actions/cache@v4
|
|
|
|
|
with:
|
|
|
|
|
path: ~/.rustup
|
|
|
|
|
key: toolchain-${{ matrix.os }}-${{ env.MELI_MSRV }}
|
|
|
|
|
- if: ${{ steps.cache-rustup.outputs.cache-hit != 'true' }}
|
|
|
|
|
id: rustup-setup
|
|
|
|
|
name: Install rustup and toolchains
|
|
|
|
|
shell: bash
|
|
|
|
|
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 toolchain install --profile minimal --target "${{ matrix.target }}" -- "${{ matrix.rust }}"
|
|
|
|
|
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/actions/cache@v3
|
|
|
|
|
# with:
|
|
|
|
|
# path: ${{ env.CARGO_HOME }}
|
|
|
|
|
# key: cargo-${{ matrix.os }}-${{ matrix.rust }}
|
|
|
|
|
#- if: ${{ steps.cache-cargo.outputs.cache-hit != 'true' }} && matrix.target
|
|
|
|
|
- name: Setup Rust target
|
|
|
|
|
- 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 }}-${{ env.MELI_MSRV }}
|
|
|
|
|
- if: ${{ steps.cache-cargo.outputs.cache-hit != 'true' }} && matrix.target
|
|
|
|
|
name: Add test dependencies
|
|
|
|
|
run: |
|
|
|
|
|
cargo +${{ matrix.rust }} install --quiet --version 0.9.54 --target "${{ matrix.target }}" cargo-nextest
|
|
|
|
|
- if: ${{ steps.cache-cargo.outputs.cache-hit != 'true' }} && matrix.target
|
|
|
|
|
name: Setup Rust target
|
|
|
|
|
run: |
|
|
|
|
|
mkdir -p "${{ env.CARGO_HOME }}"
|
|
|
|
|
cat << EOF > "${{ env.CARGO_HOME }}"/config.toml
|
|
|
|
|
[build]
|
|
|
|
|
target = "${{ matrix.target }}"
|
|
|
|
|
EOF
|
|
|
|
|
- if: ${{ steps.cache-cargo.outputs.cache-hit != 'true' }} && matrix.target
|
|
|
|
|
name: Add test dependencies
|
|
|
|
|
run: |
|
|
|
|
|
cargo install --quiet --version 0.9.54 --target "${{ matrix.target }}" cargo-nextest
|
|
|
|
|
- name: cargo-check
|
|
|
|
|
run: |
|
|
|
|
|
cargo check --all-features --all --tests --examples --benches --bins
|
|
|
|
|