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

Optimize CI and update deps

parent 138cea37
No related branches found
No related tags found
No related merge requests found
...@@ -13,11 +13,10 @@ variables: ...@@ -13,11 +13,10 @@ variables:
default: default:
cache: cache:
key: rust-$CI_JOB_NAME key: rust-deps
paths: paths:
- .cargo - .cargo
- target policy: pull
policy: pull-push
stages: stages:
- prepare - prepare
...@@ -27,13 +26,22 @@ stages: ...@@ -27,13 +26,22 @@ stages:
- deploy_test - deploy_test
include: include:
- component: ${CI_SERVER_FQDN}/share/components/oci-copier/crane@~latest - component: $CI_SERVER_FQDN/share/components/oci-builder/podman@~latest
inputs: inputs:
as: copy-image-rust as: build-rust-image
stage: prepare stage: prepare
imageNameToCopy: rust targetImageAppName: rust-tools
imageTagToCopy: $RUST_VERSION targetImageAppTag: $RUST_VERSION
copiedImageDigest: "RUST" 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 - component: $CI_SERVER_FQDN/share/components/oci-builder/podman@~latest
inputs: inputs:
as: release-gpd-image as: release-gpd-image
...@@ -45,7 +53,7 @@ include: ...@@ -45,7 +53,7 @@ include:
forceBuild: true forceBuild: true
Dockerfile: ${CI_PROJECT_DIR}/Dockerfile Dockerfile: ${CI_PROJECT_DIR}/Dockerfile
copy-image-rust: build-rust-image:
cache: [ ] cache: [ ]
release-gpd-image: release-gpd-image:
...@@ -60,32 +68,29 @@ check-format: ...@@ -60,32 +68,29 @@ check-format:
stage: build_test stage: build_test
image: ${REGISTRY_IMAGE_RUST} image: ${REGISTRY_IMAGE_RUST}
script: script:
- rustup component add rustfmt - cargo fetch
- rustup component add clippy
- cargo fmt --all -- --check - cargo fmt --all -- --check
- cargo clippy -- -D warnings - cargo clippy -- -D warnings
cache:
policy: pull-push
test-rust-current: test-rust-current:
stage: build_test stage: build_test
image: rust:$RUST_VERSION image: ${REGISTRY_IMAGE_RUST}
script: script:
- cargo test --verbose - cargo test --verbose
- cargo run -- $TEST_OPTIONS - cargo run -- $TEST_OPTIONS
- cargo run -- $TEST_OPTIONS --token $TEST_GL_TOKEN - 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: test-rust-nightly:
extends: test-rust-current extends: test-rust-current
image: rustlang/rust:nightly image: rustlang/rust:nightly
allow_failure: true allow_failure: true
test-clean-rust-current:
extends: test-rust-current
allow_failure: true
variables:
TEST_OPTIONS: $CLEAN_OPTIONS
.rust-release: .rust-release:
image: ${REGISTRY_IMAGE_RUST}
stage: release stage: release
variables: variables:
APP_NAME: gitlab-project-doctor APP_NAME: gitlab-project-doctor
...@@ -107,12 +112,11 @@ test-clean-rust-current: ...@@ -107,12 +112,11 @@ test-clean-rust-current:
- if: $CI_COMMIT_BRANCH == $CI_DEFAULT_BRANCH - if: $CI_COMMIT_BRANCH == $CI_DEFAULT_BRANCH
- if: $CI_COMMIT_TAG - if: $CI_COMMIT_TAG
needs: needs:
- copy-image-rust - build-rust-image
- test-rust-current - test-rust-current
release-linux: release-linux:
extends: .rust-release extends: .rust-release
image: ${REGISTRY_IMAGE_RUST}
variables: variables:
TARGET_ARCH: x86_64-unknown-linux-musl TARGET_ARCH: x86_64-unknown-linux-musl
LDD_CMD: ldd LDD_CMD: ldd
...@@ -144,7 +148,6 @@ release-macos-x86: ...@@ -144,7 +148,6 @@ release-macos-x86:
release-windows: release-windows:
extends: .rust-release extends: .rust-release
image: ${REGISTRY_IMAGE_RUST}
variables: variables:
TARGET_ARCH: x86_64-pc-windows-gnu TARGET_ARCH: x86_64-pc-windows-gnu
APP_NAME: gitlab-project-doctor.exe APP_NAME: gitlab-project-doctor.exe
...@@ -155,9 +158,12 @@ release-windows: ...@@ -155,9 +158,12 @@ release-windows:
test-release-docker: test-release-docker:
stage: deploy_test stage: deploy_test
image: $CI_REGISTRY/pub/numeco/gitlab-project-doctor:$CI_COMMIT_SHA image: $CI_REGISTRY/pub/numeco/gitlab-project-doctor:$VERSION
script: 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: [ ] cache: [ ]
needs: needs:
- release-gpd-image - release-gpd-image
...@@ -173,7 +179,10 @@ test-release-linux: ...@@ -173,7 +179,10 @@ test-release-linux:
script: 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"' - '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 - 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: rules:
- if: $CI_COMMIT_BRANCH == $CI_DEFAULT_BRANCH - if: $CI_COMMIT_BRANCH == $CI_DEFAULT_BRANCH
- if: $CI_COMMIT_TAG - if: $CI_COMMIT_TAG
This diff is collapsed.
[package] [package]
name = "gitlab-project-doctor" name = "gitlab-project-doctor"
version = "0.4.1-dev" version = "0.5.0-dev"
edition = "2018" edition = "2018"
# See more keys and their definitions at https://doc.rust-lang.org/cargo/reference/manifest.html # See more keys and their definitions at https://doc.rust-lang.org/cargo/reference/manifest.html
...@@ -13,10 +13,10 @@ chrono = "0.4.34" ...@@ -13,10 +13,10 @@ chrono = "0.4.34"
console = "0.15.2" console = "0.15.2"
derive_builder = "0.20.0" derive_builder = "0.20.0"
dialoguer = "0.11.0" dialoguer = "0.11.0"
git2 = { version = "0.18.1", features = ["vendored-libgit2"] } git2 = { version = "0.19.0", features = ["vendored-libgit2"] }
gitlab = "0.1609.2" gitlab = "0.1701.0"
# Erreurs au passage de la version 0.13.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" human_bytes = "0.4.3"
i18n-embed = { version = "0.14.1", features = ["fluent-system", "desktop-requester"] } i18n-embed = { version = "0.14.1", features = ["fluent-system", "desktop-requester"] }
i18n-embed-fl = "0.8.0" i18n-embed-fl = "0.8.0"
......
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Please register or to comment