Skip to content

Commit

Permalink
Merge branch 'paritytech:master' into master
Browse files Browse the repository at this point in the history
  • Loading branch information
Bullrich authored Feb 21, 2024
2 parents 61813a5 + cbeccad commit a825d63
Show file tree
Hide file tree
Showing 812 changed files with 15,344 additions and 8,879 deletions.
2 changes: 2 additions & 0 deletions .config/taplo.toml
Original file line number Diff line number Diff line change
Expand Up @@ -2,10 +2,12 @@

# ignore zombienet as they do some deliberate custom toml stuff
exclude = [
"bridges/testing/**",
"cumulus/zombienet/**",
"polkadot/node/malus/integrationtests/**",
"polkadot/zombienet_tests/**",
"substrate/zombienet/**",
"target/**",
]

# global rules
Expand Down
18 changes: 10 additions & 8 deletions .github/workflows/check-labels.yml
Original file line number Diff line number Diff line change
Expand Up @@ -9,14 +9,6 @@ jobs:
check-labels:
runs-on: ubuntu-latest
steps:
- name: Skip merge queue
if: ${{ contains(github.ref, 'gh-readonly-queue') }}
run: exit 0
- name: Pull image
env:
IMAGE: paritytech/ruled_labels:0.4.0
run: docker pull $IMAGE

- name: Check labels
env:
IMAGE: paritytech/ruled_labels:0.4.0
Expand All @@ -28,6 +20,16 @@ jobs:
RULES_PATH: labels/ruled_labels
CHECK_SPECS: "specs_polkadot-sdk.yaml"
run: |
if [ ${{ github.ref }} == "refs/heads/master" ]; then
echo "Skipping master"
exit 0
fi
if [ $(echo ${{ github.ref }} | grep -c "gh-readonly-queue") -eq 1 ]; then
echo "Skipping merge queue"
exit 0
fi
docker pull $IMAGE
echo "REPO: ${REPO}"
echo "GITHUB_PR: ${GITHUB_PR}"
Expand Down
18 changes: 6 additions & 12 deletions .github/workflows/check-prdoc.yml
Original file line number Diff line number Diff line change
Expand Up @@ -17,31 +17,25 @@ env:
jobs:
check-prdoc:
runs-on: ubuntu-latest
if: github.event.pull_request.number != ''
steps:
- name: Checkout repo
uses: actions/checkout@b4ffde65f46336ab88eb53be808477a3936bae11 #v4.1.1
# we cannot show the version in this step (ie before checking out the repo)
# due to https://github.com/paritytech/prdoc/issues/15
- name: Skip merge queue
if: ${{ contains(github.ref, 'gh-readonly-queue') }}
run: exit 0
- name: Pull image
- name: Check if PRdoc is required
id: get-labels
run: |
echo "Pulling $IMAGE"
$ENGINE pull $IMAGE
- name: Check if PRdoc is required
id: get-labels
run: |
# Fetch the labels for the PR under test
echo "Fetch the labels for $API_BASE/${REPO}/pulls/${GITHUB_PR}"
labels=$( curl -H "Authorization: token ${GITHUB_TOKEN}" -s "$API_BASE/${REPO}/pulls/${GITHUB_PR}" | jq '.labels | .[] | .name' | tr "\n" ",")
echo "Labels: ${labels}"
echo "labels=${labels}" >> "$GITHUB_OUTPUT"
- name: Checkout repo
uses: actions/checkout@b4ffde65f46336ab88eb53be808477a3936bae11 #v4.1.1

- name: Check PRDoc version
run: |
echo "Checking PRdoc version"
$ENGINE run --rm -v $PWD:/repo $IMAGE --version
- name: Early exit if PR is silent
Expand Down
15 changes: 8 additions & 7 deletions .github/workflows/gitspiegel-trigger.yml
Original file line number Diff line number Diff line change
Expand Up @@ -13,14 +13,15 @@ on:
- unlocked
- ready_for_review
- reopened
# doesn't work as intended, triggers "workflow_run" webhook in any case
# the job doesn't check out any code, so it is relatively safe to run it on any event
pull_request_target:
types:
- opened
- synchronize
- unlocked
- ready_for_review
- reopened
# pull_request_target:
# types:
# - opened
# - synchronize
# - unlocked
# - ready_for_review
# - reopened
merge_group:

