From 9ace098fed419ce9995dbe67992ae7808645ce36 Mon Sep 17 00:00:00 2001 From: Denis P Date: Wed, 8 Jan 2020 16:41:23 +0100 Subject: [PATCH 1/8] save built artifact, it will be available in gitlab job --- .gitlab-ci.yml | 5 ++++- 1 file changed, 4 insertions(+), 1 deletion(-) diff --git a/.gitlab-ci.yml b/.gitlab-ci.yml index 29e6833f..3269e075 100644 --- a/.gitlab-ci.yml +++ b/.gitlab-ci.yml @@ -57,6 +57,7 @@ variables: #### stage: check +# be aware that the used image has cargo-remote installed fmt: stage: check @@ -77,8 +78,10 @@ test: build: stage: build <<: *docker-env + <<: *collect-artifacts only: - schedules - master script: - - cargo build --verbose --all-features --release \ No newline at end of file + - cargo build --verbose --all-features --release + - cp ${CARGO_TARGET_DIR}/release/cargo-contract ./artifacts/cargo-contract/. \ No newline at end of file -- GitLab From 28dba74a0ed6004665d7b2faf2c1171d0637542d Mon Sep 17 00:00:00 2001 From: Denis P Date: Fri, 10 Jan 2020 20:17:34 +0100 Subject: [PATCH 2/8] change the CI docker image --- .gitlab-ci.yml | 3 +-- 1 file changed, 1 insertion(+), 2 deletions(-) diff --git a/.gitlab-ci.yml b/.gitlab-ci.yml index 417f9404..100dbe52 100644 --- a/.gitlab-ci.yml +++ b/.gitlab-ci.yml @@ -27,7 +27,7 @@ variables: - artifacts/ .docker-env: &docker-env - image: parity/rust-builder:latest + image: ${REGISTRY}/contracts-ci-linux:latest before_script: - cargo -vV - rustc -vV @@ -62,7 +62,6 @@ fmt: stage: check <<: *docker-env script: - - rustup component add rustfmt - cargo fmt --verbose --all -- --check #### stage: test -- GitLab From b4674b4d24170593ce6903f60498e36f9e9e3467 Mon Sep 17 00:00:00 2001 From: Denis P Date: Fri, 10 Jan 2020 20:59:28 +0100 Subject: [PATCH 3/8] if gitlab can rebase --- .gitlab-ci.yml | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/.gitlab-ci.yml b/.gitlab-ci.yml index 4050fc69..47941894 100644 --- a/.gitlab-ci.yml +++ b/.gitlab-ci.yml @@ -38,7 +38,7 @@ variables: # global RUSTFLAGS overrides the linker args so this way is better to pass the flags - printf '[build]\nrustflags = ["-C", "link-dead-code"]\n' | tee ${CARGO_HOME}/config - sccache -s - - git merge master HEAD + - git rebase master only: - master - /^v[0-9]+\.[0-9]+.*$/ # i.e. v1.0, v2.1rc1 -- GitLab From f51b2c1870d679f36c1fd51186e23026ac8b88ac Mon Sep 17 00:00:00 2001 From: Denis P Date: Fri, 10 Jan 2020 21:19:55 +0100 Subject: [PATCH 4/8] if gitlab can rebase to origin --- .gitlab-ci.yml | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/.gitlab-ci.yml b/.gitlab-ci.yml index 47941894..86f9ae53 100644 --- a/.gitlab-ci.yml +++ b/.gitlab-ci.yml @@ -38,7 +38,7 @@ variables: # global RUSTFLAGS overrides the linker args so this way is better to pass the flags - printf '[build]\nrustflags = ["-C", "link-dead-code"]\n' | tee ${CARGO_HOME}/config - sccache -s - - git rebase master + - git rebase origin/master only: - master - /^v[0-9]+\.[0-9]+.*$/ # i.e. v1.0, v2.1rc1 -- GitLab From 2f0831c132558147fbbbe0e598a74468f0a037d8 Mon Sep 17 00:00:00 2001 From: Denis P Date: Fri, 10 Jan 2020 21:30:42 +0100 Subject: [PATCH 5/8] git creds --- .gitlab-ci.yml | 3 +++ 1 file changed, 3 insertions(+) diff --git a/.gitlab-ci.yml b/.gitlab-ci.yml index 86f9ae53..a6f6af56 100644 --- a/.gitlab-ci.yml +++ b/.gitlab-ci.yml @@ -38,6 +38,9 @@ variables: # global RUSTFLAGS overrides the linker args so this way is better to pass the flags - printf '[build]\nrustflags = ["-C", "link-dead-code"]\n' | tee ${CARGO_HOME}/config - sccache -s + - git config --global user.email "devops-team@parity.io" + - git config --global user.name "Devops Team Parity" + - git config remote.origin.url "https://${GITHUB_TOKEN}@github.com/paritytech/cargo-contract.git" - git rebase origin/master only: - master -- GitLab From f79c0c98ae84a3a526228e2549537d0a2275c5cc Mon Sep 17 00:00:00 2001 From: Denis P Date: Fri, 10 Jan 2020 21:35:56 +0100 Subject: [PATCH 6/8] whatever origin should work --- .gitlab-ci.yml | 1 - 1 file changed, 1 deletion(-) diff --git a/.gitlab-ci.yml b/.gitlab-ci.yml index a6f6af56..91b2c9f5 100644 --- a/.gitlab-ci.yml +++ b/.gitlab-ci.yml @@ -40,7 +40,6 @@ variables: - sccache -s - git config --global user.email "devops-team@parity.io" - git config --global user.name "Devops Team Parity" - - git config remote.origin.url "https://${GITHUB_TOKEN}@github.com/paritytech/cargo-contract.git" - git rebase origin/master only: - master -- GitLab From 473852406c5e2989b807d85dfea81666e9829737 Mon Sep 17 00:00:00 2001 From: Denis P Date: Fri, 10 Jan 2020 21:42:01 +0100 Subject: [PATCH 7/8] how to know that I'm on the right branch --- .gitlab-ci.yml | 4 +--- 1 file changed, 1 insertion(+), 3 deletions(-) diff --git a/.gitlab-ci.yml b/.gitlab-ci.yml index 91b2c9f5..4114c34d 100644 --- a/.gitlab-ci.yml +++ b/.gitlab-ci.yml @@ -38,9 +38,7 @@ variables: # global RUSTFLAGS overrides the linker args so this way is better to pass the flags - printf '[build]\nrustflags = ["-C", "link-dead-code"]\n' | tee ${CARGO_HOME}/config - sccache -s - - git config --global user.email "devops-team@parity.io" - - git config --global user.name "Devops Team Parity" - - git rebase origin/master + - git show only: - master - /^v[0-9]+\.[0-9]+.*$/ # i.e. v1.0, v2.1rc1 -- GitLab From a3581aed1df3069bf09adcf6d5f8f3796bb1619f Mon Sep 17 00:00:00 2001 From: Denis P Date: Fri, 28 Feb 2020 20:02:21 +0100 Subject: [PATCH 8/8] remove --release from test --- .gitlab-ci.yml | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/.gitlab-ci.yml b/.gitlab-ci.yml index a2d4f1c6..cee2ce40 100644 --- a/.gitlab-ci.yml +++ b/.gitlab-ci.yml @@ -12,7 +12,7 @@ stages: variables: GIT_STRATEGY: fetch - GIT_DEPTH: "3" + GIT_DEPTH: 3 CARGO_HOME: "/ci-cache/${CI_PROJECT_NAME}/cargo/${CI_JOB_NAME}" CARGO_TARGET_DIR: "/ci-cache/${CI_PROJECT_NAME}/targets/${CI_COMMIT_REF_NAME}/${CI_JOB_NAME}" CI_SERVER_NAME: "GitLab CI" @@ -74,7 +74,7 @@ test: stage: test <<: *docker-env script: - - cargo test --verbose --all-features --release + - cargo test --verbose --all-features #### stage: build (default features) -- GitLab