ci: install rust via rustup

Use stable version of rust
This commit is contained in:
Stéphane Cerveau 2022-03-07 09:26:23 +01:00
parent 1fe43d7da3
commit b5ec5b2d84
3 changed files with 43 additions and 7 deletions

View file

@ -11,14 +11,24 @@ stages:
variables:
FDO_UPSTREAM_REPO: "dabrain34/GstPipelineStudio"
GNOME_RUNTIME_IMAGE: "registry.gitlab.gnome.org/gnome/gnome-runtime-images/gnome:3.38"
GNOME_RUNTIME_IMAGE: "registry.gitlab.gnome.org/gnome/gnome-runtime-images/gnome:41"
# Version and tag for our current container
.fedora:
variables:
FDO_DISTRIBUTION_VERSION: "35"
# Update this to trigger a container rebuild
FDO_DISTRIBUTION_TAG: "2022-01-27.2"
FDO_DISTRIBUTION_TAG: "2022-03-07.3"
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 --color=always
# cargo update --color=always
# fi
build-fedora-container:
extends:
@ -28,10 +38,6 @@ build-fedora-container:
variables:
# clang-devel: required by rust bindgen
FDO_DISTRIBUTION_PACKAGES: >-
rust
cargo
rustfmt
clippy
gtk4-devel
clang-devel
gstreamer1-devel
@ -44,7 +50,9 @@ build-fedora-container:
python3-setuptools
util-linux
xorg-x11-server-Xvfb
wget
FDO_DISTRIBUTION_EXEC: >-
ci/install-rust.sh stable &&
pip3 install meson
rustfmt-clippy:
@ -99,7 +107,7 @@ dist-package:
- ninja -C build dist
flatpak:
image: "registry.gitlab.gnome.org/gnome/gnome-runtime-images/gnome:41"
image: $GNOME_RUNTIME_IMAGE
stage: release
only:
- flatpak

3
ci/env.sh Normal file
View file

@ -0,0 +1,3 @@
export RUSTUP_HOME='/usr/local/rustup'
export PATH=$PATH:/usr/local/cargo/bin
export CARGO_HOME='/usr/local/cargo'

25
ci/install-rust.sh Executable file
View file

@ -0,0 +1,25 @@
source ./ci/env.sh
RUSTUP_VERSION=1.23.1
RUST_VERSION=$1
RUST_ARCH="x86_64-unknown-linux-gnu"
RUSTUP_URL=https://static.rust-lang.org/rustup/archive/$RUSTUP_VERSION/$RUST_ARCH/rustup-init
wget $RUSTUP_URL
chmod +x rustup-init;
./rustup-init -y --no-modify-path --profile minimal --default-toolchain $RUST_VERSION;
rm rustup-init;
chmod -R a+w $RUSTUP_HOME $CARGO_HOME
rustup --version
cargo --version
rustc --version
rustup component add clippy-preview
rustup component add rustfmt
cargo install --force cargo-audit
cargo install --force cargo-outdated
# fetch project deps
cargo fetch