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
This commit is contained in:
Jordan Petridis 2020-08-21 05:29:35 +03:00
parent c716957a0d
commit 0f89576235
No known key found for this signature in database
GPG key ID: E8523968931763BE

View file

@ -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