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 tracing-events
Browse files Browse the repository at this point in the history
  • Loading branch information
mattrutherford committed Jul 23, 2020
2 parents 0e14ca5 + ae579a8 commit 0b7b16e
Show file tree
Hide file tree
Showing 79 changed files with 8,004 additions and 1,634 deletions.
132 changes: 121 additions & 11 deletions .gitlab-ci.yml
Original file line number Diff line number Diff line change
Expand Up @@ -26,6 +26,8 @@ stages:
- test
- build
- post-build-test
- docker
- chaos
- publish
- deploy
- flaming-fir
Expand Down Expand Up @@ -64,12 +66,6 @@ default:
- rustup show
- cargo --version
- sccache -s
only:
- master
- /^v[0-9]+\.[0-9]+.*$/ # i.e. v1.0, v2.1rc1
- schedules
- web
- /^[0-9]+$/ # PRs
retry:
max: 2
when:
Expand All @@ -80,13 +76,42 @@ default:
tags:
- linux-docker

.docker-env-only: &docker-env-only
only:
- master
- /^v[0-9]+\.[0-9]+.*$/ # i.e. v1.0, v2.1rc1
- schedules
- web
- /^[0-9]+$/ # PRs

.build-only: &build-only
only:
- master
- /^v[0-9]+\.[0-9]+.*$/ # i.e. v1.0, v2.1rc1
- /^pre-v[0-9]+\.[0-9]+-[0-9a-f]+$/
- web

.build-rules: &build-rules
rules:
- if: '$DEPLOY_TAG'
when: never
- if: $CI_COMMIT_REF_NAME=="master"
when: always
- if: $CI_PIPELINE_SOURCE=="web"
when: always
- if: $CI_COMMIT_REF_NAME=~ /^v[0-9]+\.[0-9]+.*$/
when: always
- if: $CI_COMMIT_REF_NAME=~ /^pre-v[0-9]+\.[0-9]+-[0-9a-f]+$/
when: always
- if: '$CI_COMMIT_MESSAGE =~ /\[chaos:(basic|medium|large)\]/ && $CI_COMMIT_REF_NAME=~ /^[0-9]+$/' # i.e add [chaos:basic] in commit message to trigger
when: always
- when: never

.chaos-only: &chaos-only
only:
variables:
- '$CI_COMMIT_MESSAGE =~ /\[chaos:(basic|medium|large)\]/ && $CI_COMMIT_REF_NAME=~ /^[0-9]+$/' # i.e add [chaos:basic] in commit message to trigger

#### stage: .pre

skip-if-draft:
Expand All @@ -96,6 +121,10 @@ skip-if-draft:
only:
- /^[0-9]+$/ # Pull requests
script:
- echo "Commit message is ${CI_COMMIT_MESSAGE}"
- echo "Ref is ${CI_COMMIT_REF_NAME}"
- echo "pipeline source is ${CI_PIPELINE_SOURCE}"
- echo "deploy tag is ${DEPLOY_TAG}"
- ./.maintain/gitlab/skip_if_draft.sh

#### stage: check
Expand Down Expand Up @@ -149,6 +178,7 @@ test-dependency-rules:
cargo-audit:
stage: test
<<: *docker-env
<<: *docker-env-only
except:
- /^[0-9]+$/
script:
Expand All @@ -158,6 +188,7 @@ cargo-audit:
cargo-deny:
stage: test
<<: *docker-env
<<: *docker-env-only
only:
- schedules
- tags
Expand All @@ -177,6 +208,7 @@ cargo-deny:
cargo-check-benches:
stage: test
<<: *docker-env
<<: *docker-env-only
script:
- BUILD_DUMMY_WASM_BINARY=1 time cargo +nightly check --benches --all
- cargo run --release -p node-bench -- ::node::import::native::sr25519::transfer_keep_alive::paritydb::small
Expand All @@ -186,6 +218,7 @@ cargo-check-benches:
cargo-check-subkey:
stage: test
<<: *docker-env
<<: *docker-env-only
except:
- /^v[0-9]+\.[0-9]+.*$/ # i.e. v1.0, v2.1rc1
script:
Expand Down Expand Up @@ -217,6 +250,7 @@ test-deterministic-wasm:
test-linux-stable: &test-linux
stage: test
<<: *docker-env
<<: *docker-env-only
variables:
<<: *default-vars
# Enable debug assertions since we are running optimized builds for testing
Expand All @@ -235,6 +269,7 @@ test-linux-stable: &test-linux
unleash-check:
stage: test
<<: *docker-env
<<: *docker-env-only
only:
- master
- tags
Expand All @@ -246,6 +281,7 @@ test-frame-examples-compile-to-wasm:
# into one job
stage: test
<<: *docker-env
<<: *docker-env-only
variables:
<<: *default-vars
# Enable debug assertions since we are running optimized builds for testing
Expand Down Expand Up @@ -289,6 +325,7 @@ test-linux-stable-int:
check-web-wasm:
stage: test
<<: *docker-env
<<: *docker-env-only
except:
- /^v[0-9]+\.[0-9]+.*$/ # i.e. v1.0, v2.1rc1
script:
Expand All @@ -308,6 +345,7 @@ check-web-wasm:
test-full-crypto-feature:
stage: test
<<: *docker-env
<<: *docker-env-only
variables:
<<: *default-vars
# Enable debug assertions since we are running optimized builds for testing
Expand All @@ -328,6 +366,7 @@ cargo-check-macos:
stage: test
# shell runner on mac ignores the image set in *docker-env
<<: *docker-env
<<: *docker-env-only
script:
- BUILD_DUMMY_WASM_BINARY=1 time cargo check --release
- sccache -s
Expand Down Expand Up @@ -356,6 +395,7 @@ check-polkadot-companion-status:
check-polkadot-companion-build:
stage: build
<<: *docker-env
<<: *docker-env-only
needs:
- job: test-linux-stable-int
artifacts: false
Expand All @@ -368,6 +408,7 @@ check-polkadot-companion-build:
test-browser-node:
stage: build
<<: *docker-env
<<: *docker-env-only
needs:
- job: check-web-wasm
artifacts: false
Expand All @@ -383,15 +424,12 @@ build-linux-substrate: &build-binary
stage: build
<<: *collect-artifacts
<<: *docker-env
<<: *build-only
<<: *build-rules
needs:
- job: test-linux-stable
artifacts: false
before_script:
- mkdir -p ./artifacts/substrate/
except:
variables:
- $DEPLOY_TAG
script:
- WASM_BUILD_NO_COLOR=1 time cargo build --release --verbose
- mv ./target/release/substrate ./artifacts/substrate/.
Expand All @@ -411,7 +449,10 @@ build-linux-substrate: &build-binary


build-linux-subkey: &build-subkey
<<: *build-binary
stage: build
<<: *collect-artifacts
<<: *docker-env
<<: *build-only
needs:
- job: cargo-check-subkey
artifacts: false
Expand Down Expand Up @@ -441,6 +482,7 @@ build-macos-subkey:
build-rust-doc-release:
stage: build
<<: *docker-env
<<: *docker-env-only
allow_failure: true
artifacts:
name: "${CI_JOB_NAME}_${CI_COMMIT_REF_NAME}-doc"
Expand Down Expand Up @@ -474,6 +516,73 @@ trigger-contracts-ci:
- master
- schedules

#### stage: docker
docker-build-chaos: &docker-build-chaos
<<: *chaos-only
stage: docker
needs:
- job: build-linux-substrate
image: docker:stable
tags:
- kubernetes-parity-build
variables:
<<: *default-vars
DOCKER_HOST: tcp://localhost:2375
DOCKER_DRIVER: overlay2
PRODUCT: substrate
DOCKERFILE: $PRODUCT.Dockerfile
CONTAINER_IMAGE: paritypr/$PRODUCT
environment:
name: parity-chaosnet
services:
- docker:dind
before_script:
- test "$DOCKER_CHAOS_USER" -a "$DOCKER_CHAOS_TOKEN"
|| ( echo "no docker credentials provided"; exit 1 )
- docker login -u "$DOCKER_CHAOS_USER" -p "$DOCKER_CHAOS_TOKEN"
- docker info
script:
- cd ./artifacts/$PRODUCT/
- VERSION="ci-${CI_COMMIT_SHORT_SHA}"
- echo "${PRODUCT} version = ${VERSION}"
- test -z "${VERSION}" && exit 1
- docker build
--build-arg VCS_REF="${CI_COMMIT_SHA}"
--build-arg BUILD_DATE="$(date -u '+%Y-%m-%dT%H:%M:%SZ')"
--tag $CONTAINER_IMAGE:$VERSION
--file $DOCKERFILE .
- docker push $CONTAINER_IMAGE:$VERSION
after_script:
- docker logout

#### stage: chaos
chaos-test-singlenodeheight:
<<: *chaos-only
stage: chaos
image: parity/chaostools:latest
needs:
- job: docker-build-chaos
tags:
- parity-chaos
variables:
<<: *default-vars
PRODUCT: substrate
DOCKERFILE: $PRODUCT.Dockerfile
CONTAINER_IMAGE: paritypr/$PRODUCT
KEEP_NAMESPACE: 0
NAMESPACE: "substrate-ci-${CI_COMMIT_SHORT_SHA}-${CI_PIPELINE_ID}"
VERSION: "ci-${CI_COMMIT_SHORT_SHA}"
interruptible: true
environment:
name: parity-chaosnet
script:
- cd ./.maintain/chaostest
- npm link
- chaostest spawn dev -i $CONTAINER_IMAGE:$VERSION
- chaostest singlenodeheight -h 30
after_script:
- chaostest clean

#### stage: publish

.build-push-docker-image: &build-push-docker-image
Expand Down Expand Up @@ -596,6 +705,7 @@ publish-draft-release:
publish-to-crates-io:
stage: publish
<<: *docker-env
<<: *docker-env-only
only:
- /^ci-release-.*$/
- /^v[0-9]+\.[0-9]+\.[0-9]+.*$/
Expand Down
1 change: 1 addition & 0 deletions .maintain/chaostest/.eslintignore
Original file line number Diff line number Diff line change
@@ -0,0 +1 @@
node_modules
19 changes: 19 additions & 0 deletions .maintain/chaostest/.eslintrc.json
Original file line number Diff line number Diff line change
@@ -0,0 +1,19 @@
{
"env": {
"node": true,
"commonjs": true,
"es6": true
},
"extends": [
"standard"
],
"globals": {
"Atomics": "readonly",
"SharedArrayBuffer": "readonly"
},
"parserOptions": {
"ecmaVersion": 2018
},
"rules": {
}
}
11 changes: 11 additions & 0 deletions .maintain/chaostest/.gitignore
Original file line number Diff line number Diff line change
@@ -0,0 +1,11 @@
*-debug.log
*-error.log
/.nyc_output
/dist
/tmp
/log
.DS_Store
.editorconfig
yarn.lock
node_modules
/src/config/config.json
Loading

0 comments on commit 0b7b16e

Please sign in to comment.