Skip to content
This repository has been archived by the owner on Nov 15, 2023. It is now read-only.

Commit

Permalink
Merge branch 'master' into davxy/companion-for-12224
Browse files Browse the repository at this point in the history
  • Loading branch information
davxy committed Sep 23, 2022
2 parents bf5a8a0 + a8df227 commit 8d8490b
Show file tree
Hide file tree
Showing 90 changed files with 1,133 additions and 879 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -65,7 +65,7 @@ jobs:
$CMD >> output.txt
sed -z -i 's/\n\n/\n/g' output.txt
cat output.txt | egrep -n -i ''
SUMMARY=$(./scripts/ci/extrinsic-ordering-filter.sh output.txt)
SUMMARY=$(./scripts/ci/github/extrinsic-ordering-filter.sh output.txt)
echo -e $SUMMARY
echo -e $SUMMARY >> output.txt
Expand Down
119 changes: 68 additions & 51 deletions .gitlab-ci.yml
Original file line number Diff line number Diff line change
Expand Up @@ -112,23 +112,6 @@ variables:
tags:
- kubernetes-parity-build

#### stage: .pre

# checks code format and fails if formatting is required
# the code will be formatted automatically and the pipeline will be restarted
cargo-fmt:
stage: .pre
<<: *pr-refs
<<: *kubernetes-env
before_script:
- echo PROJECT_NAME=$CI_PROJECT_NAME > fmt.env
- echo PR_BRANCH_NAME=$(curl -s https://api.github.com/repos/paritytech/${CI_PROJECT_NAME}/pulls/${CI_COMMIT_REF_NAME} | jq -r ".head.ref") >> fmt.env
script:
- cargo +nightly fmt --check
artifacts:
reports:
dotenv: fmt.env

#### stage: test

test-linux-stable:
Expand Down Expand Up @@ -234,7 +217,7 @@ build-test-parachain:
variables:
# Enable debug assertions since we are running optimized builds for testing
# but still want to have debug assertions.
RUSTFLAGS: "-Cdebug-assertions=y -Dwarnings"
RUSTFLAGS: "-Cdebug-assertions=y -Dwarnings"
# this is an artificial job dependency, for pipeline optimization using GitLab's DAGs
needs:
- job: check-rustdoc
Expand All @@ -248,9 +231,74 @@ build-test-parachain:
- 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
<<: *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-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-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-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


#### stage: publish

.build-push-image: &build-push-image
.build-push-image: &build-push-image
image: quay.io/buildah/stable
variables:
DOCKERFILE: "" # docker/path-to.Dockerfile
Expand Down Expand Up @@ -363,22 +411,7 @@ benchmarks-assets:
- *git-commit-push
# create PR to release-parachains-v* branch
- curl -u ${GITHUB_USER}:${GITHUB_TOKEN}
-d '{"title":"[benchmarks] Update weights for statemine/t","body":"This PR is generated automatically by CI.","head":"'${BRANCHNAME}'","base":"'${CI_COMMIT_BRANCH}'"}'
-X POST https://api.github.com/repos/paritytech/${CI_PROJECT_NAME}/pulls
# create PR to master
- curl -u ${GITHUB_USER}:${GITHUB_TOKEN}
-d '{"title":"[benchmarks] Update weights for statemine/t","body":"This PR is generated automatically by CI.","head":"'${BRANCHNAME}'","base":"master"}'
-X POST https://api.github.com/repos/paritytech/${CI_PROJECT_NAME}/pulls
# create PR to a branch with version number (e.g. v0.9.270) and release-v* (e.g. release-v0.9.270)
# transform release-parachains-v9270 to v0.9.270
- export BASEBRANCH=$(echo ${CI_COMMIT_BRANCH} | cut -d "-" -f 3 | sed -e "s/\(.\)\(.\)\(...\)/\10.\2.\3/")
# create PR to v* branch
- curl -u ${GITHUB_USER}:${GITHUB_TOKEN}
-d '{"title":"[benchmarks] Update weights for statemine/t","body":"This PR is generated automatically by CI.","head":"'${BRANCHNAME}'","base":"'${BASEBRANCH}'"}'
-X POST https://api.github.com/repos/paritytech/${CI_PROJECT_NAME}/pulls
# create PR to release-v* branch
- curl -u ${GITHUB_USER}:${GITHUB_TOKEN}
-d '{"title":"[benchmarks] Update weights for statemine/t","body":"This PR is generated automatically by CI.","head":"'${BRANCHNAME}'","base":"'release-${BASEBRANCH}'"}'
-d '{"title":"[benchmarks] Update weights for statemine/t","body":"This PR is generated automatically by CI. (Once merged please backport to master and node release branch.)","head":"'${BRANCHNAME}'","base":"'${CI_COMMIT_BRANCH}'"}'
-X POST https://api.github.com/repos/paritytech/${CI_PROJECT_NAME}/pulls
after_script:
- rm -rf .git/config
Expand Down Expand Up @@ -621,19 +654,3 @@ cancel-pipeline:
PR_NUM: "${PR_NUM}"
trigger:
project: "parity/infrastructure/ci_cd/pipeline-stopper"
# remove branch, when pipeline-stopper for substrate and polakdot is updated to the same branch
branch: "as-improve"

# this job will automatically format code and rerun pipeline if cargo-fmt job fails
auto-fmt:
stage: .post
rules:
- if: $CI_COMMIT_REF_NAME =~ /^[0-9]+$/ # PRs
when: on_failure
needs:
- job: cargo-fmt
variables:
PROJECT_NAME: "${CI_PROJECT_NAME}"
PR_BRANCH_NAME: "${PR_BRANCH_NAME}"
trigger:
project: "parity/infrastructure/ci_cd/auto-fmt"
Loading

0 comments on commit 8d8490b

Please sign in to comment.