1
Fork 0
mirror of https://github.com/RGBCube/uutils-coreutils synced 2025-07-30 12:37:49 +00:00

Merge pull request #1615 from rivy/fix.cargolock-version

maint/CICD ~ add 'Cargo.lock' format testing and protection
This commit is contained in:
Sylvestre Ledru 2020-10-25 09:51:28 +01:00 committed by GitHub
commit 3a367a4179
No known key found for this signature in database
GPG key ID: 4AEE18F83AFDEB23

View file

@ -119,6 +119,12 @@ jobs:
use-tool-cache: true use-tool-cache: true
env: env:
RUSTUP_TOOLCHAIN: stable RUSTUP_TOOLCHAIN: stable
- name: Confirm compatible 'Cargo.lock'
shell: bash
run: |
# Confirm compatible 'Cargo.lock'
# * 'Cargo.lock' is required to be in a format that `cargo` of MinSRV can interpret (eg, v1-format for MinSRV < v1.38)
cargo fetch --locked --quiet || { echo "::error file=Cargo.lock::Incompatible 'Cargo.lock' format; try \`cargo +${{ env.RUST_MIN_SRV }} update\`" ; exit 1 ; }
- name: Info - name: Info
shell: bash shell: bash
run: | run: |
@ -136,9 +142,14 @@ jobs:
cargo-tree tree -V cargo-tree tree -V
## dependencies ## dependencies
echo "## dependency list" echo "## dependency list"
cargo fetch --quiet cargo fetch --locked --quiet
## * using the 'stable' toolchain is necessary to avoid "unexpected '--filter-platform'" errors ## * using the 'stable' toolchain is necessary to avoid "unexpected '--filter-platform'" errors
RUSTUP_TOOLCHAIN=stable cargo-tree tree --frozen --all --no-dev-dependencies --no-indent --features ${{ matrix.job.features }} | grep -vE "$PWD" | sort --unique RUSTUP_TOOLCHAIN=stable cargo-tree tree --frozen --all --no-dev-dependencies --no-indent --features ${{ matrix.job.features }} | grep -vE "$PWD" | sort --unique
- name: Info
shell: bash
run: |
# Info
- name: Test - name: Test
uses: actions-rs/cargo@v1 uses: actions-rs/cargo@v1
with: with:
@ -348,7 +359,7 @@ jobs:
cargo-tree tree -V cargo-tree tree -V
## dependencies ## dependencies
echo "## dependency list" echo "## dependency list"
cargo fetch --quiet cargo fetch --locked --quiet
cargo-tree tree --target=${{ matrix.job.target }} ${{ matrix.job.cargo-options }} ${{ steps.vars.outputs.CARGO_FEATURES_OPTION }} --all --no-dev-dependencies --no-indent | grep -vE "$PWD" | sort --unique cargo-tree tree --target=${{ matrix.job.target }} ${{ matrix.job.cargo-options }} ${{ steps.vars.outputs.CARGO_FEATURES_OPTION }} --all --no-dev-dependencies --no-indent | grep -vE "$PWD" | sort --unique
- name: Build - name: Build
uses: actions-rs/cargo@v1 uses: actions-rs/cargo@v1