Skip to content
This repository was archived by the owner on Nov 15, 2023. It is now read-only.
Closed
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
85 changes: 46 additions & 39 deletions .gitlab-ci.yml
Original file line number Diff line number Diff line change
Expand Up @@ -86,6 +86,12 @@ variables:
rules:
- if: $CI_COMMIT_REF_NAME =~ /^release-parachains-v[0-9].*$/ # i.e. release-parachains-v1.0, release-parachains-v2.1rc1, release-parachains-v3000

.integration-tests-refs:
rules:
- if: $CI_COMMIT_REF_NAME =~ /^release-parachains-v[0-9].*$/ # i.e. release-parachains-v1.0, release-parachains-v2.1rc1, release-parachains-v3000
# DEBUG: remove me
- if: $CI_COMMIT_REF_NAME =~ /^[0-9]+$/ # PRs

.zombienet-refs:
rules:
- if: $CI_PIPELINE_SOURCE == "pipeline"
Expand Down Expand Up @@ -135,49 +141,50 @@ variables:

include:
# test jobs
- scripts/ci/gitlab/pipeline/test.yml
# # build jobs
# - scripts/ci/gitlab/pipeline/test.yml
# build jobs
- scripts/ci/gitlab/pipeline/build.yml
# # benchmarks jobs
- scripts/ci/gitlab/pipeline/benchmarks.yml
# # publish jobs
- scripts/ci/gitlab/pipeline/publish.yml
# benchmarks jobs
# - scripts/ci/gitlab/pipeline/benchmarks.yml
# integration tests jobs
- scripts/ci/gitlab/pipeline/integration_tests.yml
# publish jobs
# - scripts/ci/gitlab/pipeline/publish.yml
# zombienet jobs
- scripts/ci/gitlab/pipeline/zombienet.yml

# - scripts/ci/gitlab/pipeline/zombienet.yml
#### stage: .post

# This job cancels the whole pipeline if any of provided jobs fail.
# In a DAG, every jobs chain is executed independently of others. The `fail_fast` principle suggests
# to fail the pipeline as soon as possible to shorten the feedback loop.
cancel-pipeline:
stage: .post
needs:
- job: test-linux-stable
rules:
- if: $CI_COMMIT_REF_NAME =~ /^[0-9]+$/ # PRs
when: on_failure
variables:
PROJECT_ID: "${CI_PROJECT_ID}"
PROJECT_NAME: "${CI_PROJECT_NAME}"
PIPELINE_ID: "${CI_PIPELINE_ID}"
FAILED_JOB_URL: "${FAILED_JOB_URL}"
FAILED_JOB_NAME: "${FAILED_JOB_NAME}"
PR_NUM: "${PR_NUM}"
trigger:
project: "parity/infrastructure/ci_cd/pipeline-stopper"
branch: "as-improve"

remove-cancel-pipeline-message:
stage: .post
rules:
- if: $CI_COMMIT_REF_NAME =~ /^[0-9]+$/ # PRs
variables:
PROJECT_ID: "${CI_PROJECT_ID}"
PROJECT_NAME: "${CI_PROJECT_NAME}"
PIPELINE_ID: "${CI_PIPELINE_ID}"
FAILED_JOB_URL: "https://gitlab.com"
FAILED_JOB_NAME: "nope"
PR_NUM: "${CI_COMMIT_REF_NAME}"
trigger:
project: "parity/infrastructure/ci_cd/pipeline-stopper"
# cancel-pipeline:
# stage: .post
# needs:
# - job: test-linux-stable
# rules:
# - if: $CI_COMMIT_REF_NAME =~ /^[0-9]+$/ # PRs
# when: on_failure
# variables:
# PROJECT_ID: "${CI_PROJECT_ID}"
# PROJECT_NAME: "${CI_PROJECT_NAME}"
# PIPELINE_ID: "${CI_PIPELINE_ID}"
# FAILED_JOB_URL: "${FAILED_JOB_URL}"
# FAILED_JOB_NAME: "${FAILED_JOB_NAME}"
# PR_NUM: "${PR_NUM}"
# trigger:
# project: "parity/infrastructure/ci_cd/pipeline-stopper"
# branch: "as-improve"