# drop all permissions for GITHUB_TOKEN
Expand Down
8 changes: 2 additions & 6 deletions .gitlab-ci.yml
Original file line number Diff line number Diff line change
Expand Up @@ -121,21 +121,17 @@ default:
before_script:
- 'curl --header "PRIVATE-TOKEN: $FL_CI_GROUP_TOKEN" -o forklift -L "${CI_API_V4_URL}/projects/676/packages/generic/forklift/${FL_FORKLIFT_VERSION}/forklift_${FL_FORKLIFT_VERSION}_linux_amd64"'
- chmod +x forklift
- mkdir .forklift
- cp $FL_FORKLIFT_CONFIG .forklift/config.toml
- export FORKLIFT_PACKAGE_SUFFIX=${CI_JOB_NAME/ [0-9 \/]*}
- mkdir ~/.forklift
- cp $FL_FORKLIFT_CONFIG ~/.forklift/config.toml
- shopt -s expand_aliases
- export PATH=$PATH:$(pwd)
- |
if [ "$FORKLIFT_BYPASS" != "true" ]; then
echo "FORKLIFT_BYPASS not set, creating alias cargo='forklift cargo'"
alias cargo="forklift cargo"
fi
- ls -al
- rm -f forklift.sock
#
- echo "FL_FORKLIFT_VERSION ${FL_FORKLIFT_VERSION}"
- echo "FORKLIFT_PACKAGE_SUFFIX $FORKLIFT_PACKAGE_SUFFIX"

.common-refs:
rules:
Expand Down
2 changes: 1 addition & 1 deletion .gitlab/check-each-crate.py
Original file line number Diff line number Diff line change
Expand Up @@ -55,7 +55,7 @@

print(f"Checking {crates[crate][0]}", file=sys.stderr)

res = subprocess.run(["cargo", "check", "--locked"], cwd = crates[crate][1])
res = subprocess.run(["forklift", "cargo", "check", "--locked"], cwd = crates[crate][1])

if res.returncode != 0:
sys.exit(1)
22 changes: 20 additions & 2 deletions .gitlab/pipeline/build.yml
Original file line number Diff line number Diff line change
Expand Up @@ -314,8 +314,9 @@ build-linux-substrate:
# tldr: we need to checkout the branch HEAD explicitly because of our dynamic versioning approach while building the substrate binary
# see https://github.com/paritytech/ci_cd/issues/682#issuecomment-1340953589
- git checkout -B "$CI_COMMIT_REF_NAME" "$CI_COMMIT_SHA"
- !reference [.forklift-cache, before_script]
script:
- WASM_BUILD_NO_COLOR=1 time cargo build --locked --release -p staging-node-cli
- time WASM_BUILD_NO_COLOR=1 cargo build --locked --release -p staging-node-cli
- mv $CARGO_TARGET_DIR/release/substrate-node ./artifacts/substrate/substrate
- echo -n "Substrate version = "
- if [ "${CI_COMMIT_TAG}" ]; then
Expand All @@ -334,6 +335,7 @@ build-runtimes-polkavm:
extends:
- .docker-env
- .common-refs
- .run-immediately
script:
- SUBSTRATE_RUNTIME_TARGET=riscv cargo check -p minimal-runtime
- SUBSTRATE_RUNTIME_TARGET=riscv cargo check -p westend-runtime
Expand All @@ -352,9 +354,10 @@ build-runtimes-polkavm:
CARGO_TARGET_DIR: "$CI_PROJECT_DIR/target"
before_script:
- mkdir -p ./artifacts/subkey
- !reference [.forklift-cache, before_script]
script:
- cd ./substrate/bin/utils/subkey
- SKIP_WASM_BUILD=1 time cargo build --locked --release
- time SKIP_WASM_BUILD=1 cargo build --locked --release
# - cd -
# - mv $CARGO_TARGET_DIR/release/subkey ./artifacts/subkey/.
# - echo -n "Subkey version = "
Expand Down Expand Up @@ -393,3 +396,18 @@ build-subkey-linux:
# after_script: [""]
# tags:
# - osx

# bridges

# we need some non-binary artifacts in our bridges+zombienet image
prepare-bridges-zombienet-artifacts:
stage: build
extends:
- .docker-env
- .common-refs
- .run-immediately
- .collect-artifacts
before_script:
- mkdir -p ./artifacts/bridges-polkadot-sdk/bridges
script:
- cp -r bridges/testing ./artifacts/bridges-polkadot-sdk/bridges/testing
1 change: 1 addition & 0 deletions .gitlab/pipeline/check.yml
Original file line number Diff line number Diff line change
Expand Up @@ -133,6 +133,7 @@ check-runtime-migration-westend:
WASM: "westend_runtime.compact.compressed.wasm"
URI: "wss://westend-try-runtime-node.parity-chains.parity.io:443"
SUBCOMMAND_EXTRA_ARGS: "--no-weight-warnings"
allow_failure: true

check-runtime-migration-rococo:
stage: check
Expand Down
22 changes: 22 additions & 0 deletions .gitlab/pipeline/publish.yml
Original file line number Diff line number Diff line change
Expand Up @@ -66,6 +66,8 @@ publish-rustdoc:
# note: images are used not only in zombienet but also in rococo, wococo and versi
.build-push-image:
image: $BUILDAH_IMAGE
extends:
- .zombienet-refs
variables:
DOCKERFILE: "" # docker/path-to.Dockerfile
IMAGE_NAME: "" # docker.io/paritypr/image_name
Expand All @@ -77,6 +79,7 @@ publish-rustdoc:
--build-arg VCS_REF="${CI_COMMIT_SHA}"
--build-arg BUILD_DATE="$(date -u '+%Y-%m-%dT%H:%M:%SZ')"
--build-arg IMAGE_NAME="${IMAGE_NAME}"
--build-arg ZOMBIENET_IMAGE="${ZOMBIENET_IMAGE}"
--tag "$IMAGE_NAME:${DOCKER_IMAGES_VERSION}"
--file ${DOCKERFILE} .
- echo "$PARITYPR_PASS" |
Expand Down Expand Up @@ -163,3 +166,22 @@ build-push-image-substrate-pr:
variables:
DOCKERFILE: "docker/dockerfiles/substrate_injected.Dockerfile"
IMAGE_NAME: "docker.io/paritypr/substrate"

# unlike other images, bridges+zombienet image is based on Zombienet image that pulls required binaries
# from other fresh images (polkadot and cumulus)
build-push-image-bridges-zombienet-tests:
stage: publish
extends:
- .kubernetes-env
- .common-refs
- .build-push-image
needs:
- job: build-linux-stable
artifacts: true
- job: build-linux-stable-cumulus
artifacts: true
- job: prepare-bridges-zombienet-artifacts
artifacts: true
variables:
DOCKERFILE: "docker/dockerfiles/bridges_zombienet_tests_injected.Dockerfile"
IMAGE_NAME: "docker.io/paritypr/bridges-zombienet-tests"
1 change: 1 addition & 0 deletions .gitlab/pipeline/test.yml
Original file line number Diff line number Diff line change
Expand Up @@ -224,6 +224,7 @@ cargo-check-benches:
git merge --verbose --no-edit FETCH_HEAD;
fi
fi'
- !reference [.forklift-cache, before_script]
parallel: 2
script:
- mkdir -p ./artifacts/benches/$CI_COMMIT_REF_NAME-$CI_COMMIT_SHORT_SHA
Expand Down
2 changes: 2 additions & 0 deletions .gitlab/pipeline/zombienet.yml
Original file line number Diff line number Diff line change
Expand Up @@ -10,3 +10,5 @@ include:
- .gitlab/pipeline/zombienet/cumulus.yml
# polkadot tests
- .gitlab/pipeline/zombienet/polkadot.yml
# bridges tests
- .gitlab/pipeline/zombienet/bridges.yml
63 changes: 63 additions & 0 deletions .gitlab/pipeline/zombienet/bridges.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,63 @@
# This file is part of .gitlab-ci.yml
# Here are all jobs that are executed during "zombienet" stage for bridges

# common settings for all zombienet jobs
.zombienet-bridges-common:
extends:
- .kubernetes-env
- .zombienet-refs
rules:
# Docker images have different tag in merge queues
- if: $CI_COMMIT_REF_NAME =~ /^gh-readonly-queue.*$/
variables:
DOCKER_IMAGES_VERSION: ${CI_COMMIT_SHORT_SHA}
- !reference [.build-refs, rules]
before_script:
- echo "Zombienet Tests Config"
- echo "${ZOMBIENET_IMAGE}"
- echo "${GH_DIR}"
- echo "${LOCAL_DIR}"
- ls "${LOCAL_DIR}"
- export DEBUG=zombie,zombie::network-node
- export ZOMBIENET_INTEGRATION_TEST_IMAGE="${BRIDGES_ZOMBIENET_TESTS_IMAGE}":${BRIDGES_ZOMBIENET_TESTS_IMAGE_TAG}
- echo "${ZOMBIENET_INTEGRATION_TEST_IMAGE}"
stage: zombienet
image: "${BRIDGES_ZOMBIENET_TESTS_IMAGE}:${BRIDGES_ZOMBIENET_TESTS_IMAGE_TAG}"
needs:
- job: build-push-image-bridges-zombienet-tests
artifacts: true
variables:
BRIDGES_ZOMBIENET_TESTS_IMAGE_TAG: ${DOCKER_IMAGES_VERSION}
BRIDGES_ZOMBIENET_TESTS_IMAGE: "docker.io/paritypr/bridges-zombienet-tests"
GH_DIR: "https://github.com/paritytech/polkadot-sdk/tree/${CI_COMMIT_SHA}/bridges/testing"
LOCAL_DIR: "/builds/parity/mirrors/polkadot-sdk/bridges/testing"
FF_DISABLE_UMASK_FOR_DOCKER_EXECUTOR: 1
RUN_IN_CONTAINER: "1"
artifacts:
name: "${CI_JOB_NAME}_${CI_COMMIT_REF_NAME}_zombienet_bridge_tests"
when: always
expire_in: 2 days
paths:
- ./zombienet-logs
after_script:
- mkdir -p ./zombienet-logs
# copy general logs
- cp -r /tmp/bridges-tests-run-*/logs/* ./zombienet-logs/
# copy logs of rococo nodes
- cp -r /tmp/bridges-tests-run-*/bridge_hub_rococo_local_network/*.log ./zombienet-logs/
# copy logs of westend nodes
- cp -r /tmp/bridges-tests-run-*/bridge_hub_westend_local_network/*.log ./zombienet-logs/

zombienet-bridges-0001-asset-transfer-works:
extends:
- .zombienet-bridges-common
script:
- /home/nonroot/bridges-polkadot-sdk/bridges/testing/run-new-test.sh 0001-asset-transfer --docker
- echo "Done"

zombienet-bridges-0002-mandatory-headers-synced-while-idle:
extends:
- .zombienet-bridges-common
script:
- /home/nonroot/bridges-polkadot-sdk/bridges/testing/run-new-test.sh 0002-mandatory-headers-synced-while-idle --docker
- echo "Done"
Loading

0 comments on commit a825d63

Please sign in to comment.