diff --git a/.gitlab-ci.yml b/.gitlab-ci.yml index 2af0e56c45069c0b4788ffe24e3b07af15539abc..c509ca88076ef2fba5b36cec8e4587e8d1563385 100644 --- a/.gitlab-ci.yml +++ b/.gitlab-ci.yml @@ -6,6 +6,7 @@ workflow: variables: RUST_VERSION: "1.79" # slim or alpine not adapted because of openSSL dependency + RUST_IMAGE: "registry.gitlab-forge.din.developpement-durable.gouv.fr/pub/numeco/gitlab-project-doctor/rust-tools" TARGET_ARCH: default CARGO_HOME: .cargo TEST_OPTIONS: --url $CI_PROJECT_URL -a @@ -55,6 +56,8 @@ include: build-rust-image: cache: [ ] + rules: + - if: $RUST_REBUILD_IMAGE release-gpd-image: needs: @@ -66,7 +69,7 @@ release-gpd-image: check-format: stage: deps_and_lint - image: ${REGISTRY_IMAGE_RUST} + image: ${RUST_IMAGE}:${RUST_VERSION} script: - cargo fetch - cargo fmt --all -- --check @@ -79,7 +82,7 @@ check-format: test-rust-current: stage: build_test - image: ${REGISTRY_IMAGE_RUST} + image: ${RUST_IMAGE}:${RUST_VERSION} script: - cargo test --verbose - cargo run -- $TEST_OPTIONS @@ -93,7 +96,7 @@ test-rust-nightly: allow_failure: true .rust-release: - image: ${REGISTRY_IMAGE_RUST} + image: ${RUST_IMAGE}:${RUST_VERSION} stage: release variables: APP_NAME: gitlab-project-doctor @@ -115,8 +118,9 @@ test-rust-nightly: - if: $CI_COMMIT_BRANCH == $CI_DEFAULT_BRANCH - if: $CI_COMMIT_TAG needs: - - build-rust-image - - test-rust-current + - job: build-rust-image + optional: true + - job: test-rust-current release-linux: extends: .rust-release @@ -169,6 +173,7 @@ test-release-docker: - gitlab-project-doctor $CLEAN_OPTIONS --token $TEST_GL_TOKEN cache: [ ] needs: + - release-linux - release-gpd-image rules: - if: $CI_COMMIT_BRANCH == $CI_DEFAULT_BRANCH