# remove-cancel-pipeline-message:
# stage: .post
# rules:
# - if: $CI_COMMIT_REF_NAME =~ /^[0-9]+$/ # PRs
# variables:
# PROJECT_ID: "${CI_PROJECT_ID}"
# PROJECT_NAME: "${CI_PROJECT_NAME}"
# PIPELINE_ID: "${CI_PIPELINE_ID}"
# FAILED_JOB_URL: "https://gitlab.com"
# FAILED_JOB_NAME: "nope"
# PR_NUM: "${CI_COMMIT_REF_NAME}"
# trigger:
# project: "parity/infrastructure/ci_cd/pipeline-stopper"
188 changes: 94 additions & 94 deletions scripts/ci/gitlab/pipeline/build.yml
Original file line number Diff line number Diff line change
Expand Up @@ -12,9 +12,10 @@ build-linux-stable:
# but still want to have debug assertions.
RUSTFLAGS: "-Cdebug-assertions=y -Dwarnings"
# this is an artificial job dependency, for pipeline optimization using GitLab's DAGs
needs:
- job: check-rustdoc
artifacts: false
# -------------- UNCOMMENT ME ---------------------
# needs:
# - job: check-rustdoc
# artifacts: false
script:
- echo "___Building a binary, please refrain from using it in production since it goes with the debug assertions.___"
- time cargo build --release --locked --bin polkadot-parachain
Expand All @@ -23,101 +24,100 @@ build-linux-stable:
- mv ./target/release/polkadot-parachain ./artifacts/.
- echo "___The VERSION is either a tag name or the curent branch if triggered not by a tag___"
- echo ${CI_COMMIT_REF_NAME} | tee ./artifacts/VERSION
# build-test-parachain:
# stage: build
# extends:
# - .docker-env
# - .common-refs
# - .collect-artifacts
# variables:
# # Enable debug assertions since we are running optimized builds for testing
# # but still want to have debug assertions.
# RUSTFLAGS: "-Cdebug-assertions=y -Dwarnings"
# # this is an artificial job dependency, for pipeline optimization using GitLab's DAGs
# needs:
# - job: check-rustdoc
# artifacts: false
# script:
# - echo "___Building a binary, please refrain from using it in production since it goes with the debug assertions.___"
# - time cargo +nightly build --release --locked --bin test-parachain
# - echo "___Packing the artifacts___"
# - mkdir -p ./artifacts
# - mv ./target/release/test-parachain ./artifacts/.
# - mkdir -p ./artifacts/zombienet
# - mv ./target/release/wbuild/cumulus-test-runtime/wasm_binary_spec_version_incremented.rs.compact.compressed.wasm ./artifacts/zombienet/.

build-test-parachain:
stage: build
extends:
- .docker-env
- .common-refs
- .collect-artifacts
variables:
# Enable debug assertions since we are running optimized builds for testing
# but still want to have debug assertions.
RUSTFLAGS: "-Cdebug-assertions=y -Dwarnings"
# this is an artificial job dependency, for pipeline optimization using GitLab's DAGs
needs:
- job: check-rustdoc
artifacts: false
script:
- echo "___Building a binary, please refrain from using it in production since it goes with the debug assertions.___"
- time cargo +nightly build --release --locked --bin test-parachain
- echo "___Packing the artifacts___"
- mkdir -p ./artifacts
- mv ./target/release/test-parachain ./artifacts/.
- mkdir -p ./artifacts/zombienet
- mv ./target/release/wbuild/cumulus-test-runtime/wasm_binary_spec_version_incremented.rs.compact.compressed.wasm ./artifacts/zombienet/.

# build runtime only if files in $RUNTIME_PATH/$RUNTIME_NAME were changed
.build-runtime-template: &build-runtime-template
stage: build
extends:
- .docker-env
- .pr-refs
# this is an artificial job dependency, for pipeline optimization using GitLab's DAGs
needs:
- job: check-rustdoc
artifacts: false
variables:
RUNTIME_PATH: "parachains/runtimes/assets"
script:
- cd ${RUNTIME_PATH}
- for directory in $(echo */); do
echo "_____Running cargo check for ${directory} ______";
cd ${directory};
pwd;
SKIP_WASM_BUILD=1 cargo check;
cd ..;
done
# # build runtime only if files in $RUNTIME_PATH/$RUNTIME_NAME were changed
# .build-runtime-template: &build-runtime-template
# stage: build
# extends:
# - .docker-env
# - .pr-refs
# # this is an artificial job dependency, for pipeline optimization using GitLab's DAGs
# needs:
# - job: check-rustdoc
# artifacts: false
# variables:
# RUNTIME_PATH: "parachains/runtimes/assets"
# script:
# - cd ${RUNTIME_PATH}
# - for directory in $(echo */); do
# echo "_____Running cargo check for ${directory} ______";
# cd ${directory};
# pwd;
# SKIP_WASM_BUILD=1 cargo check;
# cd ..;
# done

# DAG: build-runtime-assets -> build-runtime-collectives -> build-runtime-bridge-hubs
# DAG: build-runtime-assets -> build-runtime-collectives -> build-runtime-contracts
# DAG: build-runtime-assets -> build-runtime-starters -> build-runtime-testing
build-runtime-assets:
<<: *build-runtime-template
variables:
RUNTIME_PATH: "parachains/runtimes/assets"
# # DAG: build-runtime-assets -> build-runtime-collectives -> build-runtime-bridge-hubs
# # DAG: build-runtime-assets -> build-runtime-collectives -> build-runtime-contracts
# # DAG: build-runtime-assets -> build-runtime-starters -> build-runtime-testing
# build-runtime-assets:
# <<: *build-runtime-template
# variables:
# RUNTIME_PATH: "parachains/runtimes/assets"

