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-26 13:52:54 +03:00
parent 757ee2c703
commit cc525cdf70
No known key found for this signature in database
GPG key ID: 902CC06D159744F5

View file

@ -16,6 +16,12 @@ stages:
before_script: before_script:
- source ./ci/env.sh - source ./ci/env.sh
- mkdir .cargo && echo -e "[net]\ngit-fetch-with-cli = true" > .cargo/config - 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
cache: cache:
key: "gst" key: "gst"
paths: paths:
@ -41,14 +47,14 @@ stages:
script: script:
- rustc --version - rustc --version
- cargo --version - cargo --version
- cargo build --all --color=always - cargo build --locked --all --color=always
# FIXME: tests are broken # FIXME: tests are broken
# https://github.com/sdroege/gstreamer-sys/issues/16 # https://github.com/sdroege/gstreamer-sys/issues/16
# - cargo test --all --color=always # - cargo test --locked --all --color=always
- cargo build --all --all-features --color=always - cargo build --locked --all --all-features --color=always
# FIXME: tests are broken # FIXME: tests are broken
# https://github.com/sdroege/gstreamer-sys/issues/16 # https://github.com/sdroege/gstreamer-sys/issues/16
# - cargo test --all --all-features --color=always # - cargo test --locked --all --all-features --color=always
# Run tests for crates we can currently run. The others # Run tests for crates we can currently run. The others
# need a new release of the C library first # need a new release of the C library first
@ -69,7 +75,7 @@ stages:
gstreamer-video-sys \ gstreamer-video-sys \
gstreamer-webrtc-sys; \ gstreamer-webrtc-sys; \
do \ do \
cargo test -p $crate; \ cargo test --locked -p $crate; \
done done
test stable: test stable: