From b2b5c7ee241bb13b217680bcb19ea884d45d5a0e Mon Sep 17 00:00:00 2001 From: Michael Mueller Date: Wed, 24 Mar 2021 16:07:29 +0100 Subject: [PATCH 1/3] Test new project template in CI --- .gitlab-ci.yml | 17 +++++++++++++++++ 1 file changed, 17 insertions(+) diff --git a/.gitlab-ci.yml b/.gitlab-ci.yml index 4ea682d3..af4627ec 100644 --- a/.gitlab-ci.yml +++ b/.gitlab-ci.yml @@ -81,6 +81,23 @@ test: script: - cargo test --verbose --workspace --all-features +test-new-project-template: + stage: test + <<: *docker-env + script: + - cargo run -- contract new new_project + - cargo run -- contract build --manifest-path new_project/Cargo.toml + - cargo run -- contract check --manifest-path new_project/Cargo.toml + - cd new_project + + # needed because otherwise: + # `error: current package believes it's in a workspace when it's not` + - echo "[workspace]" >> Cargo.toml + + - cargo check --verbose + - cargo test --verbose --all + - cargo fmt --verbose --all -- --check + #### stage: build (default features) build: -- GitLab From 38c4e212de28025be04a49a8df2bdea12d44edd3 Mon Sep 17 00:00:00 2001 From: Michael Mueller Date: Wed, 24 Mar 2021 17:37:57 +0100 Subject: [PATCH 2/3] Add empty workspace before build --- .gitlab-ci.yml | 9 +++++---- 1 file changed, 5 insertions(+), 4 deletions(-) diff --git a/.gitlab-ci.yml b/.gitlab-ci.yml index af4627ec..4a970dde 100644 --- a/.gitlab-ci.yml +++ b/.gitlab-ci.yml @@ -86,13 +86,14 @@ test-new-project-template: <<: *docker-env script: - cargo run -- contract new new_project - - cargo run -- contract build --manifest-path new_project/Cargo.toml - - cargo run -- contract check --manifest-path new_project/Cargo.toml - - cd new_project # needed because otherwise: # `error: current package believes it's in a workspace when it's not` - - echo "[workspace]" >> Cargo.toml + - echo "[workspace]" >> new_project/Cargo.toml + + - cargo run -- contract build --manifest-path new_project/Cargo.toml + - cargo run -- contract check --manifest-path new_project/Cargo.toml + - cd new_project - cargo check --verbose - cargo test --verbose --all -- GitLab From 1dc0d2f4771fee8f9e01c7d6eeb16e730a43f824 Mon Sep 17 00:00:00 2001 From: Michael Mueller Date: Wed, 24 Mar 2021 17:50:33 +0100 Subject: [PATCH 3/3] Add `--all-features` --- .gitlab-ci.yml | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/.gitlab-ci.yml b/.gitlab-ci.yml index 4a970dde..0562ac5a 100644 --- a/.gitlab-ci.yml +++ b/.gitlab-ci.yml @@ -91,8 +91,8 @@ test-new-project-template: # `error: current package believes it's in a workspace when it's not` - echo "[workspace]" >> new_project/Cargo.toml - - cargo run -- contract build --manifest-path new_project/Cargo.toml - - cargo run -- contract check --manifest-path new_project/Cargo.toml + - cargo run --all-features -- contract build --manifest-path new_project/Cargo.toml + - cargo run --all-features -- contract check --manifest-path new_project/Cargo.toml - cd new_project - cargo check --verbose -- GitLab