From 15dfb5193cf93be7c7ba496678dff46f0a444d37 Mon Sep 17 00:00:00 2001 From: Steins7 Date: Fri, 5 Feb 2021 09:31:11 +0100 Subject: [PATCH 1/7] Testing Gitlab config with example CI file --- .gitlab-ci.yml | 22 ++++++++++++++++++++++ 1 file changed, 22 insertions(+) create mode 100644 .gitlab-ci.yml diff --git a/.gitlab-ci.yml b/.gitlab-ci.yml new file mode 100644 index 0000000..efa1945 --- /dev/null +++ b/.gitlab-ci.yml @@ -0,0 +1,22 @@ +build-job: + stage: build + script: + - echo "Hello, $GITLAB_USER_LOGIN!" + +test-job1: + stage: test + script: + - echo "This job tests something" + +test-job2: + stage: test + script: + - echo "This job tests something, but takes more time than test-job1." + - echo "After the echo commands complete, it runs the sleep command for 20 seconds" + - echo "which simulates a test that runs 20 seconds longer than test-job1" + - sleep 20 + +deploy-prod: + stage: deploy + script: + - echo "This job deploys something from the $CI_COMMIT_BRANCH branch." From db54e2d2ef1a42e7ab4b5f937150b22013c14b4a Mon Sep 17 00:00:00 2001 From: Steins7 Date: Fri, 5 Feb 2021 09:35:07 +0100 Subject: [PATCH 2/7] Testing CI solution for Rust --- .gitlab-ci.yml | 24 ++++-------------------- 1 file changed, 4 insertions(+), 20 deletions(-) diff --git a/.gitlab-ci.yml b/.gitlab-ci.yml index efa1945..0ac3322 100644 --- a/.gitlab-ci.yml +++ b/.gitlab-ci.yml @@ -1,22 +1,6 @@ -build-job: - stage: build - script: - - echo "Hello, $GITLAB_USER_LOGIN!" - -test-job1: +stable:cargo: + image: rustdocker/rust:stable stage: test script: - - echo "This job tests something" - -test-job2: - stage: test - script: - - echo "This job tests something, but takes more time than test-job1." - - echo "After the echo commands complete, it runs the sleep command for 20 seconds" - - echo "which simulates a test that runs 20 seconds longer than test-job1" - - sleep 20 - -deploy-prod: - stage: deploy - script: - - echo "This job deploys something from the $CI_COMMIT_BRANCH branch." + - cargo test --verbose --jobs 1 + From fa2857c2ba5a6751c1d6e1f034e94eebd1d4b219 Mon Sep 17 00:00:00 2001 From: Steins7 Date: Fri, 5 Feb 2021 14:45:18 +0100 Subject: [PATCH 3/7] Added rustup commands --- .gitlab-ci.yml | 14 ++++++++++++-- 1 file changed, 12 insertions(+), 2 deletions(-) diff --git a/.gitlab-ci.yml b/.gitlab-ci.yml index 0ac3322..83debee 100644 --- a/.gitlab-ci.yml +++ b/.gitlab-ci.yml @@ -1,5 +1,15 @@ -stable:cargo: - image: rustdocker/rust:stable +stages: + - build + - test + +stable:cargo:build: + stage: build + script: + - rustup toolchain install stable + - rustup default stable + - cargo build + +stable:cargo:test: stage: test script: - cargo test --verbose --jobs 1 From 82dc53d044f267dea89ab8dafad66524ccdce5cc Mon Sep 17 00:00:00 2001 From: Steins7 Date: Fri, 5 Feb 2021 15:16:45 +0100 Subject: [PATCH 4/7] Added nightly coverage --- .gitlab-ci.yml | 19 +++++++++++++++++-- 1 file changed, 17 insertions(+), 2 deletions(-) diff --git a/.gitlab-ci.yml b/.gitlab-ci.yml index 83debee..45db404 100644 --- a/.gitlab-ci.yml +++ b/.gitlab-ci.yml @@ -11,6 +11,21 @@ stable:cargo:build: stable:cargo:test: stage: test + dependencies: [stable:cargo:build] script: - - cargo test --verbose --jobs 1 - + - cargo test --jobs 1 + +nightly:cargo:build: + stage: build + script: + - rustup toolchain install nightly + - rustup default nightly + - cargo build + allow_failure: true + +nightly:cargo:test: + stage: test + dependencies: [nightly:cargo:build] + script: + - cargo test --jobs 1 + allow_failure: true From ae4bf9efa0c4bee9c9fed78beff5282ee571596f Mon Sep 17 00:00:00 2001 From: Steins7 Date: Fri, 5 Feb 2021 15:35:25 +0100 Subject: [PATCH 5/7] Improved job dependencies --- .gitlab-ci.yml | 12 ++++++++++-- 1 file changed, 10 insertions(+), 2 deletions(-) diff --git a/.gitlab-ci.yml b/.gitlab-ci.yml index 45db404..69b6b5d 100644 --- a/.gitlab-ci.yml +++ b/.gitlab-ci.yml @@ -11,8 +11,12 @@ stable:cargo:build: stable:cargo:test: stage: test - dependencies: [stable:cargo:build] + dependencies: + - stable:cargo:build + needs: + - stable:cargo:build script: + - rustup default stable - cargo test --jobs 1 nightly:cargo:build: @@ -25,7 +29,11 @@ nightly:cargo:build: nightly:cargo:test: stage: test - dependencies: [nightly:cargo:build] + dependencies: + - nightly:cargo:build + needs: + - nightly:cargo:build script: + - rustup default nightly - cargo test --jobs 1 allow_failure: true From becba709a9362c4027342ec7feb5fdc2ee79b305 Mon Sep 17 00:00:00 2001 From: Steins7 Date: Fri, 5 Feb 2021 15:42:21 +0100 Subject: [PATCH 6/7] Added doc generation to pipeline --- .gitlab-ci.yml | 7 +++++++ 1 file changed, 7 insertions(+) diff --git a/.gitlab-ci.yml b/.gitlab-ci.yml index 69b6b5d..ee74388 100644 --- a/.gitlab-ci.yml +++ b/.gitlab-ci.yml @@ -1,6 +1,7 @@ stages: - build - test + - doc stable:cargo:build: stage: build @@ -37,3 +38,9 @@ nightly:cargo:test: - rustup default nightly - cargo test --jobs 1 allow_failure: true + +stable:cargo:doc: + stage: doc + needs: [] + script: + - cargo doc From fee8adb5d7ba44ad6e40e69af5df7452fa2cecc0 Mon Sep 17 00:00:00 2001 From: Steins7 Date: Fri, 5 Feb 2021 15:55:24 +0100 Subject: [PATCH 7/7] Added rustc & cargo version display --- .gitlab-ci.yml | 4 ++++ 1 file changed, 4 insertions(+) diff --git a/.gitlab-ci.yml b/.gitlab-ci.yml index ee74388..49879e5 100644 --- a/.gitlab-ci.yml +++ b/.gitlab-ci.yml @@ -8,6 +8,7 @@ stable:cargo:build: script: - rustup toolchain install stable - rustup default stable + - rustc --version && cargo --version - cargo build stable:cargo:test: @@ -18,6 +19,7 @@ stable:cargo:test: - stable:cargo:build script: - rustup default stable + - rustc --version && cargo --version - cargo test --jobs 1 nightly:cargo:build: @@ -25,6 +27,7 @@ nightly:cargo:build: script: - rustup toolchain install nightly - rustup default nightly + - rustc --version && cargo --version - cargo build allow_failure: true @@ -36,6 +39,7 @@ nightly:cargo:test: - nightly:cargo:build script: - rustup default nightly + - rustc --version && cargo --version - cargo test --jobs 1 allow_failure: true