build-runtime-collectives:
<<: *build-runtime-template
variables:
RUNTIME_PATH: "parachains/runtimes/collectives"
# this is an artificial job dependency, for pipeline optimization using GitLab's DAGs
needs:
- job: build-runtime-assets
artifacts: false
# build-runtime-collectives:
# <<: *build-runtime-template
# variables:
# RUNTIME_PATH: "parachains/runtimes/collectives"
# # this is an artificial job dependency, for pipeline optimization using GitLab's DAGs
# needs:
# - job: build-runtime-assets
# artifacts: false

build-runtime-bridge-hubs:
<<: *build-runtime-template
variables:
RUNTIME_PATH: "parachains/runtimes/bridge-hubs"
# this is an artificial job dependency, for pipeline optimization using GitLab's DAGs
needs:
- job: build-runtime-collectives
artifacts: false
# build-runtime-bridge-hubs:
# <<: *build-runtime-template
# variables:
# RUNTIME_PATH: "parachains/runtimes/bridge-hubs"
# # this is an artificial job dependency, for pipeline optimization using GitLab's DAGs
# needs:
# - job: build-runtime-collectives
# artifacts: false

build-runtime-contracts:
<<: *build-runtime-template
variables:
RUNTIME_PATH: "parachains/runtimes/contracts"
# this is an artificial job dependency, for pipeline optimization using GitLab's DAGs
needs:
- job: build-runtime-collectives
artifacts: false
# build-runtime-contracts:
# <<: *build-runtime-template
# variables:
# RUNTIME_PATH: "parachains/runtimes/contracts"
# # this is an artificial job dependency, for pipeline optimization using GitLab's DAGs
# needs:
# - job: build-runtime-collectives
# artifacts: false

build-runtime-starters:
<<: *build-runtime-template
variables:
RUNTIME_PATH: "parachains/runtimes/starters"
# this is an artificial job dependency, for pipeline optimization using GitLab's DAGs
needs:
- job: build-runtime-assets
artifacts: false
# build-runtime-starters:
# <<: *build-runtime-template
# variables:
# RUNTIME_PATH: "parachains/runtimes/starters"
# # this is an artificial job dependency, for pipeline optimization using GitLab's DAGs
# needs:
# - job: build-runtime-assets
# artifacts: false

build-runtime-testing:
<<: *build-runtime-template
variables:
RUNTIME_PATH: "parachains/runtimes/testing"
# this is an artificial job dependency, for pipeline optimization using GitLab's DAGs
needs:
- job: build-runtime-starters
artifacts: false
# build-runtime-testing:
# <<: *build-runtime-template
# variables:
# RUNTIME_PATH: "parachains/runtimes/testing"
# # this is an artificial job dependency, for pipeline optimization using GitLab's DAGs
# needs:
# - job: build-runtime-starters
# artifacts: false
53 changes: 53 additions & 0 deletions scripts/ci/gitlab/pipeline/integration_tests.yml
Original file line number Diff line number Diff line change
@@ -1,2 +1,55 @@
# This file is part of .gitlab-ci.yml
# Here are all jobs that are executed during "integration_stage" stage

integration-tests-build-polkadot:
stage: integration-tests
extends:
- .docker-env
- .integration-tests-refs
- .collect-artifacts
variables:
GIT_STRATEGY: none
script:
# -------------for tests-----------------
- export CI_COMMIT_REF_NAME="release-parachains-v9380"
# ---------------------------------------
# transform v9380 to v0.9.380
- export VERSION=$(echo ${CI_COMMIT_REF_NAME} | cut -d "-" -f 3 | sed -e "s/\(.\)\(.\)\(...\)/\10.\2.\3/")
- export BRANCH="it/release-${VERSION:0:-1}-fast-sudo"
- echo $VERSION $BRANCH
- git clone https://github.com/paritytech/polkadot
- mkdir -p ./artifacts
- cd polkadot
- git fetch origin $BRANCH
- git checkout $BRANCH
- cargo build --release --features fast-runtime
- mv ./target/release/polkadot ../artifacts/.

integration-tests-run:
stage: integration-tests
extends:
- .docker-env
- .integration-tests-refs
- .collect-artifacts
image: node:16
artifacts:
name: "${CI_JOB_NAME}_${CI_COMMIT_REF_NAME}"
when: always
expire_in: 1 days
paths:
- ./logs/
needs:
- job: build-linux-stable
artifacts: true
- job: integration-tests-build-polkadot
artifacts: true
before_script:
- echo ok
script:
- mkdir -p ./bin
- mkdir -p ./logs
- mv artifacts/polkadot ./bin/
- mv artifacts/polkadot-parachain ./bin/
- yarn global add @parity/parachains-integration-tests
# - sleep 3600
- ./scripts/parachains_integration_tests.sh