From 0f895762352a80dd938a8ec46d5104765da815f8 Mon Sep 17 00:00:00 2001 From: Jordan Petridis Date: Fri, 21 Aug 2020 05:29:35 +0300 Subject: [PATCH] ci: ensure the registry cache and lockfile are up-to-date We are caching the CARGO_HOME which includes git repos of the gtk-rs bindings. Since we don't specify a branch so it uses the default branch for the ref. cargo build usually does an update if it has network access, but its not guaranteed or the case for other tools like clippy which may still point to the stale git snapshot like here: https://gitlab.freedesktop.org/thaytan/gstreamer-rs/-/jobs/4165449 --- .gitlab-ci.yml | 18 +++++++++++++----- 1 file changed, 13 insertions(+), 5 deletions(-) diff --git a/.gitlab-ci.yml b/.gitlab-ci.yml index e7c5948f..511a7764 100644 --- a/.gitlab-ci.yml +++ b/.gitlab-ci.yml @@ -27,6 +27,13 @@ stages: before_script: - source ./ci/env.sh - mkdir .cargo && echo -e "[net]\ngit-fetch-with-cli = true" > .cargo/config + # If cargo exists assume we probably will want to update + # the lockfile + - | + if command -v cargo; then + cargo generate-lockfile + cargo update + fi .debian:10-stable: extends: .debian:10 @@ -121,10 +128,11 @@ update-nightly: stage: "test" script: - rustc --version - - cargo build --color=always --all - - G_DEBUG=fatal_warnings cargo test --color=always --all - - cargo build --color=always --all --examples --all-features - - G_DEBUG=fatal_warnings cargo test --color=always --all --examples --all-features + + - cargo build --locked --color=always --all + - G_DEBUG=fatal_warnings cargo test --locked --color=always --all + - cargo build --locked --color=always --all --examples --all-features + - G_DEBUG=fatal_warnings cargo test --locked --color=always --all --examples --all-features test 1.40: extends: @@ -171,7 +179,7 @@ clippy: rules: - when: 'always' script: - - cargo clippy --color=always --all --all-features --all-targets -- -A clippy::redundant_pattern_matching -A clippy::single_match -A clippy::cast_lossless -D warnings + - cargo clippy --locked --color=always --all --all-features --all-targets -- -A clippy::redundant_pattern_matching -A clippy::single_match -A clippy::cast_lossless -D warnings deny: extends: .img-stable