Skip to content
Snippets Groups Projects
Commit 19dd54c7 authored by Geoffrey Arthaud's avatar Geoffrey Arthaud
Browse files

Merge branch 'xx-update-deps' into 'main'

Optimize CI and update deps

See merge request !4
parents 138cea37 84fed7b5
No related branches found
No related tags found
1 merge request!4Optimize CI and update deps
......@@ -13,27 +13,35 @@ variables:
default:
cache:
key: rust-$CI_JOB_NAME
key: rust-deps
paths:
- .cargo
- target
policy: pull-push
policy: pull
stages:
- prepare
- deps_and_lint
- build_test
- release
- deploy
- deploy_test
include:
- component: ${CI_SERVER_FQDN}/share/components/oci-copier/crane@~latest
- component: $CI_SERVER_FQDN/share/components/oci-builder/podman@~latest
inputs:
as: copy-image-rust
stage: prepare
imageNameToCopy: rust
imageTagToCopy: $RUST_VERSION
copiedImageDigest: "RUST"
as: build-rust-image
stage: .pre
targetImageAppName: rust-tools
targetImageAppTag: $RUST_VERSION
targetImageRegistryDigestName: "RUST"
DockerfileContent: |-
FROM rust:$RUST_VERSION
RUN rustup component add rustfmt
RUN rustup component add clippy
RUN rustup target add x86_64-unknown-linux-musl
RUN rustup target add x86_64-pc-windows-gnu
RUN rustup target add aarch64-apple-darwin
RUN rustup target add x86_64-apple-darwin
- component: $CI_SERVER_FQDN/share/components/oci-builder/podman@~latest
inputs:
as: release-gpd-image
......@@ -45,7 +53,7 @@ include:
forceBuild: true
Dockerfile: ${CI_PROJECT_DIR}/Dockerfile
copy-image-rust:
build-rust-image:
cache: [ ]
release-gpd-image:
......@@ -57,35 +65,35 @@ release-gpd-image:
- if: $CI_COMMIT_TAG
check-format:
stage: build_test
stage: deps_and_lint
image: ${REGISTRY_IMAGE_RUST}
script:
- rustup component add rustfmt
- rustup component add clippy
- cargo fetch
- cargo fmt --all -- --check
- cargo clippy -- -D warnings
cache:
key: rust-deps
paths:
- .cargo
policy: pull-push
test-rust-current:
stage: build_test
image: rust:$RUST_VERSION
image: ${REGISTRY_IMAGE_RUST}
script:
- cargo test --verbose
- cargo run -- $TEST_OPTIONS
- cargo run -- $TEST_OPTIONS --token $TEST_GL_TOKEN
allow_failure: true
- cargo run -- $CLEAN_OPTIONS
- cargo run -- $CLEAN_OPTIONS --token $TEST_GL_TOKEN
test-rust-nightly:
extends: test-rust-current
image: rustlang/rust:nightly
allow_failure: true
test-clean-rust-current:
extends: test-rust-current
allow_failure: true
variables:
TEST_OPTIONS: $CLEAN_OPTIONS
.rust-release:
image: ${REGISTRY_IMAGE_RUST}
stage: release
variables:
APP_NAME: gitlab-project-doctor
......@@ -107,12 +115,11 @@ test-clean-rust-current:
- if: $CI_COMMIT_BRANCH == $CI_DEFAULT_BRANCH
- if: $CI_COMMIT_TAG
needs:
- copy-image-rust
- build-rust-image
- test-rust-current
release-linux:
extends: .rust-release
image: ${REGISTRY_IMAGE_RUST}
variables:
TARGET_ARCH: x86_64-unknown-linux-musl
LDD_CMD: ldd
......@@ -144,7 +151,6 @@ release-macos-x86:
release-windows:
extends: .rust-release
image: ${REGISTRY_IMAGE_RUST}
variables:
TARGET_ARCH: x86_64-pc-windows-gnu
APP_NAME: gitlab-project-doctor.exe
......@@ -155,9 +161,12 @@ release-windows:
test-release-docker:
stage: deploy_test
image: $CI_REGISTRY/pub/numeco/gitlab-project-doctor:$CI_COMMIT_SHA
image: $CI_REGISTRY/pub/numeco/gitlab-project-doctor:$VERSION
script:
- gitlab-project-doctor --url $CI_PROJECT_URL -a
- gitlab-project-doctor $TEST_OPTIONS
- gitlab-project-doctor $TEST_OPTIONS --token $TEST_GL_TOKEN
- gitlab-project-doctor $CLEAN_OPTIONS
- gitlab-project-doctor $CLEAN_OPTIONS --token $TEST_GL_TOKEN
cache: [ ]
needs:
- release-gpd-image
......@@ -173,7 +182,10 @@ test-release-linux:
script:
- 'curl -O --header "JOB-TOKEN: $CI_JOB_TOKEN" "${CI_API_V4_URL}/projects/${CI_PROJECT_ID}/packages/generic/x86_64-unknown-linux-musl/latest/gitlab-project-doctor"'
- chmod +x gitlab-project-doctor
- ./gitlab-project-doctor --url $CI_PROJECT_URL -a
- ./gitlab-project-doctor $TEST_OPTIONS
- ./gitlab-project-doctor $TEST_OPTIONS --token $TEST_GL_TOKEN
- ./gitlab-project-doctor $CLEAN_OPTIONS
- ./gitlab-project-doctor $CLEAN_OPTIONS --token $TEST_GL_TOKEN
rules:
- if: $CI_COMMIT_BRANCH == $CI_DEFAULT_BRANCH
- if: $CI_COMMIT_TAG
This diff is collapsed.
[package]
name = "gitlab-project-doctor"
version = "0.4.1-dev"
version = "0.5.0-dev"
edition = "2018"
# See more keys and their definitions at https://doc.rust-lang.org/cargo/reference/manifest.html
......@@ -13,10 +13,10 @@ chrono = "0.4.34"
console = "0.15.2"
derive_builder = "0.20.0"
dialoguer = "0.11.0"
git2 = { version = "0.18.1", features = ["vendored-libgit2"] }
gitlab = "0.1609.2"
git2 = { version = "0.19.0", features = ["vendored-libgit2"] }
gitlab = "0.1701.0"
# Erreurs au passage de la version 0.13.0
graphql_client = "~0.11.0"
graphql_client = "~0.14.0"
human_bytes = "0.4.3"
i18n-embed = { version = "0.14.1", features = ["fluent-system", "desktop-requester"] }
i18n-embed-fl = "0.8.0"
......
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment