From 3c0e942b334b103eb4ff3ea50ce42f83e87f10e2 Mon Sep 17 00:00:00 2001 From: Denis P Date: Wed, 25 Sep 2019 14:38:08 +0200 Subject: [PATCH] a simple CI for the start --- .gitlab-ci.yml | 80 ++++++++++++++++++++++++++++++++++++++++++++++++++ 1 file changed, 80 insertions(+) create mode 100644 .gitlab-ci.yml diff --git a/.gitlab-ci.yml b/.gitlab-ci.yml new file mode 100644 index 0000000000..6aa6ab98fd --- /dev/null +++ b/.gitlab-ci.yml @@ -0,0 +1,80 @@ +# .gitlab-ci.yml +# +# cumulus +# +# pipelines can be triggered manually in the web + + +stages: + - test + - build + +variables: + GIT_STRATEGY: fetch + CARGO_HOME: "/ci-cache/${CI_PROJECT_NAME}/cargo/${CI_JOB_NAME}" + SCCACHE_DIR: "/ci-cache/${CI_PROJECT_NAME}/sccache" + CARGO_INCREMENTAL: 0 + CI_SERVER_NAME: "GitLab CI" + +.collect-artifacts: &collect-artifacts + artifacts: + name: "${CI_JOB_NAME}_${CI_COMMIT_REF_NAME}" + when: on_success + expire_in: 7 days + paths: + - artifacts/ + +.docker-env: &docker-env + image: parity/rust-builder:latest + before_script: + - rustup show + - cargo --version + - sccache -s + only: + - master + - /^v[0-9]+\.[0-9]+.*$/ # i.e. v1.0, v2.1rc1 + - schedules + - web + - /^[0-9]+$/ # PRs + tags: + - linux-docker + +#### stage: test + +test-linux-stable: + stage: test + <<: *docker-env + variables: + # Enable debug assertions since we are running optimized builds for testing + # but still want to have debug assertions. + RUSTFLAGS: -Cdebug-assertions=y + script: + - time cargo test --all --release --frozen | + tee output.log + - sccache -s + after_script: + - echo "___Collecting warnings for check_warnings job___" + - awk '/^warning:/,/^$/ { print }' output.log > ${CI_COMMIT_SHORT_SHA}_warnings.log + artifacts: + name: $CI_COMMIT_SHORT_SHA + expire_in: 24 hrs + paths: + - ${CI_COMMIT_SHORT_SHA}_warnings.log + +#### stage: build + +check_warnings: + stage: build + <<: *docker-env + variables: + GIT_STRATEGY: none + dependencies: + - test-linux-stable + script: + - if [ -s ${CI_COMMIT_SHORT_SHA}_warnings.log ]; then + cat ${CI_COMMIT_SHORT_SHA}_warnings.log; + exit 1; + else + echo "___No warnings___"; + fi + allow_failure: true